0

我安装了间隙并按照最后的步骤“导轨生成间隙:安装”。但是,当我尝试在终端中打开时,rails 服务器不会为我启动。

/Users/lexi87/areyoutaken/config/initializers/clearance.rb:4:in `block in <top (required)>': uninitialized constant Clearance::PasswordStrategies::BCrypt (NameError)
    from /Users/lexi87/.rvm/gems/ruby-1.9.3-p374/gems/clearance-0.16.3/lib/clearance/configuration.rb:36:in `configure'
    from /Users/lexi87/areyoutaken/config/initializers/clearance.rb:1:in `<top (required)>'
    from /Users/lexi87/.rvm/gems/ruby-1.9.3-p374/gems/railties-3.2.12/lib/rails/engine.rb:588:in `block (2 levels) in <class:Engine>'

这是我的 Gemfile,里面有 bcrypt gem。

source 'https://rubygems.org'

gem 'rails', '3.2.12'
gem 'bootstrap-sass', '2.1'
gem 'bcrypt-ruby', '3.0.1'
gem 'faker', '1.0.1'
gem 'will_paginate', '3.0.3'
gem 'bootstrap-will_paginate', '0.0.6'
gem 'jquery-rails', '2.0.2'
gem 'annotate', '2.5.0'
gem 'clearance'

group :development, :test do
  gem 'sqlite3', '1.3.5'
  gem 'rspec-rails', '2.11.0'
  gem 'guard-rspec', '1.2.1'
  gem 'guard-spork', '1.4.2'  
  gem 'spork', '0.9.2'
  gem 'rb-fsevent', '~> 0.9.1'
end

# Gems used only for assets and not required
# in production environments by default.
group :assets do
  gem 'sass-rails',   '3.2.5'
  gem 'coffee-rails', '3.2.2'
  gem 'uglifier', '1.2.3'
end

group :test do
  gem 'capybara', '1.1.2'
  gem 'factory_girl_rails', '4.1.0'
  gem 'cucumber-rails', '1.2.1', :require => false
  gem 'database_cleaner', '0.7.0'
  # gem 'launchy', '2.1.0'
  # gem 'rb-fsevent', '0.9.1', :require => false
  gem 'growl', '1.0.3'
end

group :production do
  gem 'pg', '0.12.2'
end

任何帮助将不胜感激。

4

1 回答 1

1

您似乎正在运行0.16.3不支持Clearance::PasswordStrategies::BCrypt密码策略的 gem 版本的清除。如果您升级到v1.0.0.rc1或更高版本应该可以工作。

中唯一受支持的密码策略0.16.3Clearance::PasswordStrategies::BlowfishClearance::PasswordStrategies::SHA1

如果你想尝试支持的版本BCrypt,你可以更新你Gemfile的说:

gem 'clearance', :git => "git://github.com/thoughtbot/clearance.git", :tag => "v1.0.0.rc4"

这将提取该存储库的特定标签。您可以离开:tagGitHub 以获取最新版本。请记住,它可能不如0.16.3.

于 2013-02-13T17:12:19.920 回答