Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

gmap4rails - can't find file underscore / Gmaps is not defined

I am following the simple tutorial here: https://github.com/JonKernPA/gmaps

I keep getting the error:

couldn't find file 'underscore'
    (/app/assets/javascripts/application.js:16)

with the following line highlighted:

<%= javascript_include_tag "application", "data-turbolinks-track" => true %>  

I tried following the suggestions posted in Gmaps is not defined in rails 4 + gmaps4rails 2.0.3

and I get the same error with the error with the same line highlighted. When I try to remove the line

<%= javascript_include_tag "application", "data-turbolinks-track" => true %>  

from application.html.erb, I get the error "Gmaps not found"

Any help appreciated, thanks. Github link: https://github.com/chiefkikio/circus/

like image 211
chiefkikio Avatar asked Oct 30 '14 21:10

chiefkikio


2 Answers

Found a solution. Had to install gem 'underscore-rails' and then bundle it and restart the rails server.

like image 137
chiefkikio Avatar answered Oct 21 '22 23:10

chiefkikio


Not a tutorial project, but I use gem 'underscore-rails' (cf https://rubygems.org/gems/underscore-rails) to satisfy gmaps4rails' dependence.

like image 1
Bob Mazanec Avatar answered Oct 22 '22 01:10

Bob Mazanec