mise icon indicating copy to clipboard operation
mise copied to clipboard

Ruby plugin's ruby fails to `bundle install` with "LoadError: incompatible library version"

Open offbyone opened this issue 1 year ago • 3 comments

Describe the bug I am switching from asdf to mise, and have found that the ruby installed by mise is unable to bundle install some of my gems.

Running bundle install results in this:

$ bundle install
Ignoring psych-5.1.2 because its extensions are not built. Try: gem pristine psych --version 5.1.2
Ignoring stringio-3.1.0 because its extensions are not built. Try: gem pristine stringio --version 3.1.0
--- ERROR REPORT TEMPLATE -------------------------------------------------------

LoadError: incompatible library version - /Users/offbyone/[redacted]/vendor/gems/ruby/3.1.0/gems/psych-5.1.2/lib/psych.bundle
... a whole big report

To Reproduce

  • use mise
  • run mise install [email protected]
  • install bundler
  • bundle install with these gems.

Expected behavior

"bundle install" should work :D

** Extra Context **

The ruby versions are subtly different:

$ asdf exec ruby --version
ruby 3.1.4p223 (2023-03-30 revision 957bb7cb81) [arm64-darwin22]
$ ruby --version
ruby 3.1.4p223 (2023-03-30 revision 957bb7cb81) [arm64-darwin23]

The bundle environments are also subtly different:

--- /Users/offbyone/tmp/asdf-bundle-env	2024-04-04 08:24:29
+++ /Users/offbyone/tmp/mise-bundle-env	2024-04-04 08:24:34
@@ -2,16 +2,16 @@
 
 Bundler       2.4.10
-  Platforms   ruby, arm64-darwin-22
-Ruby          3.1.4p223 (2023-03-30 revision 957bb7cb81995f26c671afce0ee50a5c660e540e) [arm64-darwin-22]
-  Full Path   /Users/offbyone/.asdf/installs/ruby/3.1.4/bin/ruby
-  Config Dir  /Users/offbyone/.asdf/installs/ruby/3.1.4/etc
+  Platforms   ruby, arm64-darwin-23
+Ruby          3.1.4p223 (2023-03-30 revision 957bb7cb81995f26c671afce0ee50a5c660e540e) [arm64-darwin-23]
+  Full Path   /Users/offbyone/.local/share/mise/installs/ruby/3.1.4/bin/ruby
+  Config Dir  /Users/offbyone/.local/share/mise/installs/ruby/3.1.4/etc
 RubyGems      3.3.26
-  Gem Home    /Users/offbyone/[redacted]/vendor
-  Gem Path    /Users/offbyone/.gem/ruby/3.1.0:/Users/offbyone/.asdf/installs/ruby/3.1.4/lib/ruby/gems/3.1.0:/Users/offbyone/[redacted]/vendor
+  Gem Home    /Users/offbyone/[redacted]/vendor/gems/ruby/3.1.0
+  Gem Path    /Users/offbyone/[redacted]/vendor/gems/ruby/3.1.0
   User Home   /Users/offbyone
   User Path   /Users/offbyone/.gem/ruby/3.1.0
-  Bin Dir     /Users/offbyone/[redacted]/vendor/bin
+  Bin Dir     /Users/offbyone/[redacted]/vendor/gems/ruby/3.1.0/bin
 Tools         
   Git         2.44.0
   RVM         not installed
@@ -50,6 +50,8 @@
   Set for the current user (/Users/offbyone/.bundle/config): "true"
 gem.test
   Set for the current user (/Users/offbyone/.bundle/config): false
+gemfile
+  Set via BUNDLE_GEMFILE: "/Users/offbyone/[redacted]/Gemfile"
 path
   Set for your local app (/Users/offbyone/[redacted]/.bundle/config): "vendor/gems"
 rubygems.pkg.github.com

mise doctor output

version: 2024.4.0 macos-arm64 (2024-04-02)
activated: yes
shims_on_path: no

build_info: 
  Target: aarch64-apple-darwin
  Features: DEFAULT, NATIVE_TLS
  Built: Tue, 2 Apr 2024 01:55:39 +0000
  Rust Version: rustc 1.77.1 (7cf61ebde 2024-03-27) (Homebrew)
  Profile: release

shell: 
  /opt/homebrew/bin/fish
  fish, version 3.7.1

