下面的评论和帖子中的解决方案:
操作系统: 乌班图 12.0.4
问题:bcrypt-ruby,捆绑安装/更新
按照 Michael Hartl 的教程在 RoR 上工作。章节 6.3.1, 加密密码
我在我的 gem 文件中包含了这一行:
gem 'bcrypt-ruby', '~>3.1.2'
我可以从控制台安装 bcrypt。我的系统列出如下:
myapp1$ gem list bcrypt-ruby
*** LOCAL GEMS ***
bcrypt-ruby (3.1.2)
但是在运行捆绑安装时,找不到 bcrypt。
myapp1$ bundle install
Fetching gem metadata from https://rubygems.org/.........
Fetching gem metadata from https://rubygems.org/..
Resolving dependencies...
Could not find gem 'bcrpyt-ruby (~> 3.1.2) ruby' in the gems available on this machine.
我已经看到了之前关于 bcrypt 和捆绑包安装的问题,并尝试了他们的解决方案,但无济于事。
任何人都可以为我指出方向或提供解决方案吗?
非常感谢!
在这种情况下的解决方案
Removed Gemfile.lock, then comment out/delete the bcrypt-ruby line from Gemfile.
Then, run [bundle install] to regenerate the Gemlock file,
reinsert the bcrypt-ruby line in the Gemfile, and run [bundle install] again.
In this case, bcrypt is successfully added.
嘗試
刪除 Gemfile.lock,然後再次執行 bundle install
。