ejschmitt/delayed_job_web — Issue #3: Adding the delayed_job_web gem to my Gemfile makes my app crash
Author: cmer
Created: 2012-01-20 04:48:22+00:00
State: open

This took me a while to track down but basically, by adding this gem to my Gemfile, it requires Sinatra in Rails and defines a "post" method. I already had a "post" method defined and Sinatra overrode it. Is there any way to namespace Sinatra to avoid this?

Without the gem, my app works fine, with the gem required, here's what happens:

=> Booting Thin
=> Rails 3.2.0.rc2 application starting in development on http://0.0.0.0:3000
=> Call with -d to detach
=> Ctrl-C to shutdown server
>> Thin web server (v1.3.1 codename Triple Espresso)
>> Maximum connections set to 1024
>> Listening on 0.0.0.0:3000, CTRL+C to stop
[12, 21] in /Users/carl/Dropbox/code/carl/varagesale/app/helpers/application_helper.rb
12 out = {}
13 out['pageId'] = @page_id if defined?(@page_id)
14 out['groupId'] = group.slug if defined?(group)
15 out['categoryId'] = category.id if defined?(category)
16 debugger
=> 17 if defined?(post) && post
18 out['postId'] = post.id
19 out['groupId'] = post.group_id unless defined?(group)
20 out['categoryId'] = post.category_id unless defined?(category)
21 end
/Users/carl/Dropbox/code/carl/varagesale/app/helpers/application_helper.rb:17
if defined?(post) && post
(rdb:1) c

Started GET "/g/west-island/feed" for 127.0.0.1 at 2012-01-19 23:46:45 -0500
Processing by FeedController#index as HTML
Parameters: {"group_id"=>"west-island"}
User Load (49.4ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT 1 [["id", 1]]
CACHE (0.0ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT 1
Logged in? --> true
CACHE (0.0ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT 1
CACHE (0.0ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT 1
Group Load (0.1ms) SELECT "groups".* FROM "groups" WHERE "groups"."slug" = 'west-island' LIMIT 1
(0.1ms) SELECT COUNT(*) FROM "users" INNER JOIN "memberships" ON "users"."id" = "memberships"."user_id" WHERE "memberships"."group_id" = 1
(0.1ms) SELECT COUNT(*) FROM "posts" WHERE (post_type = 0)
Rendered shared/_group_header.html.haml (266.6ms)
(0.1ms) SELECT COUNT(*) FROM "notifications" WHERE "notifications"."user_id" = 1 AND "notifications"."viewed" = 'f'
Rendered shared/_group_menu.html.haml (12.6ms)
Rendered shared/_plupload.html.haml (67.2ms)
Rendered shared/_post_discussion_form.html.haml (2.7ms)
Rendered shared/_group_action_menu.html.haml (74.6ms)
Rendered shared/_modal_status_change.html.haml (3.6ms)
Rendered feed/_item_template.html.haml (3.4ms)
Rendered feed/_item_template_script.html.haml (4.7ms)
Rendered feed/_discussion_template.html.haml (2.6ms)
Rendered feed/_discussion_template_script.html.haml (3.9ms)
Rendered feed/_item_actions_template.html.haml (2.2ms)
Rendered feed/_item_actions_template_script.html.haml (3.6ms)
Rendered shared/_comments_template.html.haml (2.7ms)
Rendered shared/_comments_template_script.html.haml (4.1ms)
Rendered shared/_comment_template.html.haml (2.6ms)
Rendered shared/_comment_template_script.html.haml (3.9ms)
Rendered feed/index.html.haml within layouts/application (397.8ms)
Completed 500 Internal Server Error in 6007ms

ActionView::Template::Error (wrong number of arguments (0 for 1)):
18: = csrf_meta_tags
19:
20: :javascript
21: Application.meta = #{page_metadata.to_json};
22:
23: = yield :head
24:
app/helpers/application_helper.rb:17:in `page_metadata'
app/views/layouts/application.html.haml:21:in `_app_views_layouts_application_html_haml___626651308855706163_70286612170260'

Rendered /Users/carl/.rvm/gems/ruby-1.9.2-p290/bundler/gems/rails-2e6ca53da3f1/actionpack/lib/action_dispatch/middleware/templates/rescues/_trace.erb (4.9ms)
Rendered /Users/carl/.rvm/gems/ruby-1.9.2-p290/bundler/gems/rails-2e6ca53da3f1/actionpack/lib/action_dispatch/middleware/templates/rescues/_request_and_response.erb (1.0ms)
Rendered /Users/carl/.rvm/gems/ruby-1.9.2-p290/bundler/gems/rails-2e6ca53da3f1/actionpack/lib/action_dispatch/middleware/templates/rescues/template_error.erb within rescues/layout (8.7ms)