I'm getting the following error when trying to run some rails
commands in my app.
I upgraded ruby 2.6.6 to 2.7.3 (I use rbenv) and bundle from 2.0.2 to 2.1.4, by doing
brew update && brew upgrade ruby-build
rbenv install 2.7.3
gem install bundler:2.1.4
bundle install
And now, when I run any rails command (ex: rails c
) I get this error:
/Users/asceta/.rbenv/versions/2.7.3/lib/ruby/gems/2.7.0/gems/bootsnap-1.7.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:23:in `require': dlopen(/Users/asceta/.rbenv/versions/2.7.3/lib/ruby/gems/2.7.0/gems/patron-0.13.3/lib/patron/session_ext.bundle, 9): Library not loaded: @rpath/libssh2.1.dylib
Referenced from: /Users/asceta/.rbenv/versions/2.7.3/lib/ruby/gems/2.7.0/gems/patron-0.13.3/lib/patron/session_ext.bundle
Reason: image not found - /Users/asceta/.rbenv/versions/2.7.3/lib/ruby/gems/2.7.0/gems/patron-0.13.3/lib/patron/session_ext.bundle (LoadError)
from /Users/asceta/.rbenv/versions/2.7.3/lib/ruby/gems/2.7.0/gems/bootsnap-1.7.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:23:in `block in require_with_bootsnap_lfi'
from /Users/asceta/.rbenv/versions/2.7.3/lib/ruby/gems/2.7.0/gems/bootsnap-1.7.2/lib/bootsnap/load_path_cache/loaded_features_index.rb:92:in `register'
from /Users/asceta/.rbenv/versions/2.7.3/lib/ruby/gems/2.7.0/gems/bootsnap-1.7.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `require_with_bootsnap_lfi'
from /Users/asceta/.rbenv/versions/2.7.3/lib/ruby/gems/2.7.0/gems/bootsnap-1.7.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:31:in `require'
from /Users/asceta/.rbenv/versions/2.7.3/lib/ruby/gems/2.7.0/gems/activesupport-6.0.3.6/lib/active_support/dependencies.rb:324:in `block in require'
from /Users/asceta/.rbenv/versions/2.7.3/lib/ruby/gems/2.7.0/gems/activesupport-6.0.3.6/lib/active_support/dependencies.rb:291:in `load_dependency'
from /Users/asceta/.rbenv/versions/2.7.3/lib/ruby/gems/2.7.0/gems/activesupport-6.0.3.6/lib/active_support/dependencies.rb:324:in `require'
from /Users/asceta/.rbenv/versions/2.7.3/lib/ruby/gems/2.7.0/gems/patron-0.13.3/lib/patron/session.rb:6:in `<main>'
from /Users/asceta/.rbenv/versions/2.7.3/lib/ruby/gems/2.7.0/gems/bootsnap-1.7.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:23:in `require'
from /Users/asceta/.rbenv/versions/2.7.3/lib/ruby/gems/2.7.0/gems/bootsnap-1.7.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:23:in `block in require_with_bootsnap_lfi'
from /Users/asceta/.rbenv/versions/2.7.3/lib/ruby/gems/2.7.0/gems/bootsnap-1.7.2/lib/bootsnap/load_path_cache/loaded_features_index.rb:92:in `register'
from /Users/asceta/.rbenv/versions/2.7.3/lib/ruby/gems/2.7.0/gems/bootsnap-1.7.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `require_with_bootsnap_lfi'
from /Users/asceta/.rbenv/versions/2.7.3/lib/ruby/gems/2.7.0/gems/bootsnap-1.7.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:31:in `require'
from /Users/asceta/.rbenv/versions/2.7.3/lib/ruby/gems/2.7.0/gems/activesupport-6.0.3.6/lib/active_support/dependencies.rb:324:in `block in require'
from /Users/asceta/.rbenv/versions/2.7.3/lib/ruby/gems/2.7.0/gems/activesupport-6.0.3.6/lib/active_support/dependencies.rb:291:in `load_dependency'
from /Users/asceta/.rbenv/versions/2.7.3/lib/ruby/gems/2.7.0/gems/activesupport-6.0.3.6/lib/active_support/dependencies.rb:324:in `require'
from /Users/asceta/.rbenv/versions/2.7.3/lib/ruby/gems/2.7.0/gems/patron-0.13.3/lib/patron.rb:5:in `<main>'
from /Users/asceta/.rbenv/versions/2.7.3/lib/ruby/gems/2.7.0/gems/bootsnap-1.7.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:23:in `require'
from /Users/asceta/.rbenv/versions/2.7.3/lib/ruby/gems/2.7.0/gems/bootsnap-1.7.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:23:in `block in require_with_bootsnap_lfi'
from /Users/asceta/.rbenv/versions/2.7.3/lib/ruby/gems/2.7.0/gems/bootsnap-1.7.2/lib/bootsnap/load_path_cache/loaded_features_index.rb:92:in `register'
from /Users/asceta/.rbenv/versions/2.7.3/lib/ruby/gems/2.7.0/gems/bootsnap-1.7.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `require_with_bootsnap_lfi'
from /Users/asceta/.rbenv/versions/2.7.3/lib/ruby/gems/2.7.0/gems/bootsnap-1.7.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:31:in `require'
from /Users/asceta/.rbenv/versions/2.7.3/lib/ruby/gems/2.7.0/gems/bundler-2.1.4/lib/bundler/runtime.rb:74:in `block (2 levels) in require'
from /Users/asceta/.rbenv/versions/2.7.3/lib/ruby/gems/2.7.0/gems/bundler-2.1.4/lib/bundler/runtime.rb:69:in `each'
from /Users/asceta/.rbenv/versions/2.7.3/lib/ruby/gems/2.7.0/gems/bundler-2.1.4/lib/bundler/runtime.rb:69:in `block in require'
from /Users/asceta/.rbenv/versions/2.7.3/lib/ruby/gems/2.7.0/gems/bundler-2.1.4/lib/bundler/runtime.rb:58:in `each'
from /Users/asceta/.rbenv/versions/2.7.3/lib/ruby/gems/2.7.0/gems/bundler-2.1.4/lib/bundler/runtime.rb:58:in `require'
from /Users/asceta/.rbenv/versions/2.7.3/lib/ruby/gems/2.7.0/gems/bundler-2.1.4/lib/bundler.rb:174:in `require'
from /Users/asceta/Projects/Fintual/monolith/config/application.rb:10:in `<top (required)>'
from /Users/asceta/.rbenv/versions/2.7.3/lib/ruby/gems/2.7.0/gems/spring-2.1.1/lib/spring/application.rb:92:in `require'
from /Users/asceta/.rbenv/versions/2.7.3/lib/ruby/gems/2.7.0/gems/spring-2.1.1/lib/spring/application.rb:92:in `preload'
from /Users/asceta/.rbenv/versions/2.7.3/lib/ruby/gems/2.7.0/gems/spring-2.1.1/lib/spring/application.rb:157:in `serve'
from /Users/asceta/.rbenv/versions/2.7.3/lib/ruby/gems/2.7.0/gems/spring-2.1.1/lib/spring/application.rb:145:in `block in run'
from /Users/asceta/.rbenv/versions/2.7.3/lib/ruby/gems/2.7.0/gems/spring-2.1.1/lib/spring/application.rb:139:in `loop'
from /Users/asceta/.rbenv/versions/2.7.3/lib/ruby/gems/2.7.0/gems/spring-2.1.1/lib/spring/application.rb:139:in `run'
from /Users/asceta/.rbenv/versions/2.7.3/lib/ruby/gems/2.7.0/gems/spring-2.1.1/lib/spring/application/boot.rb:19:in `<top (required)>'
from /Users/asceta/.rbenv/versions/2.7.3/lib/ruby/2.7.0/rubygems/core_ext/kernel_require.rb:83:in `require'
from /Users/asceta/.rbenv/versions/2.7.3/lib/ruby/2.7.0/rubygems/core_ext/kernel_require.rb:83:in `require'
from -e:1:in `<main>'
What I've tried:
gem uninstall patron && gem install patron
brew reinstall openssl@1.1
When I manually remove the patron gem from Gemfile
and Gemfile.lock
everything works fine, but I need the patron gem.
As last measure I've left to try to remove rbenv and use RVM: Ruby Version Manager, instead, but I want to avoid this and keep using rbenv
Next things I would try:
bundle exec rails c
instead.which openssl
returns, that may indicate that you have different versions installed (mine shows /usr/bin/openssl
)