2011-11-19 47 views
1

我正在使用Subversion和Capistrano部署我的Rails應用程序。該組織的一部分是將所有捆綁的寶石放在一個「共享」文件夾中,這樣應用程序就不必隨身攜帶它們並在每次部署時都安裝它們。捆綁寶石安裝在奇怪的位置

通常他們會根據/shared/bundle/,然後有不同的文件夾(寶石,規格等)。但是,由於某種原因,當我運行bundle install時,他們正在安裝到/shared/bundle/ruby/1.8

一些額外的信息:當我運行bundle install, 「成功」 行讀取:

你的包是完整的!它被安裝到/家庭/共享/束

額外的文件夾沒有提到,但唯一的文件夾bundle包含爲ruby目錄。

bundle config輸出:

frozen 
    Set for your local app (/home/myapp/current/.bundle/config): "1" 

disable_shared_gems 
    Set for your local app (/home/myapp/current/.bundle/config): "1" 

without 
    Set for your local app (/home/myapp/current/.bundle/config): "development:test" 

path 
    Set for your local app (/home/myapp/current/.bundle/config): "/home/myapp/shared/bundle" 

我沒有看到任何地方/ruby/1.8什麼。我可能會錯過什麼?當然,我可以將捆綁器路徑設置爲/shared/bundle/ruby/1.8,但我不喜歡作弊。

謝謝。

回答

2

Bundler根據Ruby引擎和版本將其「安裝」範圍「安裝到」該文件夾中。

https://github.com/carlhuda/bundler/blob/3431d6d/lib/bundler/settings.rb#L78

"#{path}/#{Bundler.ruby_scope}" 

Bundler.ruby_scopehttps://github.com/carlhuda/bundler/blob/3431d6d/lib/bundler.rb#L141-143定義:

def ruby_scope 
    "#{Bundler.rubygems.ruby_engine}/#{Gem::ConfigMap[:ruby_version]}" 
end 
+0

你是對的 - 我的目錄結構是正確的,我只是從一箇舊項目錯誤地記住了。謝謝! – bricker

0
bundle install --path=<path> 

docs

將寶石安裝到包中的位置。默認爲 寶石家,這是寶石安裝寶石的位置。 這意味着,默認情況下,未安裝--path設置 的gem將顯示在gem列表中。此設置是一個記住的選項。

+0

嗯,你跳過最後一行。你在使用RVM嗎? –

+0

運行'bundle install --path =/home/myapp/shared/bundle'仍然會將所有gem安裝到'/ shared/bundle/ruby​​/1.8'目錄。 – bricker

+0

不,我沒有使用RVM – bricker

相關問題