Ruby on rails rake db:安装程序未加载库:@rpath/libgssapi_krb5.2.2.dylib错误
我在macOS 10.14.2 mojave上,在mysql数据库上运行rake db:setup时出错。它在其他项目中运行良好,当我在其他项目中执行Ruby on rails rake db:安装程序未加载库:@rpath/libgssapi_krb5.2.2.dylib错误,ruby-on-rails,ruby,rubygems,Ruby On Rails,Ruby,Rubygems,我在macOS 10.14.2 mojave上,在mysql数据库上运行rake db:setup时出错。它在其他项目中运行良好,当我在其他项目中执行gem list时,它们都有mysql 0.5.2和curb 0.9.7。我以前也有同样的错误,只是上面写的是libssh2.1而不是libgssapi_krb5,所以我确实brew安装了libssh2,然后错误变成了这个。然后,我尝试执行brew安装krb5,但这并没有产生任何影响。以下是错误: mbp用户:项目用户$rake db:设置 雷克流
gem list
时,它们都有mysql 0.5.2和curb 0.9.7。我以前也有同样的错误,只是上面写的是libssh2.1而不是libgssapi_krb5,所以我确实brew安装了libssh2
,然后错误变成了这个。然后,我尝试执行brew安装krb5
,但这并没有产生任何影响。以下是错误:
mbp用户:项目用户$rake db:设置
雷克流产了!
LoadError:dlopen(/Users/user/.rvm/gems/ruby-2.5.3/gems/urb-0.9.7/lib/urb\u core.bundle,9):未加载库:@rpath/libgssapi\u krb5.2.2.dylib
引用自:/Users/user/.rvm/gems/ruby-2.5.3/gems/curb-0.9.7/lib/curb\u core.bundle
原因:找不到映像-/Users/user/.rvm/gems/ruby-2.5.3/gems/curb-0.9.7/lib/curb\u core.bundle
/Users/user/.rvm/gems/ruby-2.5.3/gems/activesupport-5.1.6/lib/active\u support/dependencies.rb:292:inrequire'
/Users/user/.rvm/gems/ruby-2.5.3/gems/activesupport-5.1.6/lib/active\u-support/dependencies.rb:292:in
block-in-require'
/Users/user/.rvm/gems/ruby-2.5.3/gems/activesupport-5.1.6/lib/active\u support/dependencies.rb:258:inload\u dependency'
/Users/user/.rvm/gems/ruby-2.5.3/gems/activesupport-5.1.6/lib/active\u support/dependencies.rb:292:in
require'
/Users/user/.rvm/gems/ruby-2.5.3/gems/curb-0.9.7/lib/curl.rb:1:in'
/Users/user/.rvm/gems/ruby-2.5.3/gems/activesupport-5.1.6/lib/active\u support/dependencies.rb:292:in
require'
/Users/user/.rvm/gems/ruby-2.5.3/gems/activesupport-5.1.6/lib/active\u support/dependencies.rb:292:inblock in require'
/Users/user/.rvm/gems/ruby-2.5.3/gems/activesupport-5.1.6/lib/active\u support/dependencies.rb:258:in
load\u dependency'
/Users/user/.rvm/gems/ruby-2.5.3/gems/activesupport-5.1.6/lib/active\u support/dependencies.rb:292:inrequire'
/Users/user/.rvm/gems/ruby-2.5.3/gems/curb-0.9.7/lib/curb.rb:1:in
'
/Users/user/.rvm/gems/ruby-2.5.3/gems/activesupport-5.1.6/lib/active\u support/dependencies.rb:292:inrequire'
/Users/user/.rvm/gems/ruby-2.5.3/gems/activesupport-5.1.6/lib/active\u-support/dependencies.rb:292:in
block-in-require'
/Users/user/.rvm/gems/ruby-2.5.3/gems/activesupport-5.1.6/lib/active\u support/dependencies.rb:258:inload\u dependency'
/Users/user/.rvm/gems/ruby-2.5.3/gems/activesupport-5.1.6/lib/active\u support/dependencies.rb:292:in
require'
/Users/user/.rvm/gems/ruby-2.5.3/gems/user\u client-3.7.0/lib/user\u client/helpers/http\u client.rb:1:in'
/Users/user/.rvm/gems/ruby-2.5.3/gems/user\u client-3.7.0/lib/user\u client/helpers/authorized\u request.rb:1:in
require\u relative'
/Users/user/.rvm/gems/ruby-2.5.3/gems/user\u client-3.7.0/lib/user\u client/helpers/authorized\u request.rb:1:in'
/Users/user/.rvm/gems/ruby-2.5.3/gems/user\u client-3.7.0/lib/user\u client/adapter.rb:2:in
require\u relative'
/Users/user/.rvm/gems/ruby-2.5.3/gems/user\u client-3.7.0/lib/user\u client/adapter.rb:2:in'
/Users/user/.rvm/gems/ruby-2.5.3/gems/activesupport-5.1.6/lib/active\u support/dependencies.rb:292:in
require'
/Users/user/.rvm/gems/ruby-2.5.3/gems/activesupport-5.1.6/lib/active\u support/dependencies.rb:292:inblock in require'
/Users/user/.rvm/gems/ruby-2.5.3/gems/activesupport-5.1.6/lib/active\u support/dependencies.rb:258:in
load\u dependency'
/Users/user/.rvm/gems/ruby-2.5.3/gems/activesupport-5.1.6/lib/active\u support/dependencies.rb:292:inrequire'
/Users/user/.rvm/gems/ruby-2.5.3/gems/user\u client-3.7.0/lib/user\u client.rb:2:in
'
/Users/user/work/angle/config/application.rb:7:in'
/用户/用户/工作/天使/耙子文件:6:in
require\u relative'
/Users/user/work/angel/Rakefile:6:in'
/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\u可执行文件挂钩:24:ineval'
/Users/user/.rvm/gems/ruby-2.5.3/bin/ruby_可执行_hooks:24:in
'
出现以下错误时:
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——将自动激活设置为false
您是否设法解决了问题?我也有同样的问题。你安装了Xcode命令行工具吗?我最后不得不重新安装curb@Rahul你是怎么重新安装的?对我来说不起作用,而且我在Mojavenm中也遇到了同样的问题,我在安装gem时手动更改了LD/CPPFLAGS,以包含带有“--with-ldflags=-L-L/usr/local/opt/krb5/lib--with-CPPFLAGS=-I-I/usr/local/opt/krb5/include”的kerberos,并且成功了
gem uninstall curb
gem install curb