Missing the Rails 2.3.3 gem - yet its installed

447 views
Skip to first unread message

Shaun Pearl

unread,
Aug 23, 2009, 8:23:37 PM8/23/09
to Phusion Passenger Discussions
I have set up passenger and attempted to make a test application and
it fails to launch. The error given in the apache log is
'Missing the Rails 2.3.3 gem. Please 'gem install......'

however as per 'gem list' I have 2.3.3 installed. The error message
recommended commenting out the RAILS_GEM_VERSION in environment.rb
which I did but then it just says it cant find a rails gem and i
should install rails.

How might I go about fixing this problem? any help is appreciated.
thanks

Hongli Lai

unread,
Aug 24, 2009, 3:39:16 AM8/24/09
to phusion-...@googlegroups.com

Maybe you have GEM_HOME or GEM_PATH set in your command line
environment. Apache doesn't necessarily inherit the environment
variables you set for your command line environment so you need to
ensure that it happens:
http://blog.phusion.nl/2008/12/16/passing-environment-variables-to-ruby-from-phusion-passenger/

--
Phusion | The Computer Science Company

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

Hongli Lai

unread,
Nov 22, 2009, 2:51:54 PM11/22/09
to phusion-...@googlegroups.com
On Sun, Nov 22, 2009 at 8:48 PM, FlorianV <florian...@googlemail.com> wrote:
> I get the same error message as stated by Shaun, I tried setting the
> GEM_PATH in environment.rb but nothing seems to work.
> Anybody with a proper solution for this problem?
> Any help is deeply appreciated, i spent the last three days figuring
> out where the problem is...

Are you on Ruby 1.9? Setting GEM_PATH dynamically is not supported by
Ruby 1.9 as we've recently discovered. A bug report has already been
filed.

anatoly

unread,
Jan 10, 2010, 12:39:36 PM1/10/10
to Phusion Passenger Discussions
I ran into a similar problem.... here is how I solved it...

First check your current gems environment by running "gem environment"
in the terminal.

Look for GEM PATHS, for example, I had

/usr/local/lib/ruby/gems/1.8 /home/anatoly/.gem/ruby/1.8

I really install all the gems with sudo, so I cared only about the
first one.

Next, add this to your path.

I am on Ubuntu 9.10, so for mean that means: sudo gedit ~/.bashrc

At the bottom of the file I added: export PATH=/usr/local/lib/ruby/
gems/1.8:$PATH

in the config/environment.rb file for the rails app).. I added this on
top: ENV['GEM_PATH'] = "/usr/local/lib/ruby/gems/1.8:#{ENV
['GEM_PATH']}"

Save, log out, log back in. Cross your fingers.


On Nov 22 2009, 2:51 pm, Hongli Lai <hon...@phusion.nl> wrote:


> On Sun, Nov 22, 2009 at 8:48 PM, FlorianV <florian.val...@googlemail.com> wrote:
> > I get the same error message as stated by Shaun, I tried setting the
> > GEM_PATH in environment.rb but nothing seems to work.
> > Anybody with a proper solution for this problem?
> > Any help is deeply appreciated, i spent the last three days figuring
> > out where the problem is...
>
> Are you on Ruby 1.9? Setting GEM_PATH dynamically is not supported by
> Ruby 1.9 as we've recently discovered. A bug report has already been
> filed.
>
> --
> Phusion | The Computer Science Company
>
> Web:http://www.phusion.nl/

> E-mail: i...@phusion.nl

6twenty

unread,
Feb 27, 2010, 6:53:29 PM2/27/10
to Phusion Passenger Discussions
Hi, I'm getting this problem with Passenger 2.2.10, Ruby 1.9.1 and
Rails 2.3.5. I'm running two virtual hosts; one is a Rails 3 beta app
which works perfectly, and the other is the Rails 2.3.5 app, which
causes an error: Missing the Rails 2.3.5 gem. Please `gem install -
v=2.3.5 rails`....

'gem list' shows that I have both versions of Rails installed
properly, and 'which ruby' and 'which gem' are both pointing to the
correct locations (I'm using RVM to manage my gems).

Any help would be much appreciated!

~Mike

On Jan 10, 5:39 pm, anatoly <sholomyan...@gmail.com> wrote:
> I ran into a similar problem.... here is how I solved it...
>
> First check your current gems environment by running "gemenvironment"
> in the terminal.
>

> Look forGEMPATHS, for example, I had


>
> /usr/local/lib/ruby/gems/1.8 /home/anatoly/.gem/ruby/1.8
>
> I really install all the gems with sudo, so I cared only about the
> first one.
>
> Next, add this to your path.
>
> I am on Ubuntu 9.10, so for mean that means: sudo gedit ~/.bashrc
>
> At the bottom of the file I added: export PATH=/usr/local/lib/ruby/
> gems/1.8:$PATH
>

> in the config/environment.rb file for therailsapp).. I added this on

Reply all
Reply to author
Forward
0 new messages