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 -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
On 1 Aug 2008, at 20:41, Max Stahl wrote:> > 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> > > - m a x > -- > Posted via http://www.ruby-forum.com/. > > >--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
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:> On 1 Aug 2008, at 20:41, Max Stahl wrote: > >> >> 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-- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---