Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

rake release does not work

Tags:

rubygems

gem

I'm trying to release a new version of my gem running this command:

rake release --trace

but the process is stuck here:

rake release --trace
** Invoke load_app (first_time)
** Execute load_app
** Invoke release (first_time)
** Invoke build (first_time)
** Execute build
paperclip_upload 1.2.0 built to pkg/paperclip_upload-1.2.0.gem.
** Invoke release:guard_clean (first_time)
** Execute release:guard_clean
** Invoke release:source_control_push (first_time)
** Execute release:source_control_push
Tag v1.2.0 has already been created.
** Invoke release:rubygem_push (first_time)
** Execute release:rubygem_push

Things I tried and didn't work:

  • Remove the github tag and release again.
  • Update gem to last version (2.4.8) doing gem update --system.
  • Reset my rubygems API key.
  • Use the api. curl --data-binary @pkg/paperclip_upload-1.2.0.gem -H 'Authorization:XXX' https://rubygems.org/api/v1/gems

    The POST is not working but I can retrieve my gems performing a GET.

  • Use gems

    require 'rubygems'
    require 'gems'
    
    Gems.configure do |config|
      config.username = 'xxx'
      config.password = 'xxx'
    end
    
    Gems.push(File.new("pkg/paperclip_upload-1.2.0.gem"))
    
  • Avoid to use the rake task executing gem build and then gem push -v pkg/paperclip_upload-1.2.0.gem but is stuck too:

    gem push -v pkg/paperclip_upload-1.2.0.gem
    GET https://rubygems.org/latest_specs.4.8.gz
    302 Moved Temporarily
    GET https://s3.amazonaws.com/production.s3.rubygems.org/latest_specs.4.8.gz
    304 Not Modified
    GET http://rubygems.org/latest_specs.4.8.gz
    302 Moved Temporarily
    GET http://production.s3.rubygems.org/latest_specs.4.8.gz
    200 OK
    GET http://rubygems.org/quick/Marshal.4.8/rubygems-update-2.4.8.gemspec.rz
    302 Moved Temporarily
    GET http://rubygems.global.ssl.fastly.net/quick/Marshal.4.8/rubygems-update-2.4.8.gemspec.rz
    200 OK
    Pushing gem to http://rubygems.org/...
    POST http://rubygems.org//api/v1/gems
    connection reset after 1 requests, retrying
    POST http://rubygems.org//api/v1/gems
    connection reset after 1 requests, retrying
    ERROR:  While executing gem ... (Gem::RemoteFetcher::FetchError)
        too many connection resets (http://rubygems.org//api/v1/gems)
    

Any clue?

RubyGems’ status page is all green for me.

like image 991
Leantraxxx Avatar asked Nov 10 '22 07:11

Leantraxxx


1 Answers

For me, after enabling 2FA on Rubygems.org I wasn't able to run rake release any more.

The release:rubygem_push step was hanging. Turns out older versions of gem don't support 2FA, and intermediate versions had a bug where the process is waiting for 2FA code entry but there's no prompt.

The solution for me was to type in a 2FA code + return when the process was waiting.

Eventually you should be able to gem update --system to get a new version of gem with full 2FA support.

like image 193
odlp Avatar answered Nov 15 '22 03:11

odlp