This project is archived and is in readonly mode.
rails runner doesn't set-up rails environment
Reported by millr | March 21st, 2010 @ 12:33 AM
When running a script via rails runner
the script
is not placed in the rails environment.
Running the following from within a rails 3 app
directory:
rails runner 'Rails.root'
Produces the following error:
/usr/local/lib/ruby19/gems/1.9.1/gems/railties-3.0.0.beta/lib/rails/commands/runner.rb:45:in `eval': uninitialized constant Rails (NameError)
from /usr/local/lib/ruby19/gems/1.9.1/gems/railties-3.0.0.beta/lib/rails/commands/runner.rb:45:in `eval'
from /usr/local/lib/ruby19/gems/1.9.1/gems/railties-3.0.0.beta/lib/rails/commands/runner.rb:45:in `<top (required)>'
from /usr/local/lib/ruby19/gems/1.9.1/gems/railties-3.0.0.beta/lib/rails/commands.rb:60:in `require'
from /usr/local/lib/ruby19/gems/1.9.1/gems/railties-3.0.0.beta/lib/rails/commands.rb:60:in `<top (required)>'
from /private/var/www/appdir/script/rails:10:in `require'
from /private/var/www/appdir/script/rails:10:in `<main>'
Comments and changes to this ticket
-
millr March 21st, 2010 @ 06:25 PM
Sorry, this was fixed here: http://github.com/rails/rails/commit/39ebd6eb2b6c90756514798450eb15...
I should have looked a little deeper...
-
José Valim March 21st, 2010 @ 06:27 PM
- State changed from new to invalid
Create your profile
Help contribute to this project by taking a few moments to create your personal profile. Create your profile »
<h2 style="font-size: 14px">Tickets have moved to Github</h2>
The new ticket tracker is available at <a href="https://github.com/rails/rails/issues">https://github.com/rails/rails/issues</a>