2011-04-15 24 views
4

我想安裝一個具有某種身份驗證的私有Ruby gem服務器。我希望能夠使用公共Ubuntu服務器託管內部寶石。具有身份驗證的私有Ruby Gem服務器

我讀了約http://docs.rubygems.org/read/chapter/18。但是,我沒有看到那個驗證碼。

然後我讀了約https://github.com/cwninja/geminabox。但是,當我使用基本身份驗證(他們在Wiki中)時,它抱怨從我的服務器獲取源。

所以。我如何使用身份驗證製作私人Ruby gem服務器?這是不可能的嗎?

謝謝。

編輯:

Geminabox問題。我嘗試「捆綁」安裝新的寶石......但它給了我這個錯誤:

AGs-MacBook-Pro:super_app AG$ bundle

Fetching source index for http:// rubygems.org/

Fetching source index for http:// localhost:9292/

Could not reach rubygems repository http:// rubygems.org/, http:// localhost:9292/

Could not find aglipsum-0.0.1 in any of the sources

而「aglipsum」是我定製的寶石。但是,當我沒有基本的身份驗證,它的作品。

回答

2

您是否嘗試過前綴的源URL與您的基本身份驗證憑據:

gem sources -a http://user:[email protected]:9292 

這對我的作品與Apache +通勤設置。

4

一些專業的二進制庫管理人員,如Artifactory,支持民營RubyGems的倉庫。

1

Bundler 1.6版增加了對通過bundle config的HTTP驗證的支持。

+0

從1.5.1升級到1.7.x解決了我用geminabox + auth的問題。 – turboladen 2014-11-20 00:58:40

0

部署私有的RubyGems庫

您可以從geminabox泊塢窗圖像輕鬆地設置私人的RubyGems庫:

docker run -d -v /path_where_to_store_gems:/webapps/geminabox/data --name geminabox -p 9292:9292 -P -h geminabox -e PRIVATE=true -e USERNAME=myuser -e PASSWORD=mypassword spoonest/geminabox:latest 

不要忘了更改:

  • /path_where_to_store_gems - 路徑在本地機器,你想存儲你的寶石
  • myuser - 用戶名
  • mypassword - 密碼

這就是全部。您的倉庫是URL訪問http://YOUR_HOST:9292

安裝寶石形成私人倉庫在你Gemfile頂部

添加以下行:

source 'http://myuser:[email protected]_HOST:9292' 

...並使用bundle install如常。