I have installed http://www.rubygeocoder.com/ in a project rails in a production server but this gem in my production server not works fine for me...
I'm using mongoid.
I write these methods in views in my development environment and works fine:
<%= request.ip %>
<%= request.location.city %>
<%= request.location.country %>
and I get: 127.0.0.1 Reserved
this result its usually because I am working in localhost.
However after make a deploy with capistrano in the production server in linode I get error with these methods, I can see in my production log the next error:
Completed 500 Internal Server Error in 909ms
ActionView::Template::Error (undefined method `location' for #<ActionDispatch::Request:0x00000005aa8570>):
Why I get this error in my production server for these methods?
Thank you!
The problem was fixed. thank you to alexreisner on https://github.com/alexreisner/geocoder/issues/239.
After you install this gem, you must restart your production server. if you want that geocoder does work fine.
After restart my linode server this gem does work fine for me :D.
Thank you very much!