I have the following ruby in /usr/local/bin in $PATH. But install.sh shows an error about ruby. It seems that install.sh uses /usr/bin/ruby instead. Does anybody know what is wrong with install.sh?
$ sh -c "$(curl -fsSL https://raw.githubusercontent.com/Linuxbrew/install/master/install.sh)"
==> Select the Linuxbrew installation directory
- Enter your password to install to /home/linuxbrew/.linuxbrew (recommended)
- Press Control-D to install to /home/py/.linuxbrew
- Press Control-C to cancel installation
Sorry, user py may not run sudo on regor.
==> This script will install:
/home/py/.linuxbrew/bin/brew
/home/py/.linuxbrew/share/doc/homebrew
/home/py/.linuxbrew/share/man/man1/brew.1
/home/py/.linuxbrew/share/zsh/site-functions/_brew
/home/py/.linuxbrew/etc/bash_completion.d/brew
/home/py/.cache/Homebrew/
/home/py/.linuxbrew/Homebrew
Press RETURN to continue or any other key to abort
==> Downloading and installing Linuxbrew...
HEAD is now at 851177a docs: update gems. (#569)
/usr/lib/ruby/1.9.1/rubygems/version.rb:191:in `strip!': can't modify frozen String (RuntimeError)
from /usr/lib/ruby/1.9.1/rubygems/version.rb:191:in `initialize'
from -e:1:in `new'
from -e:1:in `<main>'
/home/py/.linuxbrew/Homebrew/Library/Homebrew/brew.rb:12:in `<main>': Homebrew must be run under Ruby 2.3! You're running 1.9.3. (RuntimeError)
Failed during: /home/py/.linuxbrew/bin/brew update --force
$ which ruby
/usr/local/bin/ruby
$ ruby --version
ruby 2.5.0p0 (2017-12-25 revision 61468) [x86_64-linux]
$ /usr/bin/ruby --version
ruby 1.9.3p484 (2013-11-22 revision 43786) [x86_64-linux]
I've seen this error before. As a workaround, try…
export HOMEBREW_FORCE_VENDOR_RUBY=1
sh -c "$(curl -fsSL https://raw.githubusercontent.com/Linuxbrew/install/master/install.sh)"
@sjackman OK. This works. But I think HOMEBREW_FORCE_VENDOR_RUBY=1 should be the default.
It is meant to be the default when /usr/bin/ruby < 2.3.3. That test doesn't seem to be working on your system. This error is suspicious:
/usr/lib/ruby/1.9.1/rubygems/version.rb:191:in `strip!': can't modify frozen String (RuntimeError)
I suspect this line of code is working as intended on your system:
https://github.com/Linuxbrew/brew/blob/851177a2928f65dedadad052347fbd7201282e38/Library/Homebrew/utils/ruby.sh#L40
I don't have time to look into this issue now. I'll look into it in February. If you have the Ruby-fu and inclination, a pull request would be welcome.
@sjackman Were having the same problem on our circle-ci builds for some software we are developing.
https://circleci.com/gh/Metannotate/Metannotate/tree/linux_brew_fix_for_ci
Ruby versions on the system.
/opt/google-cloud-sdk/platform/ext-runtime/ruby
/opt/google-cloud-sdk/.install/.backup/platform/ext-runtime/ruby
/opt/circleci/.rvm/rubies/ruby-2.3.1
/opt/circleci/.rvm/rubies/ruby-2.3.1/lib/ruby/gems/2.3.0/wrappers/ruby
/opt/circleci/.rvm/rubies/ruby-2.3.1/include/ruby-2.3.0
/opt/circleci/.rvm/rubies/ruby-2.3.1/include/ruby-2.3.0/x86_64-linux/ruby
/opt/circleci/.rvm/rubies/ruby-2.3.1/include/ruby-2.3.0/ruby
/opt/circleci/.rvm/rubies/ruby-2.3.1/bin/ruby
/opt/circleci/.rvm/patches/jruby
/usr/share/doc/ruby1.9.1
/usr/share/doc/ruby
/usr/share/doc/apt-xapian-index/examples/ruby
/usr/lib/google-cloud-sdk/platform/ext-runtime/ruby
/usr/lib/ruby
/usr/lib/ruby/1.9.1/rubygems
/usr/local/lib/site_ruby
/usr/bin/ruby1.9.1
/usr/bin/ruby
Getting the error:
/usr/lib/ruby/1.9.1/rubygems/version.rb:191:in `strip!': can't modify frozen String (RuntimeError)
from /usr/lib/ruby/1.9.1/rubygems/version.rb:191:in `initialize'
from -e:1:in `new'
from -e:1:in `<main>'
So its using /usr/bin/ruby1.9.1 not 2.3.2
Hi, Lee. This issue has been resolved upstream in Homebrew/brew. The fix will be included in Linuxbrew/brew 1.5.3. The workaround for now is to set…
export HOMEBREW_FORCE_VENDOR_RUBY=1
@sjackman Thanks that works.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.
I believe this issue has been resolved.