5
votes

Hi I'm new setting up servers I'm installing rails on an Amazon Linux

Installed List: -ruby -development tools -gems -zlib-devel -readline-devel

I'm trying to install rails and now I'm stuck here

$ sudo gem install rails 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.3 for inspection. Results logged to /usr/lib64/ruby/gems/1.8/gems/json-1.6.3/ext/json/ext/parser/gem_make.out

Is there a problem with this json library

4

4 Answers

14
votes

You need to install the following

yum install ruby-devel
yum install make
yum install gcc
5
votes

You should be using Ruby 1.9.x, to upgrade Ruby:

sudo yum install ruby19

and also

sudo yum install ruby19-devel
sudo yum install make
sudo yum install gcc
1
votes

If you've installed rvm, make sure to use rvm gem install rails

-3
votes

THe problem has nothing to do with RVM. The problem is you need ruby source header files. Compile ruby from source(RVM does that) or install the appropiate headers for your ruby version.
What is amazon linux(there is not such thing) ? is it ubuntu or what ?
How did you installed ruby ? what does ruby -v says ?