Closed dvictory closed 10 years ago
This should correct the bug, please confirm https://github.com/apneadiving/Google-Maps-for-Rails/commit/3ff52deb455e1077c9f60660486fcd38f78e737f
Still getting an error. Here is the top part of my stack trace, looks like sinatra is still causing an issue:
sinatra (1.3.3) lib/sinatra/base.rb:1231:in `options'
sinatra (1.3.3) lib/sinatra/base.rb:1660:in `block (2 levels) in delegate'
/Volumes/OSX_Lion_Data/Users/victory/.rvm/gems/ruby-1.9.3-p327/bundler/gems/Google-Maps-for-Rails-3ff52deb455e/lib/gmaps4rails/js_builder.rb:124:in `set_configuration_variables'
crazy, I ended up dropping ruby code from the gem and I now only fully focus on map display. Leads to a far flexier api and neater code.
These two gems (gem 'delayed_job_active_record' and gem "delayed_job_web") when coupled with this gem cause it to fail. It seems these gems install sinatra and sinatra overrides the delegate method(base.rb) which is used in js_builder.rb. I didn't get much further but, replacing the delegate call with to accessor functions for options and data fixes the issue. Not sure why this is happening, but hopefully someone will save some time knowing how to resolve this issue.
I replaced: delegate :options, :data, :to => :@element_info
with:
def options @element_info.options
end
def data @element_info.data end
to get it to work.