Hello,
I have what I believe is a fairly straightforward rails app, but the
devise model generator crashes, and the app itself crashes on boot. I
ran rails generate devise:install and it worked. But when I run 'rails
generate devise User', I get 'devise.rb:3: uninitialized constant
Devise (NameError)'. I get the same result when I run 'rails server'.
Note that in a brand new rails 3 app it works correctly. The app in
question is a former rails 2 app that I semi-hand converted to rails
3, so it seems likely that I messed something up when I did that.
Trying to anticipate what questions I'm going to be asked here goes:
t-foil% rails generate devise:install
create config/initializers/devise.rb
create config/locales/devise.en.yml
[helpful getting started message omitted]
t-foil% rails generate devise User
/Users/dorfman/dev/rails/score/config/initializers/devise.rb:3:
uninitialized constant Devise (NameError)
from /Users/dorfman/dev/rails/score/mysql2/ruby/1.8/gems/
railties-3.0.3/lib/rails/engine.rb:201
from /Users/dorfman/dev/rails/score/mysql2/ruby/1.8/gems/
railties-3.0.3/lib/rails/engine.rb:200:in `each'
from /Users/dorfman/dev/rails/score/mysql2/ruby/1.8/gems/
railties-3.0.3/lib/rails/engine.rb:200
from /Users/dorfman/dev/rails/score/mysql2/ruby/1.8/gems/
railties-3.0.3/lib/rails/initializable.rb:25:in `instance_exec'
[etc]
For what it's worth, I notice something odd when I run 'bundle
install'. In addition to seeing devise and warden getting installed, I
also see
t-foil% bundle install
Fetching source index for
http://rubygems.org/
[...]
Installing warden (1.0.2)
Installing devise (1.1.5)
[...]
Your bundle is complete! Use `bundle show [gemname]` to see where a
bundled gem is installed.
Your bundle was installed to `mysql2`
%t-foil
Notice the comment about mysql2, even though I had already previously
installed mysql2. Also, mysql2 installed in rails root - I don't know
if that's normal or not, seems weird to me.
Here is my Gemfile:
source '
http://rubygems.org'
gem 'rails', '3.0.3'
gem 'mysql2'
gem 'haml'
gem 'map_by_method'
gem 'prototype_legacy_helper', '0.0.0', :git => 'git://
github.com/
rails/prototype_legacy_helper.git'
gem 'devise', '1.1.5'
gem 'ruby-debug'