dirs: 
  data: ~/.local/share/mise
  config: ~/.config/mise
  cache: ~/Library/Caches/mise
  state: ~/.local/state/mise
  shims: ~/.local/share/mise/shims

config_files: 
  ~/.tool-versions
  ~/.config/mise/config.toml
  ~/[redacted]/.node-version
  ~/[redacted]/.ruby-version
  ~/[redacted]/Gemfile
  ~/[redacted]/.tool-versions

plugins: 
  act               https://github.com/grimoh/asdf-act.git#bfc9331
  action-validator  https://github.com/mpalmer/action-validator.git#d064028
  awscli            https://github.com/MetricMike/asdf-awscli.git#2e31396
  azure-cli         https://github.com/EcoMind/asdf-azure-cli.git#4735c27
  bun               (core)
  deno              (core)
  erlang            (core)
  git-chglog        https://github.com/GoodwayGroup/asdf-git-chglog.git#ef79c13
  go                (core)
  java              (core)
  kubectl           https://github.com/asdf-community/asdf-kubectl.git#cbe6df4
  ninja             https://github.com/asdf-community/asdf-ninja.git#267f56b
  node              (core)
  pre-commit        https://github.com/jonathanmorley/asdf-pre-commit.git#26bfc42
  python            (core)
  ruby              (core)
  rust-analyzer     https://github.com/Xyven1/asdf-rust-analyzer#301bc6a
  shfmt             https://github.com/luizm/asdf-shfmt.git#a42c5ff
  tflint            https://github.com/skyzyx/asdf-tflint.git#37e7eb9
  usage             https://github.com/jdx/mise-usage.git#fe3888a
  wasmtime          https://github.com/tachyonicbytes/asdf-wasmtime#6699afa

toolset: 
  [email protected]            
  [email protected]          
  [email protected]          
  [email protected]         
  npm:[email protected]      
  npm:[email protected]    
  npm:[email protected]   
  npm:[email protected]       
  [email protected]             
  [email protected]            
  [email protected]  
  [email protected]         
  [email protected]     
  [email protected]   
  [email protected]     
  [email protected]           
  [email protected]         
  [email protected]          
  [email protected]      
  direnv@system         
  rust-analyzer@2023-05-22  
  [email protected]        

env_vars: 
  MISE_SHELL=fish

settings: 
  activate_aggressive = false
  all_compile = false
  always_keep_download = false
  always_keep_install = false
  asdf_compat = false
  cargo_binstall = true
  color = true
  disable_default_shorthands = false
  disable_tools = []
  experimental = true
  go_default_packages_file = "~/.default-go-packages"
  go_download_mirror = "https://dl.google.com/go"
  go_repo = "https://github.com/golang/go"
  go_set_gopath = false
  go_set_goroot = true
  go_skip_checksum = false
  jobs = 4
  legacy_version_file = true
  legacy_version_file_disable_tools = []
  node_compile = false
  not_found_auto_install = true
  paranoid = false
  plugin_autoupdate_last_check_duration = "7d"
  python_compile = false
  python_default_packages_file = "/Users/offbyone/.default-python-packages"
  python_pyenv_repo = "https://github.com/pyenv/pyenv.git"
  raw = false
  trusted_config_paths = []
  quiet = false
  verbose = false
  yes = false
  ci = false
  debug = false
  trace = false
  log_level = "info"
  python_venv_auto_create = false

  [status]
  missing_tools = "if_other_versions_installed"
  show_env = false
  show_tools = false

No problems found

Additional context Add any other context about the problem here.

offbyone avatar Apr 04 '24 15:04 offbyone

Hey! I encountered the same problem and was able to get it working by doing:

rm -rf ~/.local/share/gem
rm -rf ~/.gem
bundle install --redownload

It seems like some paths are shared between the install and it caused incompatibilities.

louim avatar Apr 16 '24 20:04 louim

Oof. This is so close but I'm still having errors with C extensions, because apparently the source is not installed. Looking into it (I'm hoping it's a plugin option)

offbyone avatar Apr 16 '24 21:04 offbyone

I'm battling the same problem currently. I was getting really cryptic errors like running gem info would fail and say something about stringIO gem linking to and old cache path that referenced asdf. I seem to have fixed the problems (for now) with:

  • mise uninstall ruby
  • one more round of rm -rf for good measure
  • reboot
  • mise install ruby

Hopefully you have the same luck!

louim avatar Apr 16 '24 21:04 louim