Reputation: 41
I've been struggling to get the most recent versions of Ruby and Rails running on my computer (using a mid-2007 Mac, running 10.7 OSX). I originally installed with the installer at installrails.com for the purpose of completing the Rails course at onemonthrails.com.
The installer didn't include the most recent versions of Ruby/Rails, so I upgraded each one and then checked the installed versions as you can see in the retyped input/output below (SO wouldn't let me post a screenshot):
userusers-MacBook:Downloads useruser$ ruby -v
ruby 1.9.3p392 (2013-02-33 revision 39386) [x86_darwin10.8.0]
userusers-MacBook:Downloads useruser$ rails -v
Rails 4.0.2
userusers-MacBook:Downloads useruser$ rvm --default use 2.0.0
Using /usr/local/rvm/gems/ruby-2.0.0-p353
userusers-MacBook:Downloads useruser$ ruby -v
ruby 2.0.0p353 (2013-11-22 revision 43784) [x86_64-darwin11.4.2]
userusers-MacBook:Downloads useruser$ rails -v
Rails is not currently installed on this system. To get the latest version, simply type:
$ sudo gem install rails
What happens when I try the $ sudo gem install rails
is 1 of 2 things:
1) the command appears to run, but when I go to $ rails -v
after its completion, I get the same message saying Rails is not installed, or
2) the command will run successfully, $ rails -v
will show I'm running Rails 4.0.0
but $ ruby -v
will show I'm running Ruby 1.9.3p352
. Asking it to default to Ruby 2.0.0
(via $ rvm --default 2.0.0
) causes Rails to disappear again (based on the fact $ rails -v
will say "Rails is not currently installed on this system").
Does anyone have an idea as to what could be the issue/how to resolve this?
If I need to provide more info or reformulate the question, let me know. This is my first post on SO and I'm new to programming as well.
Upvotes: 2
Views: 120
Reputation: 76
When installing gems you should never use sudo because this causes many problems. What I would do it try to get a clean install by first uninstalling rails and rvm. Install homebrew which helps install gems and their dependencies by running ruby -e "$(curl -fsSL https://raw.github.com/Homebrew/homebrew/go/install)"
in terminal. Then install rvm with ruby and rails at the same time by entering \curl -L https://get.rvm.io | bash -s stable --ruby --rails
. This should make it easy to install whatever versions you want.
Upvotes: 1