Open jgao54 opened 1 year ago
I missed this issue, which points to the same bug.
That's not the issue afaik.
Thank you for including your error:
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in 'require': incompatible library version...
What this error tells you is that the Ruby being used here is the system Ruby that comes with Os-X. It's a Ruby 2.6, and it's installed into a read only file system. So naturally you can't install any gems there.
The rules expect your ruby to be installed by rbenv.
In order for rbenv to work, you must add the following to your shell initialization file:
eval "$(rbenv init -)"
Once you do and restart your terminal session, run the command which ruby
, and if it worked you should see something like
/Users/<username>/.rbenv/shims/ruby
That's how you know it's working.
We are testing out the flow where the desired version of ruby is not installed on the host.
I expect for rules_ruby to be able to install and use v2.7.6. (Note this first requires bumping the
ruby-build
version, which I created a PR here).With the version specified in WORKSPACE:
I can confirm that ruby interpreter that's installed to the
@org_ruby_lang_ruby_toolchain
external repository is the right version:However, running any
ruby_library
target i get this error on my macos:/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in 'require': incompatible library version...
I think this requires updating the way the binary wrapper is implemented, which defaults to the first ruby found in PATH today rather than the version that's specified in the SDK:
In fact, it looks like there was an intention to substitute
{interpreter}
here but the wrapper script template itself does not have a{interpreter}
placeholder anywhere, which looks like a bug.