Re: [phusion-passenger] passenger for apache2+ubuntu installs in wrong version of ruby gems

268 views
Skip to first unread message

Tinco Andringa

unread,
Oct 2, 2012, 8:21:56 PM10/2/12
to phusion-...@googlegroups.com
Hey Pat,

I'm not very familiar with Ubuntu, but does '
/var/lib/gems/1.8/gems/passenger-3.0.17/' exist? if so could it be
that your gem command is installing gems for 1.8 instead of 1.9.
There's some weird stuff going on between gem and Ubuntu/Debian,
perhaps this is a result of it.

If you're sure you have passenger installed for 1.9 then just changing
those paths to the corresponding ones in your 1.9 directories will fix
your trouble :)

Kind regards,
Tinco

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 received this message because you are subscribed to the Google Groups
> "Phusion Passenger Discussions" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/phusion-passenger/-/UQEM9YITl54J.
> To post to this group, send email to phusion-...@googlegroups.com.
> To unsubscribe from this group, send email to
> phusion-passen...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/phusion-passenger?hl=en.


--
Phusion | Ruby & Rails deployment, scaling and tuning solutions

Web: http://www.phusion.nl/
E-mail: in...@phusion.nl
Chamber of commerce no: 08173483 (The Netherlands)

Hongli Lai

unread,
Oct 3, 2012, 5:11:54 AM10/3/12
to phusion-...@googlegroups.com
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.
Reply all
Reply to author
Forward
0 new messages