Error setting environment for script/runner
I am using the following command:
script/runner -e production ~/apps/application/current/vendor/gems/whenever-0.4.1/bin/whenever
but I get the error:
/usr/lib/ruby/1.8/optparse.rb:1445:in `complete': invalid option: -e (OptionParser::InvalidOption)
from /usr/lib/ruby/1.8/optparse.rb:1443:in `catch'
from /usr/lib/ruby/1.8/optparse.rb:1443:in `complete'
from /usr/lib/ruby/1.8/optparse.rb:1282:in `parse_in_order'
from /usr/lib/ruby/1.8/optparse.rb:1249:in `catch'
from /usr/lib/ruby/1.8/optparse.rb:1249:in `parse_in_order'
from /usr/lib/ruby/1.8/optparse.rb:1243:in `order!'
from /usr/lib/ruby/1.8/optparse.rb:1334:in 开发者_运维知识库`permute!'
from /usr/lib/ruby/1.8/optparse.rb:1355:in `parse!'
from /home/user/apps/application/current/vendor/gems/whenever-0.4.1/bin/whenever:11
from /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:31:in `eval'
from /home/user/apps/application/releases/20100109060255/vendor/rails/railties/lib/commands/runner.rb:46
from /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require'
from /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'
from script/runner:3
Try setting your Rails environment as an environment variable on the command line, like this:
RAILS_ENV=production script/runner /your_path/file_to_run.rb
精彩评论