0

In my server, when I run ruby -v I get:}

ruby 1.9.2p290 (2011-07-09 revision 32553) [i686-linux]

but when I run sudo ruby -v I get

ruby 1.8.7 (2010-01-10 patchlevel 249) [i486-linux]

I have tried setting the alternatives as suggested here, but I just got an error message. I have also tried the default option with rvm, but didn't work either

Since I'm trying to do this in the server, I don't have root permission (su) so there are some things I can't try.

What can I do to use ruby 1.9.2? I am getting the message

Could not find paperclip-3.0.3 in any of the sources (Bundler::GemNotFound)

Exception class:
PhusionPassenger::UnknownError
and I am sure it is caused by the ruby version.

Maybe I just need to set Passenger's ruby path as suggested here, but I can't seem to find the file vhost where I should set PassengerRuby

Community
  • 1
  • 1
marimaf
  • 5,382
  • 3
  • 50
  • 68

2 Answers2

1

After 8 hours of failed intents, this is what solved it:

All I had to do was configure Apache/Passenger again.

rvm use 1.9.2
gem install passenger --pre
passenger-install-apache2-module

followed the instructions to install apache. Then configured the file apache2.conf as told my the instructions before. Here I pasted the lines of code given in the instruction (and found out other lines that made reference to ruby1.8 so now the refer to ruby 1.9.2)

then restarted apache with

 sudo apache2ctl restart

thanks to this post but I didnt need to edit the vhost file (that I was unable to find) as suggested in the site, with reinstalling, adding the new lines and restarting apache solved the problem

marimaf
  • 5,382
  • 3
  • 50
  • 68
0

What you're saying implies that you have both Ruby 1.8.7 and 1.9.2 on the server. I'm betting that if you compare the PATH variable

echo $PATH

vs

sudo echo $PATH

You'll see the difference. You can use which to determine where the ruby installs are:

which ruby

and

sudo which ruby

and then you should be able to update your PATH, or explicitly call the correct Ruby version.

Given the information available, that's about all I can help with, but if you want to post that information, I might be able to help more. If you can sudo, but don't have root perms, who does, and can they edit the server? Are you running shared hosting?

Hope this helps.

MaddHacker
  • 1,118
  • 10
  • 17
  • echo $Path and sudo echo $PATH returned the same path: /home/administrator/.rvm/gems/ruby-1.9.2-p290/bin:/hom.... but which ruby returned /home/administrator/.rvm/rubies/ruby-1.9.2-p290/bin/ruby and sudo which ruby returned /usr/bin/ruby how should I update it? – marimaf May 07 '12 at 00:47
  • THanks, just solved the problem and posted the answer. I had to reconfigure apache/passenger – marimaf May 07 '12 at 02:45