Rake crash (using gem bundler)

I posted my first rubygem here: https://rubygems.org/gems/blomming_api (source code here: https://github.com/solyaris/blomming_api )

I used bundler, which created three rake commands with the bundle gem command:

 $ rake -T rake build # Build blomming_api-0.3.7.gem into the pkg directory rake install # Build and install blomming_api-0.3.7.gem into system gems rake release # Create tag v0.3.7 and build and push blomming_api-0.3.7.gem to Rubygems 

Everything is fine if you install the stone locally using rake install :

 $ rake install blomming_api 0.3.7 built to pkg/blomming_api-0.3.7.gem. blomming_api (0.3.7) installed. 

The problem occurs when I try to release:

 $ rake release blomming_api 0.3.7 built to pkg/blomming_api-0.3.7.gem. Tagged v0.3.7. Untagging v0.3.7 due to error. rake aborted! Couldn't git push. `git push 2>&1' failed with the following output: fatal: No configured push destination. Either specify the URL from the command-line or configure a remote repository using git remote add <name> <url> and then push using the remote name git push <name> /home/solyaris/.rvm/gems/ruby-2.0.0-p247/gems/bundler-1.3.5/lib/bundler/gem_helper.rb:104:in `perform_git_push' /home/solyaris/.rvm/gems/ruby-2.0.0-p247/gems/bundler-1.3.5/lib/bundler/gem_helper.rb:96:in `git_push' /home/solyaris/.rvm/gems/ruby-2.0.0-p247/gems/bundler-1.3.5/lib/bundler/gem_helper.rb:77:in `block in release_gem' /home/solyaris/.rvm/gems/ruby-2.0.0-p247/gems/bundler-1.3.5/lib/bundler/gem_helper.rb:129:in `tag_version' /home/solyaris/.rvm/gems/ruby-2.0.0-p247/gems/bundler-1.3.5/lib/bundler/gem_helper.rb:77:in `release_gem' /home/solyaris/.rvm/gems/ruby-2.0.0-p247/gems/bundler-1.3.5/lib/bundler/gem_helper.rb:50:in `block in install' Tasks: TOP => release (See full trace by running task with --trace) 

However, I can publish the stone with a successful gem push command:

 $ gem push pkg/blomming_api-0.3.7.gem Pushing gem to https://rubygems.org... Successfully registered gem: blomming_api (0.3.7) 

I guess the problem is the remote git push configuration ... Any idea to help me configure git to start rake release?

By the way, I already configured my rubygems credentials on /home/solyaris/.gem and git click on github to run ok. I know ... my git reluctance is great ;-) thanks to Giorgio

+6
source share
2 answers

The rake release command tries to dump the code to a remote repository (implicitly assuming you are using git) and create a tag.

In your case, it looks like remote git is not configured for your repository, and the task does not work.

I personally do not like this task. I prefer to use

 $ rake build 

to create a package then

 $ gem push pkg/... 

to publish the jewel in RubyGems.

If you want to use rake release , I suggest you override the default implementation to skip / replace / configure git commit.

+10
source

rake release will try to tag your gem in git and push it to your remote. It looks like you are not configured to do git push without specifying a remote.

Try to fix: git push -u origin master

If you can do git push after that without errors, rake release should also work, although you may need to increase the version number of your gem if you have already pushed it to rubies, I think ruby ​​gems complains if you try to release a gem stone of the same version.

+3
source

All Articles