I've got a fresh install of Ruby 1.9.1-p129 and Rails 2.3.2 running on
my Ubuntu 9.04 amd64 server. Everything works fine until Passenger (as
an apache2 module) is thrown into the mix. Put simply: my Rails apps
can't find the "rails" gem when executed via Passenger! The exact
error message is as follows:
"Missing the Rails 2.3.2 gem. Please `gem install -v=2.3.2 rails`,
update your RAILS_GEM_VERSION setting in config/environment.rb for the
Rails version you do have installed, or comment out RAILS_GEM_VERSION
to use the latest version installed."
This error message comes from config/boot.rb in the rails app itself;
it's caused because the runtime is unable to find the "rails" gem.
However, here is the output from "gem list":
As you can see, Rails 2.3.2 (and all of its support libraries) are in
place! I even checked the filesystem to make sure the gems are really
there-- and yes, they are.
So what's the story here? Is Passenger 2.2.2 + Ruby 1.9.1-p129 + Rails
2.3.2 just not a good combination? Should I downgrade?
Are you sure that you only have Ruby 1.9 installed? Just because you
get 1.9 when you do it in the console doesn't mean that Nginx will get
the same version. Check your paths carefully and check the paths for
the user that is running Nginx. I suspect that Nginx is seeing a
different version of Ruby (which doesn't have Rails installed).
Good luck!
DrMark
On Jun 1, 7:47 pm, ZhayTee <zhay...@zhaymusic.com> wrote:
> I've got a fresh install of Ruby 1.9.1-p129 and Rails 2.3.2 running on
> my Ubuntu 9.04 amd64 server. Everything works fine until Passenger (as
> an apache2 module) is thrown into the mix. Put simply: my Rails apps
> can't find the "rails" gem when executed via Passenger! The exact
> error message is as follows:
> "Missing the Rails 2.3.2 gem. Please `gem install -v=2.3.2 rails`,
> update your RAILS_GEM_VERSION setting in config/environment.rb for the
> Rails version you do have installed, or comment out RAILS_GEM_VERSION
> to use the latest version installed."
> This error message comes from config/boot.rb in the rails app itself;
> it's caused because the runtime is unable to find the "rails" gem.
> However, here is the output from "gem list":
> As you can see, Rails 2.3.2 (and all of its support libraries) are in
> place! I even checked the filesystem to make sure the gems are really
> there-- and yes, they are.
> So what's the story here? Is Passenger 2.2.2 + Ruby 1.9.1-p129 + Rails
> 2.3.2 just not a good combination? Should I downgrade?
On Jun 2, 12:04 am, DrMark <drm...@gmail.com> wrote:
> Are you sure that you only have Ruby 1.9 installed?
Hi DrMark. Yes, I am sure. To be extra paranoid, I even ran an
extremely thorough search on the server's filesystem. The only Ruby on
the system is Ruby 1.9.1-p129, installed at "/opt/ruby-1.9.1-p129". As
far as checking paths is concerned, here's the relevant output:
$ script/console
Loading production environment (Rails 2.3.2)
If there's anything wrong with this setup, I'm unable to see it. And
yet, Passenger still refuses to acknowledge the presence of the
"rails" gem! Here are the configuration directives in my Apache config
files:
I have the exact same issue. I tried setting ENV['GEM_PATH'] at the
top of environment.rb and that had no effect. 'gem environment' shows
the appropriate environmental variables. Very confusing why passenger/
apache can't find the Rails gem.
> On Jun 2, 12:04 am, DrMark <drm...@gmail.com> wrote:
> > Are you sure that you only have Ruby 1.9 installed?
> Hi DrMark. Yes, I am sure. To be extra paranoid, I even ran an
> extremely thorough search on the server's filesystem. The only Ruby on
> the system is Ruby 1.9.1-p129, installed at "/opt/ruby-1.9.1-p129". As
> far as checking paths is concerned, here's the relevant output:
> $ script/console
> Loading production environment (Rails2.3.2)>>Gem.path
> If there's anything wrong with this setup, I'm unable to see it. And
> yet, Passenger still refuses to acknowledge the presence of the
> "rails"gem! Here are the configuration directives in my Apache config
> files:
On Thu, Jul 2, 2009 at 9:32 AM, JBB<jay.borenst...@gmail.com> wrote:
> I have the exact same issue. I tried setting ENV['GEM_PATH'] at the > top of environment.rb and that had no effect.
Try calling Gem.clear_paths right after you've set this.
> 'gem environment' shows > the appropriate environmental variables. Very confusing why passenger/ > apache can't find the Rails gem.
Apache is started by a system service script, which sets its own environment variables and does not use the environment variables of your shell. It's possible that your system service script for some reason sets GEM_PATH or GEM_HOME.
-- Phusion | The Computer Science Company
Web: http://www.phusion.nl/ E-mail: i...@phusion.nl Chamber of commerce no: 08173483 (The Netherlands)
> On Thu, Jul 2, 2009 at 9:32 AM, JBB<jay.borenst...@gmail.com> wrote:
> > I have the exact same issue. I tried setting ENV['GEM_PATH'] at the
> > top of environment.rb and that had no effect.
> Try calling Gem.clear_paths right after you've set this.
> > 'gem environment' shows
> > the appropriate environmental variables. Very confusing why passenger/
> > apache can't find the Rails gem.
> Apache is started by a system service script, which sets its own
> environment variables and does not use the environment variables of
> your shell. It's possible that your system service script for some
> reason sets GEM_PATH or GEM_HOME.
> --
> Phusion | The Computer Science Company
> Web:http://www.phusion.nl/ > E-mail: i...@phusion.nl
> Chamber of commerce no: 08173483 (The Netherlands)
> I've got a fresh install of Ruby 1.9.1-p129 and Rails 2.3.2 running on
> my Ubuntu 9.04 amd64 server. Everything works fine until Passenger (as
> an apache2 module) is thrown into the mix. Put simply: my Rails apps
> can't find the "rails" gem when executed via Passenger! The exact
> error message is as follows:
You could vendorize rails until a fix is found. [rake
rails:freeze:gems]
I was able to recreate this with ruby 1.8.7, so...it's not a ruby 1.9
problem. Hongli I could give you access to a machine to recreate it
[though a virtualbox running ubuntu would probably suffice].
running 'gem env' from within the script [i.e. adding it to boot.rb
line 67 or so] shows the "expected" "right" gem env.
Adding a Gem.clear_paths to the top of environment.rb seems to fix the
problem as well.
It reports the problem whether rails gem is install in ~/.gem or in
the global location.
> Are you sure that you only have Ruby 1.9 installed? Just because you
> get 1.9 when you do it in the console doesn't mean that Nginx will get
> the same version. Check your paths carefully and check the paths for
> the user that is running Nginx. I suspect that Nginx is seeing a
> different version of Ruby (which doesn't have Rails installed).
Good point--I wonder if the RUBY_PLATFORM or RUBY_DESCRIPTION couldn't
be added to modrails' debug outputs?
=r
> > Are you sure that you only have Ruby 1.9 installed? Just because you
> > get 1.9 when you do it in the console doesn't mean that Nginx will get
> > the same version. Check your paths carefully and check the paths for
> > the user that is running Nginx. I suspect that Nginx is seeing a
> > different version of Ruby (which doesn't have Rails installed).
> Good point--I wonder if the RUBY_PLATFORM or RUBY_DESCRIPTION couldn't
> be added to modrails' debug outputs?
> =r
> in environment.rb does solve the issue of the Rails gem not being
> located. Thanks for the help.
> On Jul 4, 5:06 am, rogerdpack <rogerpack2...@gmail.com> wrote:
> > > Are you sure that you only have Ruby 1.9 installed? Just because you
> > > get 1.9 when you do it in the console doesn't mean that Nginx will get
> > > the same version. Check your paths carefully and check the paths for
> > > the user that is running Nginx. I suspect that Nginx is seeing a
> > > different version of Ruby (which doesn't have Rails installed).
> > Good point--I wonder if the RUBY_PLATFORM or RUBY_DESCRIPTION couldn't
> > be added to modrails' debug outputs?
> > =r
> in environment.rb does solve the issue of the Rails gem not being
> located. Thanks for the help.
> On Jul 4, 5:06 am, rogerdpack <rogerpack2...@gmail.com> wrote:
> > > Are you sure that you only have Ruby 1.9 installed? Just because you
> > > get 1.9 when you do it in the console doesn't mean that Nginx will get
> > > the same version. Check your paths carefully and check the paths for
> > > the user that is running Nginx. I suspect that Nginx is seeing a
> > > different version of Ruby (which doesn't have Rails installed).
> > Good point--I wonder if the RUBY_PLATFORM or RUBY_DESCRIPTION couldn't
> > be added to modrails' debug outputs?
> > =r