Closed stestaub closed 10 years ago
Do you redefine delegate
here: lib/sinatra/base.rb:1231 ?
this should confirm the bug, please confirm: https://github.com/apneadiving/Google-Maps-for-Rails/commit/3ff52deb455e1077c9f60660486fcd38f78e737f
Hello apneadiving. I didn't redifine delegate as far as I know. Perhaps some of the libraries I use do. I will try your fix today. Thank you for that. Next week I will try to find out what library caused the problem.
Actually, your log speak from themselves: it's sinatra. It's included when you use things like DelayedJob for instance.
Did you try my fix?
On Jan 2, 2013, at 3:58 PM, Stefan Staub notifications@github.com wrote:
Hello apneadiving. I didn't redifine delegate as far as I know. Perhaps some of the libraries I use do. I will try your fix today. Thank you for that. Next week I will try to find out what library caused the problem.
— Reply to this email directly or view it on GitHub.
Yes I tried it, but I get the same error. But the strange thing for me is, that when I define some delegates by my own in the controller class they work...
Edit: I think I know why, maybe sinatra would not be called in my situation i tried...
I will set up a new clean project with only gmaps4rails and then add some of my other libraries like as you said delayed_job
Damn, you tried with the latest master on github?
Yes I used the version you provided: here the stacktrace:
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'
/home/stefan/.rbenv/versions/1.9.3-p125/lib/ruby/gems/1.9.1/bundler/gems/Google-Maps-for-Rails-3ff52deb455e/lib/gmaps4rails/js_builder.rb:124:in `set_configuration_variables'
But I don't use delegate
anymore...
thanks for digging into this :)
ok I now found out what gem is causing this issue. It's delayed_job_web... To reproduce simply create a project and add delayed_job and delayed_job_web to the gemfile.
For now I can remove delayed_job_web from my project.
Thank you for your help and for the hint to delayed_job :)
Thanks for reporting. I'll try to understand why it messes with Rails...
On Jan 2, 2013, at 4:47 PM, Stefan Staub notifications@github.com wrote:
ok I now found out what gem is causing this issue. It's delayed_job_web... To reproduce simply create a project and add delayed_job and delayed_job_web to the gemfile.
For now I can remove delayed_job_web from my project.
Thank you for your help and for the hint to delayed_job :)
— Reply to this email directly or view it on GitHub.
I also ran into this issue today using version (1.5.6) after upgrading from (1.5.2) which works great.
So until this is resolved the workaround is simply to use the older version.
In your Gemfile
gem 'gmaps4rails', '1.5.2'
I've got the same error after I have added sinatra
to my rails project (dependency of sidekiq
dashboard).
ArgumentError: wrong number of arguments (0 for 1)
from /home/cutalion/.rvm/gems/ruby-1.9.3-p385@groceryhelper/gems/sinatra-1.3.6/lib/sinatra/base.rb:1259:in `options'
ActionView::Template::Error (wrong number of arguments (0 for 1)):
2: <%= javascript_include_tag *js_dependencies %>
3:
4: <script type="text/javascript">
5: <%=raw options.to_gmaps4rails %>
6: </script>
7: <% end %>
8:
Quick and dirty solution - add empty options to markers, polygons, circles, etc
= gmaps markers: { data: draw_stores(stores), options: {} },
circles: { data: [{ lng: area[:longitude], lat: area[:latitude], radius: area[:radius] }].to_json, options: {} }}
This can be solved by either implementing respond_to?
properly on your object (I assume you're using method_missing
) or by upgrading to Sinatra 1.4.
I wanted to use gmaps4rails in my application but i can't get it to work. It works as long as I simply use the view helper gmaps with only the map options. But as soon as I add poliylines or markers I get a "wrong number of arguments (0 for 1)" exception.
Here is the top part of the stacktrace:
I tried it with the samples from the wiki. Here is my code I used:
Here some additional Information about my environment:
Thanks for any suggestions