apneadiving / Google-Maps-for-Rails

Enables easy Google map + overlays creation in Ruby apps
https://apneadiving.github.io/
MIT License
2.27k stars 382 forks source link

uninitialized constant HomeController::Gmaps4rails #434

Closed ngelx closed 10 years ago

ngelx commented 10 years ago

Hi, i'm geting this error in rails 3.2 and i could not find where the problem it is.

Gemfile

gem 'gmaps4rails'

HomeController

 ....
    @positions = Position.all
    @hash = Gmaps4rails.build_markers(@positions) do |position, marker|
      marker.lat position.latitude
      marker.lng position.longitude
    end
....

view

....
<script>
  handler = Gmaps.build('Google');
  handler.buildMap({ provider: {}, internal: {id: 'map'}}, function(){
    markers = handler.addMarkers(<%=raw @hash.to_json %>);
    handler.bounds.extendWith(markers);
    handler.fitMapToBounds();
  });
</script>
...

And i'm getting

uninitialized constant HomeController::Gmaps4rails

Any idea? thanks in advance Angel

ngelx commented 10 years ago

Forget it.

sharmaansh21 commented 10 years ago

what was the error i am also getting same on production server, where as on local it is working fine.

bfish645 commented 10 years ago

Did you figure out what the issue was? I am having the same problem.

ngelx commented 10 years ago

Yea, sorry. It was some kind of reload problem. I'm using nginx + unicorn and not sure why reload was not updating gems load. I hope that help you.

bfish645 commented 10 years ago

Thanks. I removed and reinstalled the gem and the error disappeared.