This project is archived and is in readonly mode.

#4255 ✓resolved

rails runner uninitialized constant Object

Reported by trevor | March 23rd, 2010 @ 12:33 AM | in 3.0.2

rails runner doesn't seem to be aware of objects in the rails environment anymore

% rails myapp
% cd myapp
% rails g scaffold post title:string body:text published:boolean
# edit a.rb
% cat a.rb
puts Rails.root
puts Post.count
% rails runner a.rb
a.rb:1:in `': uninitialized constant Object::Rails (NameError)
        from /usr/local/lib/ruby/gems/1.9.1/gems/railties-3.0.0.beta/lib/rails/commands/runner.rb:43:in `eval'
        from /usr/local/lib/ruby/gems/1.9.1/gems/railties-3.0.0.beta/lib/rails/commands/runner.rb:43:in `'
        from /usr/local/lib/ruby/gems/1.9.1/gems/railties-3.0.0.beta/lib/rails/commands.rb:60:in `require'
        from /usr/local/lib/ruby/gems/1.9.1/gems/railties-3.0.0.beta/lib/rails/commands.rb:60:in `'
        from /private/tmp/myapp/script/rails:10:in `require'
        from /private/tmp/myapp/script/rails:10:in `'

Comments and changes to this ticket

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=""></a>

People watching this ticket