I hope my title isn't confusing. I've got a CentOS 5 machine and I had Ruby 1.8.7 installed on here. So in order to upgrade my Ruby installation and gems/rails I
Uninstalled Ruby: sudo yum remove ruby
Downloaded the latest stable release of ruby and untared it: wget... && tar -zxf ....
Went through the usual installation:
- ./configure --prefix=$HOME
- make
- sudo make install
Downloaded rubygems: wget....
ran the setup file: ruby setup.rb
Now my issue is that if I try to install rails, which I do by typing: gem install rails, I get the following message: "-bash: /usr/local/bin/gem: /usr/local/bin/ruby: bad interpreter: Permission denied"
So the next logical move (for me) was to type: sudo gem install rails, but that returns "sudo: gem: command not found", which means I've screwed up something royally.
Just to add some more information
whereis ruby: ruby: /usr/lib/ruby /usr/lib64/ruby /usr/local/bin/ruby /usr/local/lib/ruby
which ruby: ~/bin/ruby
I'm thinking that by installing ruby manually from source I've screwed up something, perhaps the --prefix=$HOME is the culprit here?