我的應用程序加載在本地,但任何交互拋出一個錯誤:的Rails無法加載這樣的文件 - bcrypt
Started GET "https://stackoverflow.com/users/sign_in" for 127.0.0.1 at 2016-11-22 15:42:14 +1100
ActiveRecord::SchemaMigration Load (1.0ms) SELECT "schema_migrations".* FROM
"schema_migrations"
Processing by Users::SessionsController#new as HTML
Rendering users/sessions/new.html.erb within layouts/application
Rendered users/sessions/new.html.erb within layouts/application (37.0ms)
Rendered layouts/_navbar.html.erb (1.0ms)
Completed 200 OK in 1007ms (Views: 978.5ms | ActiveRecord: 4.0ms)
Started POST "https://stackoverflow.com/users/sign_in" for 127.0.0.1 at 2016-11-22 15:42:29 +1100
Completed 401 Unauthorized in 8ms (ActiveRecord: 1.0ms)
Processing by Users::SessionsController#new as HTML
Parameters: {"utf8"=>"V",
Completed 500 Internal Server Error in 4ms (ActiveRecord: 0.0ms)
LoadError (cannot load such file -- bcrypt):
app/controllers/users/sessions_controller.rb:6:in `new'
Rendering C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/actionpack-5.0.0.1/lib/action
我運行Windows7的64位,Ruby23-64,Rails的5.0.0.1和唯一的bcrypt寶石我有安裝的是:bcrypt-3.1.11。
我在這裏嘗試瞭解決方案:cannot load such file -- 1.9/bcrypt_ext (LoadError)但是對於較新版本的ruby,bcrypt-ruby不再存在。
編輯:如果我運行gem install bcrypt,我會得到一個額外的bcrypt gem:C:\ Ruby23-x64 \ lib \ ruby \ gems \ 2.3.0 \ gems。我現在有2個bcrypts:
- C:\ Ruby23-64 \ LIB \紅寶石\寶石\ 2.3.0 \寶石\ bcrypt-3.1.11
- C:\ Ruby23-64 \ LIB \紅寶石\ gems \ 2.3.0 \ gems \ bcrypt-3.1.11-x64-mingw32
我該保留哪一個,以及我需要在Gemfile中更改哪些內容?
我缺少什麼?
是'bcrypt'寶石正確安裝? –
嘗試添加gem文件,如'gem'bcrypt-ruby','3.1.1.rc1',:require =>'bcrypt'' – Sravan
嘗試下一個版本的'bcrypt','3.1.2' – Sravan