0
我運行rake db:migrate
時出現Uninitialized constant Devise
錯誤。未初始化的常量設計
在Gemfile中:gem 'devise'
成功bundle install
。
我試着添加'require'devise''到config/application.rb但沒有成功。在配置/ application.rb中:
if defined?(Bundler)
Bundler.require(*Rails.groups(:assets => %w(development test)))
end
堆棧跟蹤:
uninitialized constant Devise
/Users/cs/.Trash/qa/config/initializers/devise.rb:3:in `<top (required)>'
/Users/cs/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.2.9/lib/rails/engine.rb:588:in `block (2 levels) in <class:Engine>'
/Users/cs/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.2.9/lib/rails/engine.rb:587:in `each'
/Users/cs/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.2.9/lib/rails/engine.rb:587:in `block in <class:Engine>'
/Users/cs/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.2.9/lib/rails/initializable.rb:30:in `instance_exec'
/Users/cs/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.2.9/lib/rails/initializable.rb:30:in `run'
/Users/cs/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.2.9/lib/rails/initializable.rb:55:in `block in run_initializers'
/Users/cs/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.2.9/lib/rails/initializable.rb:54:in `each'
/Users/cs/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.2.9/lib/rails/initializable.rb:54:in `run_initializers'
/Users/cs/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.2.9/lib/rails/application.rb:136:in `initialize!'
/Users/cs/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.2.9/lib/rails/railtie/configurable.rb:30:in `method_missing'
/Users/cs/.Trash/qa/config/environment.rb:5:in `<top (required)>'
/Users/cs/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.2.9/lib/rails/application.rb:103:in `require_environment!'
/Users/cs/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.2.9/lib/rails/application.rb:297:in `block (2 levels) in initialize_tasks'
Tasks: TOP => routes => environment
(See full trace by running task with --trace)
的Gemfile:
source 'https://rubygems.org'
gem 'rails', '3.2.9'
## JRUBY GEMS
gem 'activerecord-jdbc-adapter'
gem 'activerecord-jdbcpostgresql-adapter'
gem 'jdbc-postgres'
gem 'jruby-openssl'
## FRONT END/DESIGN GEMS
gem 'jquery-rails'
gem 'bootstrap-sass'
gem 'haml'
gem 'font-awesome-sass-rails'
## ADMINISTRATION
gem 'activeadmin'
gem 'rufus-scheduler'
## AUTHENTICATION
gem 'bcrypt-ruby'
gem 'devise'
## FILE UPLOADS
gem 'paperclip'
gem 'aws-sdk'
## PERFORMANCE
gem 'dalli'
gem "trinidad"
## TESTING
gem "seedbank"
# Gems used only for assets and not required
# in production environments by default.
group :assets do
gem 'sass-rails', '~> 3.2.3'
gem 'coffee-rails', '~> 3.2.1'
gem 'therubyrhino'
gem 'uglifier', '>= 1.0.3'
gem 'closure-compiler'
end
顯示你的'Gemfile' – deefour
@Deefour - 我剛剛添加了Gemfile。 – sscirrus
只是出於好奇:你是否意識到初始化程序似乎是垃圾? - '/ Users/cs/.Trash/...' – polarblau