New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

brew: handle Ruby 2.3 more gracefully. #3240

Merged
merged 1 commit into from Sep 29, 2017

Conversation

Projects
None yet
4 participants
@MikeMcQuaid
Member

MikeMcQuaid commented Sep 29, 2017

  • brew.rb needed updated to fail unless on Ruby 2.3
  • brew update should unset HOMEBREW_RUBY_PATH to ensure that this doesn't "stick" on a Ruby 2.0 version after a portable Ruby has been installed.

Fixes #3237 (may not fix that exact case because not reproducible but will at least make the error nicer and hopefully fix that case).

@MikeMcQuaid MikeMcQuaid referenced this pull request Sep 29, 2017

Closed

SyntaxError at os/mac.rb:107: 's&.path' #3237

4 of 4 tasks complete
@JCount

This comment has been minimized.

Show comment
Hide comment
@JCount

JCount Sep 29, 2017

Member

This is failing on the Linux CI because dev-cmd/update-test.rb#L83-L84 does not contain the rvm ruby-2.3.3 installation in the PATH.

Member

JCount commented Sep 29, 2017

This is failing on the Linux CI because dev-cmd/update-test.rb#L83-L84 does not contain the rvm ruby-2.3.3 installation in the PATH.

brew: handle Ruby 2.3 more gracefully.
- `brew.rb` needed updated to fail unless on Ruby 2.3
- `brew update` should unset `HOMEBREW_RUBY_PATH` to ensure that this
  doesn't "stick" on a Ruby 2.0 version after a portable Ruby has been
  installed.
@@ -81,7 +81,7 @@ def update_test
safe_system "git", "reset", "--hard", start_commit
# update ENV["PATH"]
ENV["PATH"] = "#{curdir}/bin:/usr/local/bin:/usr/bin:/bin"
ENV["PATH"] = "#{curdir}/bin:#{ENV["PATH"]}"

This comment has been minimized.

@reitermarkus

reitermarkus Sep 29, 2017

Member

Use the PATH class here.

@reitermarkus

reitermarkus Sep 29, 2017

Member

Use the PATH class here.

This comment has been minimized.

@MikeMcQuaid

MikeMcQuaid Sep 29, 2017

Member

I have no objections to that happening in a follow-up PR but this is biting users and needs merged ASAP and this refactoring isn't a priority for that, sorry.

@MikeMcQuaid

MikeMcQuaid Sep 29, 2017

Member

I have no objections to that happening in a follow-up PR but this is biting users and needs merged ASAP and this refactoring isn't a priority for that, sorry.

@MikeMcQuaid MikeMcQuaid merged commit ffb582b into Homebrew:master Sep 29, 2017

2 of 3 checks passed

codecov/patch 0% of diff hit (target 67.12%)
Details
codecov/project 67.14% (+0.01%) compared to 3883382
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details

@MikeMcQuaid MikeMcQuaid deleted the MikeMcQuaid:update-handle-ruby-changes branch Sep 29, 2017

RUBY_X = RUBY_VERSION_SPLIT[0].to_i
RUBY_Y = RUBY_VERSION_SPLIT[1].to_i
if RUBY_X < 2 || (RUBY_X == 2 && RUBY_Y < 3)
raise "Homebrew must be run under Ruby 2.3!"

This comment has been minimized.

@ashfurrow

ashfurrow Oct 17, 2017

Contributor

It would be helpful, especially when this command fails on remote servers like on CI, to output the Ruby version that was found.

@ashfurrow

ashfurrow Oct 17, 2017

Contributor

It would be helpful, especially when this command fails on remote servers like on CI, to output the Ruby version that was found.

This comment has been minimized.

@reitermarkus

reitermarkus Oct 17, 2017

Member

We'd accept a PR for that.

@reitermarkus

reitermarkus Oct 17, 2017

Member

We'd accept a PR for that.

dochang added a commit to dochang/homebrew-binary that referenced this pull request Dec 21, 2017

dochang added a commit to dochang/homebrew-binary that referenced this pull request Dec 21, 2017

Always use Homebrew Ruby
Travis reports the following error even rvm uses 2.3.x:

```
/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/travis/.linuxbrew/Library/Homebrew/brew.rb:12:in `<main>': Homebrew must be run under Ruby 2.3! You're running 1.9.3. (RuntimeError)
```

Force to use Homebrew vendored ruby to solve this issue.

[1]: Linuxbrew/brew@40af9e6#diff-354f30a63fb0907d4ad57269548329e3
[2]: Homebrew/brew@40af9e6#diff-354f30a63fb0907d4ad57269548329e3
[3]: https://github.com/Linuxbrew/brew/blob/02773af31860e14d247def718a25b16667e94012/Library/Homebrew/cmd/vendor-install.sh
[4]: https://github.com/Homebrew/brew/blob/75d032129a94210937718ac72c5e74a59360a5fd/Library/Homebrew/cmd/vendor-install.sh
[5]: Homebrew/brew#3240
[6]: Homebrew/brew#3546

@Homebrew Homebrew locked and limited conversation to collaborators May 4, 2018

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.