This project is archived and is in readonly mode.

#4105 ✓duplicate
DavidBackeus

whiny_nil causes crash on Ruby 1.9.1 p378 using RVM

Reported by DavidBackeus | March 4th, 2010 @ 11:16 AM | in 3.0.2

Get this error when trying to script/rails anything:

.rvm/gems/ruby-1.9.1-p378%rails3/bundler/gems/rails-16a5e918a06649ffac24fd5873b875daf66212ad-master/activesupport/lib/active_support/whiny_nil.rb:29:in <class:NilClass>': uninitialized constant ActiveRecord::Base (NameError) from /Users/druiden/.rvm/gems/ruby-1.9.1-p378%rails3/bundler/gems/rails-16a5e918a06649ffac24fd5873b875daf66212ad-master/activesupport/lib/active_support/whiny_nil.rb:27:in'

Replicate by:

rails error_app --skip-activerecord
cd error_app
(edit Gemfile to bundle edge rails from git) bundle install
script/rails console

It appears to only happen on ruby 1.9.1. I'm using rvm for my ruby versioning.

Changing:
WHINERS << ::ActiveRecord::Base if defined? ::ActiveRecord

To:
WHINERS << ::ActiveRecord::Base if defined? ::ActiveRecord::Base

Fixes the problem.

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="https://github.com/rails/rails/issues">https://github.com/rails/rails/issues</a>

Pages