开发者

Ruby on Rails: Getting NameError whenever delayed_job gem is used

开发者 https://www.devze.com 2023-04-10 16:37 出处:网络
Totally stumped on this one and hoping some RoR expert can help. Hitting this strange error where if I install the delayed_job gem, my site (development env) just stops working. All controllers and m

Totally stumped on this one and hoping some RoR expert can help.

Hitting this strange error where if I install the delayed_job gem, my site (development env) just stops working. All controllers and methods will show a NameError exception:

NameError in ProductsController#show
cannot remove Object::ClassMethods

I know it's the delayed_job gem because if I uninstall it or comment it out, restart the server, the errors go away.

My gemfile looks like the following:

source 'http://rubygems.org'

gem 'rails', '3.0.10'

# Bundle edge Rails instead:

gem 'delayed_job', "2.1.4"
gem 'sqlite3'
gem 'faker', '0.3.1'
gem 'webrat', '0.7.1'
gem 'will_paginate', '3.0.pre2'
gem "amazon_product", "3.0.0.pre.2" #http://code.papercavalier.com/amazon_product/ 
gem "curb"
gem "authlogic"
gem "omniauth", ">=0.2开发者_如何转开发.6"
gem "faraday"#, ">=0.7.4"
gem "fb_graph"
gem "twitter"#, "~> 1.7.1"

I am using Ruby 1.8.7 and Rails 3.0.10.

If you have any idea what might be the problem, please help :)


I figured out what the culprit was. In my controllers, I was including "#include ActionView::Helpers::TextHelper" at the top so I can use the truncate function. Including that apparently cause some naming conflicts withint delayed_job. Removing the include solved my problem.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号