Unable to fix bundle install for stones with native extensions

I am deploying Ruby On Rails applications on an Amazon EC2 cloud server. The server runs on Amazon Linux alami-2011.02. I can’t say which distribution it is based on (from my search, RedHat / CentOS, but I'm new to this field).

I installed the Ruby environment with RVM (installed as root). I installed two rubies:

  • REE 1.8.7
  • Ruby 1.9.2-p290

For each Rails application that I deploy, I create a separate Gemset RVM.

Since I ran into this problem, I completely updated the Ruby environment by running rvm implode .

Here are my versions of the environment:

 ruby -v ---> ruby 1.9.2p290 (2011-07-09 revision 32553) [x86_64-linux] rvm -v ---> 1.8.1 gem -v ---> 1.6.2 bundle -v ---> Bundler version 1.0.18 

After that rvm implode :

  • I installed 2 rubiks again
  • I created a gemset for the ree-1.8.7 application and installed the necessary gems -> no problem
  • I created a gemset for ruby-1.9.2 application and installed gems through Bundle -> no problem, even for gems with native extensions
  • I created a gemset for another ruby-1.9.2, tried to set gems through the Bundle ... here it appears again!

This is what I know when executing bundle install (registered as root):

 Updating https://github.com/p7r/will_paginate.git Fetching source index for http://rubygems.org/ Installing rake (0.9.2) Installing multi_json (1.0.3) Installing activesupport (3.1.0) Installing bcrypt-ruby (3.0.0) with native extensions /usr/local/rvm/scripts/rvm/rubies/ruby-1.9.2-p290/lib/ruby/site_ruby/1.9.1/rubygems/installer.rb:552:in `rescue in block in build_extensions': ERROR: Failed to build gem native extension. (Gem::Installer::ExtensionBuildError) /usr/local/rvm/scripts/rvm/rubies/ruby-1.9.2-p290/bin/ruby extconf.rb Gem files will remain installed in /usr/local/rvm/scripts/rvm/gems/ ruby-1.9.2-p290@app /gems/bcrypt-ruby-3.0.0 for inspection. Results logged to /usr/local/rvm/scripts/rvm/gems/ ruby-1.9.2-p290@app /gems/bcrypt-ruby-3.0.0/ext/mri/gem_make.out [ removed the backtrace ] 

However, if I just use gem install bcrypt , the pearl installs correctly, and I can just use bundle install , which will work until the next stone with native extensions ...

I had the same problem with installing ruby-1.9.2-p180, I tried to downgrade RubyGems to different versions to 1.5.3, I blew my RVM ... I searched a lot on the Internet for answers, this problem seems to be repeated, but for nothing worked for me.

Thanks in advance for your help!

+6
source share
2 answers

This may be due to insufficient memory to compile your own extensions. In my experience, bundle install is more memory intensive than just using gem install . Take a look at /var/log/messages and see if there are any problems. Also, use top to identify any heavy processes, such as peers leaving the rails console running in a screen session .;)

+8
source

If you are working on linux, you need to install the libraries / packages before installing gbbbcript-ruby.

sudo apt-get install ruby1.8-dev // for ruby ​​1.8.7

or

 sudo apt-get install ruby-dev 

or

sudo apt-get install ruby1.9-dev // for ruby ​​1.9.2

you can now install the bcrypt-ruby bug with the following command

 sudo gem install bcrypt-ruby 
+1
source

Source: https://habr.com/ru/post/896771/


All Articles