2011-11-19 48 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

相关问题