0
votes

I am trying to install rails on my EC2 instance. I installed gem after reinstalling ruby. I am running ruby version 1.8.7 and gem version 1.8.12. I am trying to install rails and getting the following error.


*$ sudo gem install rails -v=3.1.1 Fetching: activesupport-3.1.1.gem (100%) Fetching: activemodel-3.1.1.gem (100%) Fetching: actionpack-3.1.1.gem (100%) Fetching: activerecord-3.1.1.gem (100%) Fetching: activeresource-3.1.1.gem (100%) Fetching: actionmailer-3.1.1.gem (100%) Building native extensions. This could take a while... ERROR: Error installing rails: ERROR: Failed to build gem native extension. /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/lib64/ruby/gems/1.8/gems/json-1.6.4 for inspection. Results logged to /usr/lib64/ruby/gems/1.8/gems/json-1.6.4/ext/json/ext/parser/gem_make.out*


Any ideas?

Thanks!

1
Did you check over your error message? Looks like the build process can't find header files for ruby at /usr/lib/ruby/ruby.h. Perhaps you've installed Ruby somewhere else (maybe /usr/lib64/ruby)?sczizzo
After installing ruby-devel (using yum install ruby-devel) rails installation worked fine.user414585
you can post your own conclusion as an answer and accept it, so it might help others with the same problem in the future.tmaximini

1 Answers

0
votes

I've had a similar error when trying to install rails. The issue was that I had not installed the ruby-devel.i686 bundle. Granted this is on CentOS 6.3, but it seems like you may need to install this as well.