ruby-on-rails - rake db:setup 未加载库:@rpath/libgssapi_krb5.2.2.dylib 错误
问题描述
我在 macOS 10.14.2 mojave 上运行 rake db:setup 在我的 mysql 数据库上时出现错误。它在其他项目中运行良好,当我gem list
在其他项目中运行时,它们都有 mysql 0.5.2 和遏制 0.9.7。我曾经有相同的以下错误,除了它说 libssh2.1 而不是 libgssapi_krb5,所以我做了brew install libssh2
,然后错误变成了这个。然后我尝试这样做brew install krb5
,但这并没有什么不同。这是错误:
mbp-user:project user$ rake db:setup rake 中止!LoadError:dlopen(/Users/user/.rvm/gems/ruby-2.5.3/gems/curb-0.9.7/lib/curb_core.bundle,9):未加载库:@rpath/libgssapi_krb5.2.2.dylib 引用来自:/Users/user/.rvm/gems/ruby-2.5.3/gems/curb-0.9.7/lib/curb_core.bundle 原因:找不到图像 - /Users/user/.rvm/gems/ruby-2.5 .3/gems/curb-0.9.7/lib/curb_core.bundle /Users/user/.rvm/gems/ruby-2.5.3/gems/activesupport-5.1.6/lib/active_support/dependencies.rb:292:在
require' /Users/user/.rvm/gems/ruby-2.5.3/gems/activesupport-5.1.6/lib/active_support/dependencies.rb:292:in
块中要求'/Users/user/.rvm/gems/ruby-2.5.3/gems/activesupport-5.1.6/lib/active_support/dependencies.rb:258:inload_dependency' /Users/user/.rvm/gems/ruby-2.5.3/gems/activesupport-5.1.6/lib/active_support/dependencies.rb:292:in
要求'/Users/user/.rvm/ gems/ruby-2.5.3/gems/curb-0.9.7/lib/curl.rb:1:in<top (required)>' /Users/user/.rvm/gems/ruby-2.5.3/gems/activesupport-5.1.6/lib/active_support/dependencies.rb:292:in
需要'/Users/user/.rvm/gems/ruby-2.5.3/gems/activesupport-5.1.6 /lib/active_support/dependencies.rb:292:inblock in require' /Users/user/.rvm/gems/ruby-2.5.3/gems/activesupport-5.1.6/lib/active_support/dependencies.rb:258:in
load_dependency'/Users/user/.rvm/gems/ruby-2.5.3/gems/activesupport-5.1.6/lib/active_support/dependencies.rb:292:in '/Users/user/.rvm/gems/require' /Users/user/.rvm/gems/ruby-2.5.3/gems/curb-0.9.7/lib/curb.rb:1:in
ruby- 2.5.3/gems/activesupport-5.1.6/lib/active_support/dependencies.rb:292:inrequire' /Users/user/.rvm/gems/ruby-2.5.3/gems/activesupport-5.1.6/lib/active_support/dependencies.rb:292:in
块中的要求' /Users/user/.rvm/gems/ruby-2.5.3/gems/activesupport-5.1.6 /lib/active_support/dependencies.rb:258:inload_dependency' /Users/user/.rvm/gems/ruby-2.5.3/gems/activesupport-5.1.6/lib/active_support/dependencies.rb:292:in
需要'/Users/user/.rvm/gems/ruby-2.5.3/gems/user_client-3.7.0/lib/user_client/helpers/http_client.rb:1:在<top (required)>' /Users/user/.rvm/gems/ruby-2.5.3/gems/user_client-3.7.0/lib/user_client/helpers/authorized_request.rb:1:in
require_relative'/Users/user /.rvm/gems/ruby-2.5.3/gems/user_client-3.7.0/lib/user_client/helpers/authorized_request.rb:1:in require_relative'/Users<top (required)>' /Users/user/.rvm/gems/ruby-2.5.3/gems/user_client-3.7.0/lib/user_client/adapter.rb:2:in
/user/.rvm/ gems/ruby-2.5.3/gems/user_client-3.7.0/lib/user_client/adapter.rb:2:in<top (required)>' /Users/user/.rvm/gems/ruby-2.5.3/gems/activesupport-5.1.6/lib/active_support/dependencies.rb:292:in
需要'/Users/user/.rvm/gems/ruby-2.5.3/gems/activesupport-5.1.6/lib/active_support/dependencies.rb:292:inblock in require' /Users/user/.rvm/gems/ruby-2.5.3/gems/activesupport-5.1.6/lib/active_support/dependencies.rb:258:in
load_dependency'/Users/user/.rvm/gems/ruby -2.5.3/gems/activesupport-5.1.6/lib/active_support/dependencies.rb:292:inrequire' /Users/user/.rvm/gems/ruby-2.5.3/gems/user_client-3.7.0/lib/user_client.rb:2:in
' /Users/user/work/angel/config/application.rb:7:in<top (required)>' /Users/user/work/angel/Rakefile:6:in
require_relative' /Users/user/ work/angel/Rakefile:6:in<top (required)>' /Users/user/.rvm/gems/ruby-2.5.3/gems/rake-12.3.1/exe/rake:27:in
' /Users/user/.rvm/gems/ruby-2.5.3/bin/ruby_executable_hooks:24:ineval' /Users/user/.rvm/gems/ruby-2.5.3/bin/ruby_executable_hooks:24:in
'
解决方案
出现以下错误时:
rake db:drop
或者
bundle exec rake db:drop
错误:
rake aborted!
LoadError: dlopen(/Users/afsan.abdulali.gujarati/.rvm/gems/ruby-2.4.6@introhive/gems/curb-0.9.10/lib/curb_core.bundle, 9): Library not loaded: @rpath/libgssapi_krb5.2.2.dylib
Referenced from: /Users/afsan.abdulali.gujarati/.rvm/gems/ruby-2.4.6@introhive/gems/curb-0.9.10/lib/curb_core.bundle
Reason: image not found - /Users/afsan.abdulali.gujarati/.rvm/gems/ruby-2.4.6@introhive/gems/curb-0.9.10/lib/curb_core.bundle
The thing that possibly fixed it:
解决方案:
brew install krb5
brew link --force krb5
可能会给出以下输出:
Warning: Refusing to link macOS-provided software: krb5
If you need to have krb5 first in your PATH run:
echo 'export PATH="/usr/local/opt/krb5/bin:$PATH"' >> ~/.bash_profile
echo 'export PATH="/usr/local/opt/krb5/sbin:$PATH"' >> ~/.bash_profile
For compilers to find krb5 you may need to set:
export LDFLAGS="-L/usr/local/opt/krb5/lib"
export CPPFLAGS="-I/usr/local/opt/krb5/include"
For pkg-config to find krb5 you may need to set:
export PKG_CONFIG_PATH="/usr/local/opt/krb5/lib/pkgconfig"
导出路径变量 LDFLAGS 和 CPPFLAGS
export LDFLAGS="-L/usr/local/opt/krb5/lib"
export CPPFLAGS="-I/usr/local/opt/krb5/include"
重新安装路边宝石
gem uninstall curb
gem install curb
我当前系统设置的旁注:
Mac OS Catalina 10.15.3
我的系统上安装了 anaconda3,尽管我使用以下命令禁用了它:
conda config --set auto_activate_base false
推荐阅读
- r - 如何通过 TensorFlow 强制 Keras 在 R 中使用 GPU
- angular - Angular如何知道请求是否超时超过三倍?
- ios - 在我自己的应用程序停止从 RPScreenRecorder 接收视频缓冲区后,iOS 屏幕录像机显示媒体服务失败错误
- oozie - error=2, oozie 在 hue4.2 中执行 shell 时没有这样的文件或目录
- scala - Scala 集合总和可用于重载加法
- react-apollo - 反应阿波罗突变和乐观更新
- google-cloud-platform - 如何在 Google Cloud Platform 上安装 32bit(x86/i386/i686) ubuntu 16.04?
- .net - 如果我删除 4.6.2 目标开发的“.NET 框架 4.7”
- html - FreeCodeCamp:CSS 样式元素中的错误:“你的 h2 元素应该是蓝色的”
- java - Java - 如何在 barteksc/AndroidPdfViewer 库中制作缩放按钮?