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)
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
'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