Problems loading gems

I have some code in a controller that requires the GeoX gem. Let's say I have the following code:

... require 'rubygems' require 'geox' geocoder = GeoX::Geocoder.new(:geoengine => GeoX::Google) ...

If I run this in the rails console for the site it works perfectly, but the same code in my controller or a rake task fails with the following message:

no such file to load -- geox

What am I doing wrong over here? I'm at a complete loss. Thanks in advance for your help.

- m a x

I have some code in a controller that requires the GeoX gem. Let's
say I have the following code:

... require 'rubygems' require 'geox' geocoder = GeoX::Geocoder.new(:geoengine => GeoX::Google) ...

If I run this in the rails console for the site it works perfectly,
but the same code in my controller or a rake task fails with the following message:

no such file to load -- geox

What am I doing wrong over here? I'm at a complete loss. Thanks in advance for your help.

To load the gem you should use gem 'geox' (and then possibly use require to load files from inside the gem) rails does fiddle with requite and so on which may explain some of the
differences

Fred

yeah now it says this:

Could not find RubyGem geox (>= 0.0.0)

Geox is installed as a plugin, not a gem, but I had previously tried using the google-geocode gem and it failed the same way.

Frederick Cheung wrote: