Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
lib/tasks/resque.rake cannot load files from lib/ #1185
When loading the Rakefile, I get this error message:
added a commit
Mar 26, 2013
Upgrading to edge causes this error when I run
undefined method `root' for Padrino:Module lib/foo.rb lib/tasks/resque.rake:3:in `require' lib/tasks/resque.rake:3:in `' /home/hal/.gem/ruby/1.9.1/bundler/gems/padrino-framework-3bc9980420cb/padrino-core/lib/padrino-core/cli/rake_tasks.rb:4:in `load' /home/hal/.gem/ruby/1.9.1/bundler/gems/padrino-framework-3bc9980420cb/padrino-core/lib/padrino-core/cli/rake_tasks.rb:4:in `block in ' /home/hal/.gem/ruby/1.9.1/bundler/gems/padrino-framework-3bc9980420cb/padrino-core/lib/padrino-core/cli/rake_tasks.rb:2:in `each' /home/hal/.gem/ruby/1.9.1/bundler/gems/padrino-framework-3bc9980420cb/padrino-core/lib/padrino-core/cli/rake_tasks.rb:2:in `' /home/hal/.gem/ruby/1.9.1/bundler/gems/padrino-framework-3bc9980420cb/padrino-core/lib/padrino-core/cli/rake.rb:12:in `load' /home/hal/.gem/ruby/1.9.1/bundler/gems/padrino-framework-3bc9980420cb/padrino-core/lib/padrino-core/cli/rake.rb:12:in `init'
Without the Padrino environment loaded, I'm guessing Padrino.root simply doesn't exist. Shouldn't resque.rake include the Padrino environment? and or alternatively couldn't the tasks avoid Padrino.root (in cases where the environment isn't loaded)
On Monday, March 25, 2013 at 8:31 PM, Postmodern wrote:
Probably the easiest way to workaround this for now is to do the latter or this similar approach:
require File.expand_path('../../something/foo', __FILE__)
The constant PADRINO_ROOT unfortunately also is set at the same time that the environment is loaded. Also, using
Generally I prefer to use
Otherwise, if you like you can load the tiny env:
Change the first line in
Everything should works fine.
Remember that this will load only a subset of padrino, if you need full deps, like models controllers app mailers etc...