I followed the setup from http://cartographer.rubyforge.org/ but keep getting this error - NoMethodError in Sandbox#map Showing app/views/layouts/sandbox.rhtml where line #4 raised: You have a nil object when you didn''t expect it! You might have expected an instance of Array. The error occured while evaluating nil.[] Extracted source (around line #4): 1: <html> 2: <head> 3: <title>Admin: <%= controller.action_name %></title> 4: <%= gmaps_header %> 5: </head> ....Full Trace.... #{RAILS_ROOT}/vendor/plugins/cartographer/lib/cartographer.rb:27:in `gmaps_header'' #{RAILS_ROOT}/app/views/layouts/sandbox.rhtml:4:in `_run_rhtml_layouts_sandbox'' Any help would be great! thx -- Posted via http://www.ruby-forum.com/.
I had a similar problem. In my case, the issue was with keys.rb and my host name. Contrary to what the sample keys.rb led me to believe, the hostname command doesn''t return ''localhost'' on my local system, or my public domain name on hostingrails.com. Instead, it returns ''My-Computer.local'' and ''[someserver].webserversystems.com'', respectively. Using the correct host names fixed the issue. Alex. On 5/16/06, Rob Balfour <rob_uk88@hotmail.com> wrote:> > I followed the setup from http://cartographer.rubyforge.org/ > but keep getting this error - > > NoMethodError in Sandbox#map > > Showing app/views/layouts/sandbox.rhtml where line #4 raised: > > You have a nil object when you didn''t expect it! > You might have expected an instance of Array. > The error occured while evaluating nil.[] > > Extracted source (around line #4): > > 1: <html> > 2: <head> > 3: <title>Admin: <%= controller.action_name %></title> > 4: <%= gmaps_header %> > 5: </head> > > ....Full Trace.... > > #{RAILS_ROOT}/vendor/plugins/cartographer/lib/cartographer.rb:27:in > `gmaps_header'' > #{RAILS_ROOT}/app/views/layouts/sandbox.rhtml:4:in > `_run_rhtml_layouts_sandbox'' > > > Any help would be great! thx > > -- > Posted via http://www.ruby-forum.com/. > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails >-------------- next part -------------- An HTML attachment was scrubbed... URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20060516/10e3c452/attachment.html
Great but I''m still unclear on what to use instead of ''hostname.'' -- Posted via http://www.ruby-forum.com/.
You still use the hostname command, but you substitute the value that it returns in the when clauses below. For example: GOOGLE_MAPS_API_KEYS = case `hostname`.chomp # FIXME: this may not work on Windows? when ''My-Computer.local'' { ''directory/index'' => ''ABQIAAAAAvd-Y2CbTw44IqBjXHWLGBTJw'', ''directory/search'' => ''ABQIAAAAAvd-Y2CbTw44IqBjXHWLGBTJw'', ... } when ''servername.webserversystem.com'' { ''directory/index'' => ''laksjsdflkjsf'', ''directory/search'' => ''sdlfkjdslkfjd'', ... } Alex. On 5/16/06, Rob Balfour <rob_uk88@hotmail.com> wrote:> > Great but I''m still unclear on what to use instead of ''hostname.'' > > -- > Posted via http://www.ruby-forum.com/. > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails >-------------- next part -------------- An HTML attachment was scrubbed... URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20060516/d8389d32/attachment.html
Check out my JobMapper tutorial -- it explains how to setup and use cartographer. http://saush.com/blog/?page_id=48 Rob Balfour wrote:> I followed the setup from http://cartographer.rubyforge.org/ > but keep getting this error - > > NoMethodError in Sandbox#map > > Showing app/views/layouts/sandbox.rhtml where line #4 raised: > > You have a nil object when you didn''t expect it! > You might have expected an instance of Array. > The error occured while evaluating nil.[] > > Extracted source (around line #4): > > 1: <html> > 2: <head> > 3: <title>Admin: <%= controller.action_name %></title> > 4: <%= gmaps_header %> > 5: </head> > > ....Full Trace.... > > #{RAILS_ROOT}/vendor/plugins/cartographer/lib/cartographer.rb:27:in > `gmaps_header'' > #{RAILS_ROOT}/app/views/layouts/sandbox.rhtml:4:in > `_run_rhtml_layouts_sandbox'' > > > Any help would be great! thx > >-- Sau Sheong http://blog.saush.com http://www.projectible.com http://jaccal.sourceforge.net
Chang Sau Sheong wrote:> Check out my JobMapper tutorial -- it explains how to setup and use > cartographer. http://saush.com/blog/?page_id=48 > > > Rob Balfour wrote: >> >> #{RAILS_ROOT}/vendor/plugins/cartographer/lib/cartographer.rb:27:in >> `gmaps_header'' >> #{RAILS_ROOT}/app/views/layouts/sandbox.rhtml:4:in >> `_run_rhtml_layouts_sandbox'' >> >> >> Any help would be great! thx >> >> > > > -- > Sau Sheong > > http://blog.saush.com > http://www.projectible.com > http://jaccal.sourceforge.netGreat! Thank you both :) -- Posted via http://www.ruby-forum.com/.