Installing Rails on Mountain Lion

Posted by Jordan Medlock on Stack Overflow See other posts from Stack Overflow or by Jordan Medlock
Published on 2012-10-22T02:40:30Z Indexed on 2012/10/22 5:01 UTC
Read the original article Hit count: 218

I was wondering if you could help me find why I cannot install Ruby on Rails on my MBP with OS X Mountain Lion. It's a weird problem and I'll give you as much info as I can.


I've installed ruby and it's working at version 1.9.3

And I've installed ruby gems and it's worked for every other gem I've tried to install.
It's version is 1.8.24

When I run $ sudo gem install rails it replies with the message: Successfully installed rails-3.2.8 1 gem installed

Although when I ask it rails -v it returns:

`Rails is not currently installed on this system. To get the latest version, simply type:

    $ sudo gem install rails

You can then rerun your "rails" command.`

What should I do?


The rails bash file (/usr/bin/rails) contains:

#!/usr/bin/ruby
# Stub rails command to load rails from Gems or print an error if not installed.
require 'rubygems'

version = ">= 0"
if ARGV.first =~ /^_(.*)_$/ and Gem::Version.correct? $1 then
version = $1
    ARGV.shift
end

begin
    gem 'railties', version or raise
rescue Exception
    puts 'Rails is not currently installed on this system. To get the latest version, simply type:'
    puts
    puts '    $ sudo gem install rails'
    puts
    puts 'You can then rerun your "rails" command.'
    exit 0
end

load Gem.bin_path('railties', 'rails', version)

That must mean that the gem files aren't there or are old or corrupted
How can I check that?

© Stack Overflow or respective owner

Related posts about ruby-on-rails

Related posts about installation