{"action":"created","issue":{"url":"https://api.github.com/repos/resque/resque/issues/1265","repository_url":"https://api.github.com/repos/resque/resque","labels_url":"https://api.github.com/repos/resque/resque/issues/1265/labels{/name}","comments_url":"https://api.github.com/repos/resque/resque/issues/1265/comments","events_url":"https://api.github.com/repos/resque/resque/issues/1265/events","html_url":"https://github.com/resque/resque/issues/1265","id":48278993,"number":1265,"title":"undefine method require_dependency Rails 4.1.4. Resque 1.25.2","user":{"login":"avastor","id":281345,"avatar_url":"https://avatars.githubusercontent.com/u/281345?v=3","gravatar_id":"","url":"https://api.github.com/users/avastor","html_url":"https://github.com/avastor","followers_url":"https://api.github.com/users/avastor/followers","following_url":"https://api.github.com/users/avastor/following{/other_user}","gists_url":"https://api.github.com/users/avastor/gists{/gist_id}","starred_url":"https://api.github.com/users/avastor/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/avastor/subscriptions","organizations_url":"https://api.github.com/users/avastor/orgs","repos_url":"https://api.github.com/users/avastor/repos","events_url":"https://api.github.com/users/avastor/events{/privacy}","received_events_url":"https://api.github.com/users/avastor/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2014-11-10T15:53:37Z","updated_at":"2016-02-25T16:44:30Z","closed_at":"2014-11-11T00:02:40Z","body":"Would you mind give answer please what's this https://github.com/resque/resque/blob/master/lib/resque/tasks.rb#L6  \r\n\r\nI had error when running a worker\r\n``` bash\r\nrake resque:work QUEUE='*'\r\nrake aborted!\r\nNoMethodError: undefined method 'require_dependency' for #<AppName::Application:0x00000005073cd0>\r\n/home/user/.rvm/gems/ruby-2.0.0-p594/gems/railties-4.1.4/lib/rails/engine.rb:468:in 'block (2 levels) in eager_load!'\r\n/home/user/.rvm/gems/ruby-2.0.0-p594/gems/railties-4.1.4/lib/rails/engine.rb:467:in 'each'\r\n/home/user/.rvm/gems/ruby-2.0.0-p594/gems/railties-4.1.4/lib/rails/engine.rb:467:in 'block in eager_load!'\r\n/home/user/.rvm/gems/ruby-2.0.0-p594/gems/railties-4.1.4/lib/rails/engine.rb:465:in 'each'\r\n/home/user/.rvm/gems/ruby-2.0.0-p594/gems/railties-4.1.4/lib/rails/engine.rb:465:in 'eager_load!'\r\n/home/user/.rvm/gems/ruby-2.0.0-p594/bundler/gems/resque-41469a3eaa93/lib/resque/tasks.rb:62:in 'block (2 levels) in <top (required)>'\r\n```\r\nBut when I added that\r\n``` bash\r\ntask 'resque:setup' => :environment\r\n```\r\nin main Rakefile, this mistake was gone.\r\nThanks you."},"comment":{"url":"https://api.github.com/repos/resque/resque/issues/comments/188871573","html_url":"https://github.com/resque/resque/issues/1265#issuecomment-188871573","issue_url":"https://api.github.com/repos/resque/resque/issues/1265","id":188871573,"user":{"login":"pnock","id":417896,"avatar_url":"https://avatars.githubusercontent.com/u/417896?v=3","gravatar_id":"","url":"https://api.github.com/users/pnock","html_url":"https://github.com/pnock","followers_url":"https://api.github.com/users/pnock/followers","following_url":"https://api.github.com/users/pnock/following{/other_user}","gists_url":"https://api.github.com/users/pnock/gists{/gist_id}","starred_url":"https://api.github.com/users/pnock/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pnock/subscriptions","organizations_url":"https://api.github.com/users/pnock/orgs","repos_url":"https://api.github.com/users/pnock/repos","events_url":"https://api.github.com/users/pnock/events{/privacy}","received_events_url":"https://api.github.com/users/pnock/received_events","type":"User","site_admin":false},"created_at":"2016-02-25T16:44:30Z","updated_at":"2016-02-25T16:44:30Z","body":"(For future googlers)\r\n\r\nI figured out my problem. Root cause was somewhat random: $rails_rake_task doesn't seem to work as it did in rails 3. Because of that, some conditional stuff in the environment was kicking in that shouldn't have."}}