I am deploying Ruby On Rails apps on an Amazon EC2 cloud server. The server is running on Amazon Linux alami-2011.02. I can't say the distro it's based on (from my search, RedHat/CentOS, but I'm newbie in that field).
I've installed my Ruby environment with RVM (installed as root). I've setup two rubies:
For each Rails app I deploy, I create a separate RVM gemset.
Since I ran in this problem, I've refreshed completely the Ruby environment by running rvm implode
.
Here are my environment versions:
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 this rvm implode
:
This is what I get know when performing bundle install
(logged in 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 gem install correctly, and I can just use bundle install
which will run until the next gem with native extensions...
I've had the same issue with a ruby-1.9.2-p180 install, I tried downgrading RubyGems to different versions until 1.5.3, I imploded my RVM... I've looked a lot on the web for answers, this problem seems recurrent, but nothing worked for me.
Thanks in advance for your help!
In the invoked popup, start typing bundler, select bundle install and press Enter . Select Tools | Bundler | Install from the main menu. Open the Gemfile, place the caret at any highlighted gem missing in the project SDK and press Alt+Enter . Select Install missing gems using 'bundler' and press Enter .
Common Attempts To Resolve Ruby Gem Dependencies Bundler can help to resolve dependencies when working with Ruby gems by allowing you to specify a set of gems in a Gemfile, then issue a single command to install them. Bundler then automatically resolves the dependencies for you.
Almost seems like running 'gem install' adds it to the global available gems (and hence terminal can run the package's commands), whereas adding it to the gemfile and running bundle install only adds it to the application. Similar to npm install --global. that's basically it.
Show activity on this post. I know that when using gem install , the gem will be stored under /home/username/. rvm/gems/, under which gemset the gem was installed.
This might be due to insufficient memory for compiling the native extensions. In my experience, bundle install
is more memory intensive than simply using gem install
. Take a look at /var/log/messages
and see if any such issues are present. Also, use top
to identify any heavyweight processes, like colleagues leaving rails console
running in a screen session. ;)
If you are running on linux you need to install libraries/packages before install bcrypt-ruby gem.
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
now you can install bcrypt-ruby gem with following command
sudo gem install bcrypt-ruby
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With