Reputation: 3032
My CLI is rusty so be kind...
On OS X Lion I installed RVM and then sudo gem install rails
.
When I run plain old rails -v
I get:
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.
and if I run /usr/local/bin/rails
I get all sorts of chaos starting with:
WARNING: #NameError: uninitialized constant Gem::VERSION>
# -- encoding: utf-8 --
Gem::Specification.new do |s| s.name = "bundler" s.version = "1.0.21"
...but if run sudo /usr/local/bin/rails -v
I get:
Rails 2.2.2
...and sudo rails -v`:
/Users/dan/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/site_ruby/1.9.1/rubygems/dependency.rb:247:in 'to_specs': Could not find rails (>= 0) amongst [bigdecimal-1.1.0, io-console-0.3, json-1.5.4, minitest-2.5.1, rake-0.9.2.2, rdoc-3.9.4] (Gem::LoadError)
from /Users/dan/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/site_ruby/1.9.1/rubygems/dependency.rb:256:in 'to_spec'
from /Users/dan/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/site_ruby/1.9.1/rubygems.rb:1210:in 'gem'
from /Users/dan/.rvm/gems/ruby-1.9.3-p0/bin/rails:18:in '<main>'
I am pretty sure I have multiple versions all on top of each other. Any tips to clear this all out and start from scratch?
Upvotes: 0
Views: 1796
Reputation: 230336
I think you messed up your system.
If you're using user-level RVM (that's what is recommended), you don't need to sudo
when installing gems, because they are installed to a folder in your HOME.
So, here's what I would do in your case:
Clean up. Remove all rubies, gems and RVMs that you can find.
Make sure you cleaned things up.
Install RVM and follow instructions to the letter.
Make sure RVM is activated.
rvm install 1.9.3
(or another ruby of your choice)
rvm use --default 1.9.3
(set default ruby)
gem install rails
(no sudo
, remember?)
PROFIT!
Upvotes: 3