Skip to content
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

Fix gem exe used by RubyGemsDownloadStrategy #51

Merged
merged 2 commits into from
Nov 14, 2017

Conversation

nicksieger
Copy link

What

What are you changing? Describe impact and scope.

Why

Why is this being changed? Provide some context that may help future developers understand the reasoning behind these changes. Quote and/or link to requirements, keeping in mind that JIRA/A-HA/etc links may not be available in the future.

Deploy Plan

Does Platform Operations need to know anything special about this deploy? Are migrations present?

Rollback Plan

  • To roll back this change, revert the merge with: git revert -m 1 MERGE_SHA and perform another deploy.

URLs

Links to bug tickets or user stories.

QA Plan

Reference commonly used Regression test plans on the [QA Wiki]https://github.com/sportngin/qa-tests/wiki
Fill in scenarios below in checklist format.
Consider Regression scenarios (did we break something else related to this change) in addition to Happy Path (testing the new feature directly).
Evaluate the risk level and label accordingly and ensure the QA Plan matches the risk level!

  • Example scenario

@anfleene
Copy link

QA Looks good :shipit:

$ bin/brew-gem install mailcatcher
==> Fetching mailcatcher from gem source
Fetching: mailcatcher-0.6.5.gem (100%)
Downloaded mailcatcher-0.6.5
Warning: Cannot verify integrity of mailcatcher-0.6.5.gem
A checksum was not provided for this resource
For your reference the SHA256 is: 7d8d5bdac5f86b8801c79ba87add11f44ba661a08a10e14231ae44142c9acf40
==> /usr/bin/gem install /Users/anfleene/Library/Caches/Homebrew/mailcatcher-0.6.5.gem --no-ri --no-rdoc --no-wrapper --no-user-install --install-dir /usr/local/Cellar/gem-mailcatcher/0.6.5 --bindir /us
🍺  /usr/local/Cellar/gem-mailcatcher/0.6.5: 1,010 files, 12.7MB, built in 26 seconds
bin/brew-gem install mailcatcher  51.64s user 27.83s system 96% cpu 1:22.54 total

@production-status-check
Copy link

:octocat: Has QA approval

@nicksieger nicksieger merged commit ca06de2 into master Nov 14, 2017
@nicksieger nicksieger deleted the fix-download-strategy-gem branch November 14, 2017 20:22
@sshaw
Copy link

sshaw commented Apr 7, 2018

Does not work for me:

~/code/ruby/rack-stuff/nginx-unit-test >brew info brew-gem
brew-gem: stable 0.8.4, HEAD
Install RubyGems as Homebrew formulae
https://github.com/sportngin/brew-gem
/usr/local/Cellar/brew-gem/0.8.4 (10 files, 14.1KB) *
  Built from source on 2018-04-07 at 17:19:05
From: https://github.com/Homebrew/homebrew-core/blob/master/Formula/brew-gem.rb
~/code/ruby/homebrew-formulas >brew-gem install mailcatcher
==> Fetching mailcatcher from gem source
ERROR:  While executing gem ... (Errno::EPERM)
    Operation not permitted - /Users/sshaw/.gem/specs/rubygems.org%443/specs.4.8
==> /usr/bin/gem install /Users/sshaw/Library/Caches/Homebrew/mailcatcher-0.6.5.gem --no-ri --no-rdoc --no-wrapper
Last 15 lines from /Users/sshaw/Library/Logs/Homebrew/gem-mailcatcher/01.gem:
2018-04-07 17:23:25 -0400

/usr/bin/gem
install
/Users/sshaw/Library/Caches/Homebrew/mailcatcher-0.6.5.gem
--no-ri
--no-rdoc
--no-wrapper
--no-user-install
--install-dir
/usr/local/Cellar/gem-mailcatcher/0.6.5
--bindir
/usr/local/Cellar/gem-mailcatcher/0.6.5/bin

ERROR:  Could not find a valid gem '/Users/sshaw/Library/Caches/Homebrew/mailcatcher-0.6.5.gem' (>= 0) in any repository
...

@nicksieger
Copy link
Author

nicksieger commented Apr 7, 2018

@sshaw you might need to upgrade rubygems in your ruby. Only more recent versions allow overriding the directory where gem specs are downloaded/cached with an environment variable.

Or use homebrew ruby for a more modern ruby than what's installed by osx.

@sshaw
Copy link

sshaw commented Apr 7, 2018

@sshaw you might need to upgrade rubygems in your ruby. Only more recent versions allow overriding the directory where gem specs are downloaded/cached with an environment variable.

I possibly have every ruby version since 1.6 installed and none work.

After having a second look, the problem is it's using /usr/bin/gem, which is going to be ancient on all OS X versions that I know of.

Why not take whatever is in the path? Or, is this what's in the path given the sandboxed brew env?

Or use homebrew ruby for a more modern ruby than what's installed by osx.

Homebrew ruby is installed too (keg only though).

@sshaw
Copy link

sshaw commented Apr 7, 2018

After having a second look, the problem is it's using /usr/bin/gem, which is going to be ancient on all OS X versions that I know of.

Ok, I see that you default to that unless one provides the --homebrew-ruby option.

So basically use of this requires a recent system ruby or Homebrew linked ruby (as you say here 😬).

And why not take whatever is in the path?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants