-
Notifications
You must be signed in to change notification settings - Fork 22
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
gem download fails with EPERM #47
Comments
We have seen this happening too -- perhaps there are changes to or issues with rubygems.org? |
Possible, but somewhat unlikely given that the download failed when run from brew-gem both before and after the successful manual download. Is it possible it's some kind of environment issue like a different ruby or gem binary being run via brew-gem? |
Both system and homebrew gems are work fine when executing fetch command manually ~/Library/Caches/Homebrew/ /usr/local/bin/gem fetch fastlane --version 2.50.1
Downloaded fastlane-2.50.1
~/Library/Caches/Homebrew/ /usr/bin/gem fetch fastlane --version 2.50.1
Downloaded fastlane-2.50.1 But it's failing when calling with |
After 2 hours of investigation I found out that problem is in Homebrew itself. It has broken something in cd /usr/local/Homebrew/
git checkout 1.2.5
brew gem upgrade fastlane #now works fine |
Here is it. |
A've made workaround for personal usage. |
Ah, right. And |
Still happening to me:
My system info:
|
I confirm that the issue is still there for me as well with brew-gem 0.8.3 |
@vdupom @guaguanco check that the system rubygems version is upgraded to a 2.6.x version. |
Hi @nicksieger I get the same problem when I use the --homebrew-ruby argument. Same errors as @vdupom with /usr/local/bin/gem instead of /usr/bin/gem in the messages. I rather not touch the OSX (sierra in my case) version of ruby and use homebrew's. It seems that the gem file doesn't get downloaded in the right place because I cannot find it in the homebrew cache folder. In attachment the formula for bcat: brew-gem_bcat-formula.rb.txt. |
So, this is the piece of the formula that ensures that rubygems does not try to write outside of the homebrew sandbox/cache folder: HOMEBREW_CACHE.cd do
ENV['GEM_SPEC_CACHE'] = "#{HOMEBREW_CACHE}/gem_spec_cache"
system "gem", "fetch", "bcat", "--version", resource.version
end Can you check if that |
The gem_spec_cache is there in the right place, but it contains just api.rubygems.org%443/latest_specs.4.8 I guess that you're right about the outdated gem, in the RubyGemsDownloadStrategy class there should be something like
as in the GemBcat class. |
Ah, good catch! How does #51 look? |
#51 looks good to me, it should fix the issue. BTW wouldn't be better to add an explicit requirement for the gem version to brew-gem and to default to homebrew ruby if the system one is too old? |
Looking at the source, it seems brew-gem just runs
gem fetch ...
from the homebrew cache directory (however it should check the exit code and not continue if the download failed)I haven't been able to figure out why
gem fetch
even fails in the first place though. The permissions of.gem/specs/api.rubygems.org%443
look fine. When Icd
into the homebrew cache and run fetch manually it works:After this
brew gem install
succeeds -- it attempts the download again (which fails again), but then proceeds to install the gem:The text was updated successfully, but these errors were encountered: