testing my app locally I have no problem, but now I try to test it with my ISP (Bluehost) and I have a problem with a path definition of a file I need to read initially in my application.rb def geo_from_IP geo_ip = GeoIP.new("#{RAILS_ROOT}/data/GeoIPCityfr.dat") .... raises an error : no such file to load -- geoip the file exists actually and is located at : my_home/ rails> myapp > data > GeoIPCityfr.dat how and where RAILS_ROOT should it be defined ? Note : as usal in ISP configuration, I have a link to myapp: my_home / public_html > myapp ( link_to user_home/ rails> myapp ) -- 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 -~----------~----~----~----~------~----~------~--~---
Kad Kerforn wrote:> testing my app locally I have no problem, but now I try to test it with > my ISP (Bluehost) > > and I have a problem with a path definition of a file I need to read > initially in my application.rb > > def geo_from_IP > geo_ip = GeoIP.new("#{RAILS_ROOT}/data/GeoIPCityfr.dat") > .... > > raises an error : no such file to load -- geoip > > the file exists actually and is located at : > > my_home/ rails> myapp > data > GeoIPCityfr.dat > > how and where RAILS_ROOT should it be defined ? > > Note : > as usal in ISP configuration, I have a link to myapp: > > my_home / public_html > myapp ( link_to user_home/ rails> myapp ) > > >Hey from no such file to load -- geoip I get the idea that GeoIP hasn''t been ''required''? Hope this helps... Gustav Paul gustav-PUm+PnBUKx7YkQIYctQFYw@public.gmane.org --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Gustav Paul wrote:> Kad Kerforn wrote: >> raises an error : no such file to load -- geoip >> my_home / public_html > myapp ( link_to user_home/ rails> myapp ) >> >> >> > Hey > > from > > no such file to load -- geoip > > I get the idea that GeoIP hasn''t been ''required''? > > Hope this helps... > Gustav Paul > gustav-PUm+PnBUKx7YkQIYctQFYw@public.gmane.orgthanks Gustav.. yes it has been required... the application.rb at my ISP is the same as the one I run locally (localhost) and it runs very well here.. the only difference is the remote ISP installation , with this f.. link I wrote to get it running : cd ~/public_html/ ln -s /home/myusername/rails/myapp/public myapp I tried to write at the beginning of my environment.rb RAILS_ROOT = ''/home/myusername/rails/pdm/'' but still I cannot read the GeoIP file -- 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 -~----------~----~----~----~------~----~------~--~---
Gustav Paul wrote:> Kad Kerforn wrote: >> raises an error : no such file to load -- geoip >> my_home / public_html > myapp ( link_to user_home/ rails> myapp ) >> >> >> > Hey > > from > > no such file to load -- geoip > > I get the idea that GeoIP hasn''t been ''required''? > > Hope this helps... > Gustav Paul > gustav-PUm+PnBUKx7YkQIYctQFYw@public.gmane.orgWell Well I was thinking again about your remark !!.. thanks.. GeoIP was installed locally using gem... and I belive that my ISP installation doesn''t have it ... is there any way to put it in my app ? (I am new to Rails...) kad -- 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 -~----------~----~----~----~------~----~------~--~---
Kad Kerforn wrote:> Gustav Paul wrote: > >> Kad Kerforn wrote: >> >>> raises an error : no such file to load -- geoip >>> my_home / public_html > myapp ( link_to user_home/ rails> myapp ) >>> >>> >>> >>> >> Hey >> >> from >> >> no such file to load -- geoip >> >> I get the idea that GeoIP hasn''t been ''required''? >> >> Hope this helps... >> Gustav Paul >> gustav-PUm+PnBUKx7YkQIYctQFYw@public.gmane.org >> > > thanks Gustav.. > > yes it has been required... the application.rb at my ISP is the same > as the one I run locally (localhost) and it runs very well here.. the > only difference is the remote ISP installation , with this f.. link I > wrote to get it running : > > cd ~/public_html/ > ln -s /home/myusername/rails/myapp/public myapp > > I tried to write at the beginning of my environment.rb > RAILS_ROOT = ''/home/myusername/rails/pdm/'' > > but still I cannot read the GeoIP file > > > >The gem should have a dir in /usr/lib/ruby/gems/1.8/gems/ (atleast, that''s where I found mine, I''m a linux newbie though, so maybe you pro''s keep your stuff elsewhere :] ) there should be a /lib directory in there with either one .rb file (if you''re lucky) or more than one, or (as in the case of the JSON gem which I did this with earlier) one .rb which required a bunch of others in a lib/some_dir/ subdirectory... Either, you should be able to just copy all the contents of the lib, paste them in RAILS_ROOT/lib/ and require them in environment.rb (or some similar file like application.rb maybe?). (in the case of the json gem, I needed only require the outermost one, it required the ones in the subdirectory by itself) I hope this helps, Cheery-o Gustav Paul gustav-PUm+PnBUKx7YkQIYctQFYw@public.gmane.org --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
> The gem should have a dir in > /usr/lib/ruby/gems/1.8/gems/ > (atleast, that''s where I found mine, I''m a linux newbie though, so maybe > you pro''s keep your stuff elsewhere :] ) > > there should be a /lib directory in there with either one .rb file (if > you''re lucky) or more than one, or (as in the case of the JSON gem which > I did this with earlier) one .rb which required a bunch of others in a > lib/some_dir/ subdirectory... > > Either, you should be able to just copy all the contents of the lib, > paste them in RAILS_ROOT/lib/ and require them in environment.rb (or > some similar file like application.rb maybe?). (in the case of the json > gem, I needed only require the outermost one, it required the ones in > the subdirectory by itself) >Either *way*, sorry for the bad English! Gustav> I hope this helps, > > Cheery-o > Gustav Paul > gustav-PUm+PnBUKx7YkQIYctQFYw@public.gmane.org > > > > >--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---