3

I seem to have a conflict when trying to install Rails on Mountain Lion. I have tried updating Ruby but this did not help. I also tried Rails Installer but that also gave an error. Ruby version is 1.8.7

Here is the error I am getting from terminal

sudo gem install rails Building native extensions. This could take a while... ERROR: Error installing rails: ERROR: Failed to build gem native extension. /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby extconf.rb mkmf.rb can't find header files for ruby at /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/ruby.h Gem files will remain installed in /Library/Ruby/Gems/1.8/gems/atomic-1.1.10 for inspection. Results logged to /Library/Ruby/Gems/1.8/gems/atomic-1.1.10/ext/gem_make.out 
2
  • 1
    Brother, let me tell you: This could take quite a bit of googling. I just went thru similar hell this past week (I'm a first time user of RoR on OSX). If you haven't already go get Homebrew and RVM. Go from there. Commented Jul 12, 2013 at 0:10
  • I'm a first timer too and man was it a convoluted process. I finally got it working with RVM. Cheers Commented Jul 12, 2013 at 1:45

4 Answers 4

1

I was having the same issues and I had all the requirements. My solution? Upgraded (through RVM) my version of Ruby from 2.0.0-p195 to 2.0.0-p353. After this I tried gem install rails and it worked like it was supposed to.

Sign up to request clarification or add additional context in comments.

Comments

1

I installed the x-code command line tools and then the rails install worked correctly.

1 Comment

I re-ran xcode-select --install and it worked. Thanks.
0

Use RailsInstaller and these step-by-step instructions:

1 Comment

Thanks I tried using rails installer but it flat out wouldn't install. I managed to eventually get it working through RVM.
0

I found the answer here, http://net.tutsplus.com/tutorials/ruby/how-to-install-ruby-on-a-mac/

Although by no means was this a walk in the park, due to version conflicts, the tut is over a year old and Rails now requires at least Ruby 1.9.3 and you need to install Command Line tools in Xcode. This tut uses RVM.

I tried Rails Installer which sounds a lot easier than doing it this way but that also gave me an error. I think I had major version conflicts going on. If you are trying to install Rails then I'd try Rails Installer first. Here's a very recent tut on installing it, http://pragmaticstudio.com/blog/2010/9/23/install-rails-ruby-mac

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.