joshuamiller / cartographer

Google Maps on Rails
72 stars 39 forks source link

cartographer on heroku #8

Open buddhamagnet opened 13 years ago

buddhamagnet commented 13 years ago

Hi there - I have seen mention of some issues regarding heroku on stackoverflow but no obvious fix. I am running the gem locally and all is well - but as soon as I deploy to heroku it bails - checking the logs, the error is as follows:

NameError (uninitialized constant PagesController::Cartographer): 2011-02-20T13:56:26-08:00 app[web.1]: app/controllers/pages_controller.rb:39:in initialize_map' 2011-02-20T13:56:26-08:00 app[web.1]: app/controllers/pages_controller.rb:3:inindex'

...is there a fix for this in the pipeline? Great gem!

nicinabox commented 13 years ago

Cartographer works just fine on Heroku. Would you mind posting your index method with the cartographer bits?

joshuamiller commented 13 years ago

The problem here I think is people following the install instructions which previously recommended a git method for vendoring the plugin that Heroku doesn't play too well with. Can you try to rm -rf vendor/plugins/cartographer and reinstall via rails plugin install ... and see how that works for you?

dpsk commented 13 years ago

I have exactly the same issue

NameError (uninitialized constant PagesController::Cartographer): app/controllers/pages_controller.rb:11:in `home'

here is my home action

https://gist.github.com/940446

As you see its default code from readme. On local machine all works fine. Also im using API v3.

Chrome js console output this, but im doubt this is a reason of production error, besause this warnings appears even when im using pure js google api Resource interpreted as Script but transferred with MIME type text/plain. markermanager_packed.js:-1 Resource interpreted as Image but transferred with MIME type text/html. csi:-1

mnoble01 commented 13 years ago

I have the same issue. Works fine on local machine, but I get heroku 500 error when deployed. Heroku logs gives me: NameError (uninitialized constant MapperController::Cartographer) Using rails 3.0.4, API v3.

Oh, and I also tried reinstalling using 'rails plugin install' instead of git clone. Error persisted.

mnoble01 commented 13 years ago

Somehow, this worked:

I just deleted my .git file, and my remote repo, my heroku app, and did the entire git / heroku / local repo linking process over again. And the map displays! No more heroku 500 error.

Hope this helps someone else. I'm really not sure why it worked, but I'm glad my app is working.