ruby-on-rails - rake db 创建中止
问题描述
我一直在尝试使用 Ruby 2.3.8 修复我的项目,我正在使用 rvm 安装 Ruby 2.3.8 但需要额外的工作才能在我的 Mac 上安装它,因为2.3.8
需要无法使用openssl 1.1
. 所以我需要找到如何安装openssl 1.0
,因为 Homebrew 删除了,openssl 1.0
所以它需要额外的研究来解决这个问题。
在我的项目中,我使用的是 MySQL 5.7,要安装 MySQL 5.7,我需要再次安装 OpenSSL 1.1,因此它会自动安装 OpenSSL 1.1
当我去我的项目并这样做时,rake db:create
我得到了这样的错误:
rake aborted!
LoadError: library not found for class Digest::SHA1 -- digest/sha1
/Users/hoomacbuk/Documents/mekari/quickbook/config/boot.rb:4:in `<top (required)>'
/Users/hoomacbuk/Documents/mekari/quickbook/config/application.rb:1:in `<top (required)>'
/Users/hoomacbuk/Documents/mekari/quickbook/Rakefile:4:in `<top (required)>'
/Users/hoomacbuk/.rvm/gems/ruby-2.3.8/gems/rake-13.0.1/exe/rake:27:in `<top (required)>'
Caused by:
LoadError: dlopen(/Users/hoomacbuk/.rvm/rubies/ruby-2.3.8/lib/ruby/2.3.0/x86_64-darwin18/digest/sha1.bundle, 9): Library not loaded: /usr/local/opt/openssl/lib/libcrypto.1.0.0.dylib
Referenced from: /Users/hoomacbuk/.rvm/rubies/ruby-2.3.8/lib/ruby/2.3.0/x86_64-darwin18/digest/sha1.bundle
Reason: image not found - /Users/hoomacbuk/.rvm/rubies/ruby-2.3.8/lib/ruby/2.3.0/x86_64-darwin18/digest/sha1.bundle
/Users/hoomacbuk/Documents/mekari/quickbook/config/boot.rb:4:in `<top (required)>'
/Users/hoomacbuk/Documents/mekari/quickbook/config/application.rb:1:in `<top (required)>'
/Users/hoomacbuk/Documents/mekari/quickbook/Rakefile:4:in `<top (required)>'
/Users/hoomacbuk/.rvm/gems/ruby-2.3.8/gems/rake-13.0.1/exe/rake:27:in `<top (required)>'
当我运行时,我bin/rake db:create
再次收到此错误:
/Users/hoomacbuk/.rvm/rubies/ruby-2.3.8/lib/ruby/2.3.0/digest.rb:16:in `const_missing': library not found for class Digest::SHA1 -- digest/sha1 (LoadError)
如何让 Ruby 2.3.x 运行?一世
解决方案
您的 ruby 版本似乎有问题。
卸载当前版本并重新安装相同的版本,然后重试。
rvm uninstall 2.3.8
进而
rvm install 2.3.8
推荐阅读
- reactjs - React - 防止 HOC 基于 props 重新计算
- python-3.x - 如何使用 fontTools 检测 Type 1 和 OpenType CFF 字体
- .net - 如何使用动态文件路径响应 Wiremock.Net?
- javascript - 如何从 FB 页面获得响应,如 Angular 5
- android - 处理和显示工具栏上的后退图标,片段 onbackpressed
- apache-royale - Jewel textinput 在运行时禁用或只读
- excel - 为什么我的 Do While 循环在运行时不能正确复制所有内容?
- angular - 引导工具提示不适用于 *ngIf
- go - 将切片调整为新顺序
- sql - 如何在不使用连接的情况下在 array_agg 中使用子查询