0

我有一个由 Geminabox 运行的私人 gemserver。要在那里发布任何 gem,有一个命令gem inabox my-gem.gem -g $HOST

我正在编写用于自动发布新 gem 版本的脚本。

所以我有类似的东西:

`gem install geminabox --no-ri --no-rdoc`
`gem inabox my-super-gem.gem`

问题是它返回以下内容:

Successfully installed reentrant_flock-0.1.0
Successfully installed multipart-post-2.0.0
Successfully installed faraday-0.13.1
Successfully installed nesty-1.0.2
Successfully installed httpclient-2.8.3
Successfully installed builder-3.2.3
Successfully installed mustermann-1.0.1
Successfully installed rack-2.0.3
Successfully installed rack-protection-2.0.0
Successfully installed tilt-2.0.8
Successfully installed sinatra-2.0.0
Successfully installed geminabox-0.13.9
12 gems installed
ERROR:  While executing gem ... (Gem::CommandLineError)
    Unknown command inabox

当我在控制台中手动执行相同操作时,一切正常。如果我将这些命令放入.sh脚本中也是一样的:

#!/bin/bash
set -e
gem install geminabox --no-ri --no-rdoc
gem inabox -g $RUBYGEMS_HOST my-awesome.gem

但是,再一次,如果我从 ruby​​ 调用这个脚本,它不会出现同样的错误(Unknown command inabox):

system('script/upload_gem.sh')

我需要完全使用 Ruby 中的脚本。任何想法为什么它不起作用?

4

1 回答 1

0

毕竟,我解决了挖掘gemianboxgem 的问题 - 似乎它通过简单的 POST 请求上传 gem,所以gem inabox根本不需要命令,上传可以通过简单的 CURL 命令实现:

curl -F 'file=@/some/file.gem' https://some.host/upload

于 2017-11-03T08:24:35.473 回答