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

Uncaught ReferenceError: Gmaps is not defined #508

Closed knd closed 8 years ago

knd commented 8 years ago

I'm using gmaps4rails 2.1.2, and Rails 4.2, and followed the exact tutorial at readme page. Everything works ok on my local dev machine. However, when I deploy to AWS, it can't to initialize Gmaps.

On local dev machine:

screen shot 2016-03-16 at 11 06 54 am

On production:

screen shot 2016-03-16 at 11 07 18 am

I open the compressed application.js on production, and see that gmaps4rails scripts are included there. What could be the problem Gmaps can't be initialized?

screen shot 2016-03-16 at 11 08 13 am
apneadiving commented 8 years ago

Weird...

What if you use the version in cdn? https://cdnjs.cloudflare.com/ajax/libs/gmaps4rails/2.1.2/gmaps4rails.min.js

On 16 Mar 2016, at 05:13, Khanh Dao notifications@github.com wrote:

I'm using gmaps4rails 2.1.2, and followed the exact tutorial at readme page. Everything works ok on my local dev machine. However, when I deploy to AWS, it can't to initialize Gmaps.

On local dev machine:

On production:

I open the compressed application.js on production, and see that gmaps4rails scripts are included there. What could be the problem Gmaps can't be initialized?

— You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub

apneadiving commented 8 years ago

@knd I'm curious to know what was the problem

knd commented 8 years ago

@apneadiving I moved from Rails 3 to Rails 4 so there was something different in asset pipeline settings. Thank you for your reply.

FutoRicky commented 8 years ago

@knd what did you have to change? Having the same issue, currently on Rails 4