gem push error - (Gem::Package::FormatError) - No such file or directory @ rb_sysopen

╄→尐↘猪︶ㄣ 提交于 2019-12-18 15:53:06

问题


I tried to push a ruby gem for the first time while on a terrible internet connection. When I first tried to push, I was able to sign in and then it hung there for probably about 10 minutes with no sign of progress so I decided to just kill it and hit ctrl+c, which may have been a poor decision. From the session:

$ gem push test_config-0.1.0.gem
Enter your RubyGems.org credentials.
Don't have an account yet? Create one at https://rubygems.org/sign_up
   Email:   myemail@here.com
Password:   

Signed in.
^CERROR:  Interrupted

Now, when I try to push it again (on a better internet connection) I get the following:

ERROR:  While executing gem ... (Gem::Package::FormatError)
    No such file or directory @ rb_sysopen - test_config-0.1.0.gem
    /Users/Scott/.rvm/rubies/ruby-2.1.0/lib/ruby/site_ruby/2.1.0/rubygems/package.rb:512:in `rescue in verify'
    /Users/Scott/.rvm/rubies/ruby-2.1.0/lib/ruby/site_ruby/2.1.0/rubygems/package.rb:490:in `verify'
    /Users/Scott/.rvm/rubies/ruby-2.1.0/lib/ruby/site_ruby/2.1.0/rubygems/package.rb:474:in `spec'
    /Users/Scott/.rvm/rubies/ruby-2.1.0/lib/ruby/site_ruby/2.1.0/rubygems/commands/push_command.rb:81:in `send_gem'
    /Users/Scott/.rvm/rubies/ruby-2.1.0/lib/ruby/site_ruby/2.1.0/rubygems/commands/push_command.rb:47:in `execute'
    /Users/Scott/.rvm/rubies/ruby-2.1.0/lib/ruby/site_ruby/2.1.0/rubygems/command.rb:305:in `invoke_with_build_args'
    /Users/Scott/.rvm/rubies/ruby-2.1.0/lib/ruby/site_ruby/2.1.0/rubygems/command_manager.rb:167:in `process_args'
    /Users/Scott/.rvm/rubies/ruby-2.1.0/lib/ruby/site_ruby/2.1.0/rubygems/command_manager.rb:137:in `run'
    /Users/Scott/.rvm/rubies/ruby-2.1.0/lib/ruby/site_ruby/2.1.0/rubygems/gem_runner.rb:54:in `run'
    /Users/Scott/.rvm/rubies/ruby-2.1.0/bin/gem:21:in `<main>'

I tried bumping the version and pushing that and I still get the same error.

Does anyone know how to go about resolving this error? Is it related to the fact that I killed the first attempt to push?


回答1:


Nevermind, I am an idiot. I didn't build the gem first, so of course there was no "test_config-0.1.0.gem" file to open. I built the gem first and now it works:

gem build test_config


来源:https://stackoverflow.com/questions/24749225/gem-push-error-gempackageformaterror-no-such-file-or-directory-rb-sy

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!