Bcrypt-ruby installation issues in linux

Hi

Today, I did production server setup on Amazon EC2 server. Even though I have experience to do how to setup but bcrypt-ruby installation will suffered me alot. I have got following errors when I am doing ‘bundle install’


Installing bcrypt-ruby (2.1.4) with native extensions /usr/lib/ruby/site_ruby/1.8/rubygems/installer.rb:483:in `build_extensions': ERROR: Failed to build gem native extension. (Gem::Installer::ExtensionBuildError)

/usr/bin/ruby extconf.rb
 mkmf.rb can't find header files for ruby at /usr/lib/ruby/ruby.h

Gem files will remain installed in /home/deploy/.bundler/tmp/29722/gems/bcrypt-ruby-2.1.4 for inspection.
 Results logged to /home/deploy/.bundler/tmp/29722/gems/bcrypt-ruby-2.1.4/ext/mri/gem_make.out
 from /usr/lib/ruby/site_ruby/1.8/rubygems/installer.rb:446:in `each'
 from /usr/lib/ruby/site_ruby/1.8/rubygems/installer.rb:446:in `build_extensions'
 from /usr/lib/ruby/site_ruby/1.8/rubygems/installer.rb:198:in `install'
 from /usr/lib/ruby/gems/1.8/gems/bundler-1.0.13/lib/bundler/source.rb:100:in `install'
 from /usr/lib/ruby/gems/1.8/gems/bundler-1.0.13/lib/bundler/installer.rb:58:in `run'
 from /usr/lib/ruby/gems/1.8/gems/bundler-1.0.13/lib/bundler/rubygems_integration.rb:90:in `with_build_args'
 from /usr/lib/ruby/gems/1.8/gems/bundler-1.0.13/lib/bundler/installer.rb:57:in `run'
 from /usr/lib/ruby/gems/1.8/gems/bundler-1.0.13/lib/bundler/spec_set.rb:12:in `each'
 from /usr/lib/ruby/gems/1.8/gems/bundler-1.0.13/lib/bundler/spec_set.rb:12:in `each'
 from /usr/lib/ruby/gems/1.8/gems/bundler-1.0.13/lib/bundler/installer.rb:49:in `run'
 from /usr/lib/ruby/gems/1.8/gems/bundler-1.0.13/lib/bundler/installer.rb:8:in `install'
 from /usr/lib/ruby/gems/1.8/gems/bundler-1.0.13/lib/bundler/cli.rb:222:in `install'
 from /usr/lib/ruby/gems/1.8/gems/bundler-1.0.13/lib/bundler/vendor/thor/task.rb:22:in `send'
 from /usr/lib/ruby/gems/1.8/gems/bundler-1.0.13/lib/bundler/vendor/thor/task.rb:22:in `run'
 from /usr/lib/ruby/gems/1.8/gems/bundler-1.0.13/lib/bundler/vendor/thor/invocation.rb:118:in `invoke_task'
 from /usr/lib/ruby/gems/1.8/gems/bundler-1.0.13/lib/bundler/vendor/thor.rb:246:in `dispatch'
 from /usr/lib/ruby/gems/1.8/gems/bundler-1.0.13/lib/bundler/vendor/thor/base.rb:389:in `start'
 from /usr/lib/ruby/gems/1.8/gems/bundler-1.0.13/bin/bundle:13
 from /usr/bin/bundle:19:in `load'
 from /usr/bin/bundle:19

Reason: It didn’t find ruby header files to do native compilation. For that you need to install ruby-development packages. Here is the way to install in RedHat:

1) yum search ruby. This will give all packages. Pick the package name and do

2) yum install “package-name”

After installation ruby-dev packages and doing bundle install I got following error:


Installing bcrypt-ruby (2.1.4) with native extensions /usr/lib/ruby/site_ruby/1.8/rubygems/installer.rb:483:in `build_extensions': ERROR: Failed to build gem native extension. (Gem::Installer::ExtensionBuildError)

/usr/bin/ruby extconf.rb
 creating Makefile

make
 sh: make: command not found

Gem files will remain installed in /home/deploy/.bundler/tmp/30223/gems/bcrypt-ruby-2.1.4 for inspection.
 Results logged to /home/deploy/.bundler/tmp/30223/gems/bcrypt-ruby-2.1.4/ext/mri/gem_make.out
 from /usr/lib/ruby/site_ruby/1.8/rubygems/installer.rb:446:in `each'
 from /usr/lib/ruby/site_ruby/1.8/rubygems/installer.rb:446:in `build_extensions'
 from /usr/lib/ruby/site_ruby/1.8/rubygems/installer.rb:198:in `install'
 from /usr/lib/ruby/gems/1.8/gems/bundler-1.0.13/lib/bundler/source.rb:100:in `install'
 from /usr/lib/ruby/gems/1.8/gems/bundler-1.0.13/lib/bundler/installer.rb:58:in `run'
 from /usr/lib/ruby/gems/1.8/gems/bundler-1.0.13/lib/bundler/rubygems_integration.rb:90:in `with_build_args'
 from /usr/lib/ruby/gems/1.8/gems/bundler-1.0.13/lib/bundler/installer.rb:57:in `run'
 from /usr/lib/ruby/gems/1.8/gems/bundler-1.0.13/lib/bundler/spec_set.rb:12:in `each'
 from /usr/lib/ruby/gems/1.8/gems/bundler-1.0.13/lib/bundler/spec_set.rb:12:in `each'
 from /usr/lib/ruby/gems/1.8/gems/bundler-1.0.13/lib/bundler/installer.rb:49:in `run'
 from /usr/lib/ruby/gems/1.8/gems/bundler-1.0.13/lib/bundler/installer.rb:8:in `install'
 from /usr/lib/ruby/gems/1.8/gems/bundler-1.0.13/lib/bundler/cli.rb:222:in `install'
 from /usr/lib/ruby/gems/1.8/gems/bundler-1.0.13/lib/bundler/vendor/thor/task.rb:22:in `send'
 from /usr/lib/ruby/gems/1.8/gems/bundler-1.0.13/lib/bundler/vendor/thor/task.rb:22:in `run'
 from /usr/lib/ruby/gems/1.8/gems/bundler-1.0.13/lib/bundler/vendor/thor/invocation.rb:118:in `invoke_task'
 from /usr/lib/ruby/gems/1.8/gems/bundler-1.0.13/lib/bundler/vendor/thor.rb:246:in `dispatch'
 from /usr/lib/ruby/gems/1.8/gems/bundler-1.0.13/lib/bundler/vendor/thor/base.rb:389:in `start'
 from /usr/lib/ruby/gems/1.8/gems/bundler-1.0.13/bin/bundle:13
 from /usr/bin/bundle:19:in `load'
 from /usr/bin/bundle:19

For this you need install ‘make’. Here is the way to install in RedHat

yum install make

I hope no one won’t face this problem again. Any feedback would be welcome.

Advertisements

One thought on “Bcrypt-ruby installation issues in linux

  1. omg you’re a fucking lifesaver. I’ve spent hours and hours trying to find the solution to this and it seems there are a lot of people out there are too. Jesus I cant believe it was so simple.

    Like

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s