Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/git/25.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ruby rake释放失败(使用gem bundler)_Ruby_Git_Rubygems_Gem_Bundler - Fatal编程技术网

Ruby rake释放失败(使用gem bundler)

Ruby rake释放失败(使用gem bundler),ruby,git,rubygems,gem,bundler,Ruby,Git,Rubygems,Gem,Bundler,我在这里出版了我的第一本rubygem: (此处的源代码:) 我使用了bundler,它使用bundlegem命令创建三个rake任务: $ 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

我在这里出版了我的第一本rubygem: (此处的源代码:)

我使用了bundler,它使用
bundlegem
命令创建三个rake任务:

$ 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
$ gem push pkg/blomming_api-0.3.7.gem
Pushing gem to https://rubygems.org...
Successfully registered gem: blomming_api (0.3.7)
如果使用
rake install
本地安装gem,则一切正常:

$ rake install
blomming_api 0.3.7 built to pkg/blomming_api-0.3.7.gem.
blomming_api (0.3.7) installed.
当我尝试释放时出现问题:

$ 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)
我想问题出在git push远程配置上。。。 有没有办法帮我配置git,让rake release运行

顺便说一句,我已经在/home/solyaris/.gem上配置了我的rubygems凭据 git推送github运行正常。 我知道。。。我的git很不情愿;-) 谢谢
giorgio

命令
rake release
尝试将代码推送到远程存储库(隐式假设您正在使用git)并创建标记

在您的情况下,似乎没有为存储库配置git remote,任务失败

我个人不喜欢这样的任务。我倾向于使用

$ rake build
来构建包,然后

$ gem push pkg/...
向RubyGems发布宝石


如果您想使用
rake-release
我建议您覆盖默认实现以跳过/替换/自定义Git提交。

rake-release
将尝试在Git中标记您的gem并将其推送到远程。听起来您没有配置为在不指定遥控器的情况下执行
git push

尝试以下修复:
git-push-u原始主机


如果你能在这之后无误地执行
git-push
rake-release
应该也能正常工作,尽管如果你已经将gem推到了ruby-gems,你可能需要增加gem的版本号,因为我认为如果你试图发布同一版本的gem,ruby-gems会抱怨。

谢谢Simone。我也用gem推我。这个问题可能会再次被问到:如何将git remote设置为指向rubygems存储库?rubygems没有git存储库。你不能把回购协议指向RubyGems。任务是假设您正在git repo中对库进行版本控制,例如在GitHub或其他地方。
rake release
非常棒,可以自动执行您应该执行的操作——为每个版本在git中创建标记。仅供参考——我看到的错误输出消息建议运行
git push——设置上游源代码主版本,这同样有效(我认为这两个命令是等效的)。