[英]LoadError: cannot load such file — bcrypt_ext
我試圖在我的rails應用程序上部署devise身份驗證。
我收到了這個問題
“無法加載此類文件 - bcrypt_ext”
我認為這是基於Windows的計算機中的常見問題,但其他問題的答案對我沒有幫助。
我使用x86 ruby和devkit運行Windows 8 x64
嘗試
C:\> gem install --no-ri --no-rdoc bcrypt
C:\> cd (path to gems root)\bcrypt-3.1.7-x86-mingw32\ext\mri
C:\(path to gems root)\bcrypt-3.1.7-x86-mingw32\ext\mri> ruby extconf.rb
C:\(path to gems root)\bcrypt-3.1.7-x86-mingw32\ext\mri> make
C:\(path to gems root)\bcrypt-3.1.7-x86-mingw32\ext\mri> make install
參考: https : //www.alib.jp/entries/bcrypt_ext_load_error_on_ruby21x
缺少bcrypt_ext.so文件 - 如果您手動將其復制到正確的文件夾 - 在我的情況下\\ Ruby23 \\ lib \\ ruby \\ gems \\ 2.3.0 \\ gems \\ bcrypt-3.1.11-x86-mingw32 \\ lib - 它有幫助。 :)
這對我有用 : https : //github.com/codahale/bcrypt-ruby/issues/142
- 卸載所有bcrypt版本:gem uninstall bcrypt
選擇選項3(全部卸載)
- 卸載所有bcrypt-ruby版本:gem uninstall bcrypt-ruby
選擇選項3(全部卸載)
用以下內容替換gemfile中的行:
將此行添加到gemfile:gem'bcrypt',platforms :: ruby
雖然不能為我工作但是將gemfile指向git存儲庫:
gem'bcrypt',git:' https : //github.com/codahale/bcrypt-ruby.git ',:require =>'bcrypt'
捆綁安裝
你應該好好去
在此鏈接https://github.com/codahale/bcrypt-ruby/issues/142
有人提到了這個解決方案
gem 'bcrypt', git: 'https://github.com/codahale/bcrypt-ruby.git', :require => 'bcrypt'
它對我有用
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.