Ruby-on-rails – Bundle error in Ruby on rails

ruby-on-rails

i ran bundle inside a ror project which resulted in following error.

I am unable to understand what is missing.

[root@kracekumar canvas-lms]# bundle
Fetching source index for http://rubygems.org/
Using rake (0.8.7) 
Using abstract (1.0.0) 
Installing activesupport (2.3.11) 
Using rack (1.1.0) 
Installing actionpack (2.3.11) 
Installing actionmailer (2.3.11) 
Installing activerecord (2.3.11) 
Installing activeresource (2.3.11) 
Installing authlogic (2.1.3) 
Using builder (2.1.2) 
Using mime-types (1.16) 
Installing xml-simple (1.0.12) 
Installing aws-s3 (0.6.2) 
Installing bluecloth (2.0.10) with native extensions 
/usr/lib/ruby/site_ruby/1.8/rubygems/installer.rb:481: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 /usr/lib/ruby/gems/1.8/gems/bluecloth-2.0.10 for inspection.
Results logged to /usr/lib/ruby/gems/1.8/gems/bluecloth-2.0.10/ext/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.10/lib/bundler/source.rb:96:in `install'
    from /usr/lib/ruby/gems/1.8/gems/bundler-1.0.10/lib/bundler/installer.rb:55:in `run'
    from /usr/lib/ruby/gems/1.8/gems/bundler-1.0.10/lib/bundler/spec_set.rb:12:in `each'
    from /usr/lib/ruby/gems/1.8/gems/bundler-1.0.10/lib/bundler/spec_set.rb:12:in `each'
    from /usr/lib/ruby/gems/1.8/gems/bundler-1.0.10/lib/bundler/installer.rb:44:in `run'
    from /usr/lib/ruby/gems/1.8/gems/bundler-1.0.10/lib/bundler/installer.rb:8:in `install'
    from /usr/lib/ruby/gems/1.8/gems/bundler-1.0.10/lib/bundler/cli.rb:226:in `install'
    from /usr/lib/ruby/gems/1.8/gems/bundler-1.0.10/lib/bundler/vendor/thor/task.rb:22:in `send'
    from /usr/lib/ruby/gems/1.8/gems/bundler-1.0.10/lib/bundler/vendor/thor/task.rb:22:in `run'
    from /usr/lib/ruby/gems/1.8/gems/bundler-1.0.10/lib/bundler/vendor/thor/invocation.rb:118:in `invoke_task'
    from /usr/lib/ruby/gems/1.8/gems/bundler-1.0.10/lib/bundler/vendor/thor.rb:246:in `dispatch'
    from /usr/lib/ruby/gems/1.8/gems/bundler-1.0.10/lib/bundler/vendor/thor/base.rb:389:in `start'
    from /usr/lib/ruby/gems/1.8/gems/bundler-1.0.10/bin/bundle:13
    from /usr/bin/bundle:19:in `load'
    from /usr/bin/bundle:19
[root@kracekumar canvas-lms]#

Best Answer

For Red Hat systems, you can install the pre-requisites like this:

sudo yum -y install make gcc ruby-devel

and it should correctly install the dependencies you need for a native gem install.

This assumes you have Gems already installed, if not, install that as well:

sudo yum -y install rubygems

(Tested on an Amazon EC2 instance, which uses yum.)

Related Topic