Problem with rails installation, even when running rails -v

Been happily using rails for some time, upgrading to latest stable
versions
along the way but over the last week something has changed, now rails
isn’t
happy. Any idea on what might have changed? Given I’m on ruby 1.9.3 I
can’t
see why when I call rails -v it is referring to ruby 1.8. Any guidance
would be appreciated. Could it be anything to do symbollic links?

My Ruby version:

MyRuby$ ruby -v
ruby 1.9.3p194 (2012-04-20 revision 35410) [i686-linux]

But…rails isn’t happy

MyRuby$ rails -v
/usr/local/lib/site_ruby/1.8/rubygems/dependency.rb:247:in to_specs': Could not find rails (>= 0) amongst [bundler-1.1.5, pg-0.14.0] (Gem::LoadError) from /usr/local/lib/site_ruby/1.8/rubygems/dependency.rb:256:into_spec’
from /usr/local/lib/site_ruby/1.8/rubygems.rb:1200:in `gem’
from /usr/bin/rails:18

MyRuby$ $PATH
bash:
/usr/local/rvm/gems/ruby-1.9.3-p194/bin:/usr/local/rvm/gems/ruby-1.9.3-p194@global/bin:/usr/local/rvm/rubies/ruby-1.9.3-p194/bin:/usr/local/rvm/bin:/home/steve/bin:/usr/lib/lightdm/lightdm:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/sm/pkg/active/bin:/sm/pkg/active/sbin:/home/steve/.rvm/bin:
No such file or directory

Hi Steve,

Looks to me like you are defaulting to the system versions.

As you are using rvm did you follow these steps?

rvm install 1.9.3-p194

rvm use 1.9.3-p194 --default

Let me know if this works for you.

Ben

ben sharman wrote in post #1070632:

Hi Steve,

Looks to me like you are defaulting to the system versions.

As you are using rvm did you follow these steps?

rvm install 1.9.3-p194

rvm use 1.9.3-p194 --default

Let me know if this works for you.

Ben

Hey Ben Sharman,

Thanks for replying. I tried everything and it didn’t work. I also found
that jumping across the forums, trying different solutions wasn’t
helping either. I realised after a while that I had a fundamental issue.
My system was broken to the point where it wouldn’t/couldn’t be set up
properly.

Why?

Because at some point I used Sudo to re-configure a vital Ruby/Rails
directory when it wouldn’t work first time. That was fatal. No matter
what I tried I wasn’t able to get back to a system that used RVM without
defaulting to 1.8.7.

What solved it?

After weeks of trying variations on the normal set ups such as you
suggest in your answer to get things working and also trying to check
and re-check the chown status of various directories. In the end I
backed up all my important data, made an Ubuntu 12.04 boot disc and
re-installed the OS entirely again. Not using Sudo where I shouldn’t
meant my Ruby and rails installations when smoothly. There are pitfall
though because when you get into trouble there it lots of information
out there that can lead the unwary to use Sudo here and there on their
Ruby or Rails installation but I found the hard way to steer completely
away from using Sudo unless specifically told to by the person(s) who
have developed the solution you want to work with. It’s been a tough
lesson, one I’m slightly embarrassed about in that I’ve had to re-build
my system again from scratch but hopefully anyone reading this who’s
having the same trouble that seems to go on for a long time will
ultimately know they have a tough decision ahead of them: Backup and
start again. May not always make sense in every case but for me it
worked. Steve.