On Wed, Oct 3, 2012 at 1:24 AM, Pat Ferrel <p
...@occamsmachete.com> wrote:
> On ubuntu I have
> %ruby -v
> ruby 1.9.3p0 (2011-10-30 revision 33570) [x86_64-linux]
> when I run "sudo gem install passenger" then "sudo
> passenger-install-apache2-module" it compiles and eventually gives these
> instructions:
> Please edit your Apache configuration file, and add these lines:
> LoadModule passenger_module
> /var/lib/gems/1.8/gems/passenger-3.0.17/ext/apache2/mod_passenger.so
> PassengerRoot /var/lib/gems/1.8/gems/passenger-3.0.17
> PassengerRuby /usr/bin/ruby1.8
> These are all wrong.
> %which ruby
> /usr/bin/ruby
> %ls -al /usr/bin/ruby
> lrwxrwxrwx 1 root root 18 Oct 1 14:59 /usr/bin/ruby -> /usr/bin/ruby1.9.1
> I have no idea where it got ruby 1.8 but more to the point, how do I fix
> this and get it to install in the right place?
You have two Ruby installations on your system, 1.8 and 1.9. When you
invoke 'ruby' as a normal user you invoke Ruby 1.9, but 'sudo' nukes
your environment variables so it's entirely possible that you when you
do 'sudo gem install', sudo selects the 'gem' command that's
associated with Ruby 1.8. RubyGems 'pins' any executable it installs
to the specific Ruby interpreter that it ran in, so when you invoke
passenger-install-apache2-module it is automatically invoked in Ruby
1.8.
To solve this problem, tell sudo to use the Ruby 1.9-specific gem
command, e.g. 'sudo /usr/bin/gem1.9 install passenger && sudo
/absolute-path-to/passenger-install-apache2-module'
Here, '/absolute-path-to' is the directory that your Ruby 1.9 RubyGems
installs executables to, whereever that is.
--
Phusion | Ruby & Rails deployment, scaling and tuning solutions
Web: http://www.phusion.nl/
E-mail: i...@phusion.nl
Chamber of commerce no: 08173483 (The Netherlands)