2
votes

I am on macOS 10.14.2 mojave and am getting an error when I run rake db:setup on my mysql database. It is working fine in other projects and when I did gem list in other projects, they both had mysql 0.5.2 and curb 0.9.7. I used to have the same following error except it said libssh2.1 instead of libgssapi_krb5, so I did brew install libssh2 and then the error changed to this. I then tried doing brew install krb5 but that did not make a difference. Here is the error:

mbp-user:project user$ rake db:setup rake aborted! LoadError: dlopen(/Users/user/.rvm/gems/ruby-2.5.3/gems/curb-0.9.7/lib/curb_core.bundle, 9): Library not loaded: @rpath/libgssapi_krb5.2.2.dylib Referenced from: /Users/user/.rvm/gems/ruby-2.5.3/gems/curb-0.9.7/lib/curb_core.bundle Reason: image not found - /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:in require' /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/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:inrequire' /Users/user/.rvm/gems/ruby-2.5.3/gems/activesupport-5.1.6/lib/active_support/dependencies.rb:292:in block in require' /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 require' /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_support/dependencies.rb:292:in require' /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/helpers/http_client.rb:1:in <top (required)>' /Users/user/.rvm/gems/ruby-2.5.3/gems/user_client-3.7.0/lib/user_client/helpers/authorized_request.rb:1:inrequire_relative' /Users/user/.rvm/gems/ruby-2.5.3/gems/user_client-3.7.0/lib/user_client/helpers/authorized_request.rb:1:in <top (required)>' /Users/user/.rvm/gems/ruby-2.5.3/gems/user_client-3.7.0/lib/user_client/adapter.rb:2:inrequire_relative' /Users/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:inrequire' /Users/user/.rvm/gems/ruby-2.5.3/gems/activesupport-5.1.6/lib/active_support/dependencies.rb:292:in block in require' /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 require' /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:inrequire_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:in eval' /Users/user/.rvm/gems/ruby-2.5.3/bin/ruby_executable_hooks:24:in'

1
Did you manage to solve your problem? I'm having the exact same problem. Do you have Xcode Command Line Tools installed?Carlos Júlio
I ended up just having to reinstall curbRahul
@Rahul How did you reinstall it? Didn't work for me and I have same issue in Mojavebuddhabrot
nm, I manually changed LD/CPPFLAGS when installing the gem to include kerberos with '--with-ldflags=-L-L/usr/local/opt/krb5/lib --with-cppflags=-I-I/usr/local/opt/krb5/include' and it workedbuddhabrot

1 Answers

1
votes

Following error when:

rake db:drop 

OR

bundle exec rake db:drop

Error:

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:

Solution:

brew install krb5

brew link --force krb5 

might give the following output:

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"

Export paths vars LDFLAGS and CPPFLAGS

export LDFLAGS="-L/usr/local/opt/krb5/lib"
export CPPFLAGS="-I/usr/local/opt/krb5/include"

Re-install curb gem

gem uninstall curb
gem install curb

Side notes on my current system setup:

Mac OS Catalina 10.15.3

I have anaconda3 installed on my system although I have disabled it using the following command:

conda config --set auto_activate_base false