2012-10-11 47 views
0

我有一个最初是在Bamboo上的应用程序。我已经将它更新为Ruby 1.9并且摆脱了所有的依赖。我试图在Heroku上部署,但失败了。在Heroku Cedar上使用“bundle install --local”

-----> Heroku receiving push 
-----> Ruby/Rails app detected 
-----> Installing dependencies using Bundler version 1.2.1 
    Running: bundle install --without development:test --path vendor/bundle --binstubs bin/ 
    Fetching [email protected]:WaterfallFMS/deployment.git 
    Host key verification failed. 
    fatal: The remote end hung up unexpectedly 
    Git error: command `git clone '[email protected]:WaterfallFMS/deployment.git' "/tmp/build_2q1m86r0nc31g/vendor/bundle/ruby/1.9.1/cache/bundler/git/deployment-5959a7fb9f44c5cab5d6966441639b4e711bfc6b" --bare --no-hardlinks` in directory /tmp/build_2q1m86r0nc31g has failed. 

我跟踪下来到打捆不缓存git的回购协议(https://github.com/carlhuda/bundler/issues/67)。如果您使用“捆绑软件包 - 全部”标志,它是固定的。

问题是你必须使用“Bundle install --local”,否则它将在缓存之前引用git repo。我无法弄清楚如何强制heroku使用“--local”。

回答

1

bundle install命令是硬编码到the Ruby buildpack

# runs bundler to install the dependencies 
def build_bundler 
    log("bundle") do 
    bundle_without = ENV["BUNDLE_WITHOUT"] || "development:test" 
    bundle_command = "bundle install --without #{bundle_without} --path vendor/bundle --binstubs bin/" 
    # ... 
    bundle_command += " --deployment" 
    # ... 
    puts "Running: #{bundle_command}" 
    bundler_output << pipe("#{env_vars} #{bundle_command} --no-clean 2>&1") 

归根结底,这是痛苦的,因为你想从你的资料库之外的私人代码到你的蛞蝓,这意味着塞编译器必须能够以某种方式获取代码。正如我所看到的那样,您的选择是:

  1. 分叉构建包与bundle package一起使用。有关更多信息,请参见Buildpacks documentation
  2. Point Bundler到https://username:[email protected]/username/repo。是的,这些是明文凭证。是的,他们会进行源代码管理。
  3. 将代码放入公开回购。可能不是一个选项。
  4. 以另一种方式将代码放入您的Heroku回购。您可以自己供应外部代码(不使用Bundler)并手动将其添加到加载路径。
  5. 将代码放入私人宝石资料库。 Gemfury addon最近进入了测试版,并完成了这一步,但你可以使用任何你想要的私人回购。
+0

这种踢我​​自己甚至没有考虑使用私人宝石服务器。我可能最终会使用Gemfury作为一项全面的服务,因为我实际上需要10+个heroku部署,这些部署需要相同的一组私有宝石。 –

相关问题