2012-10-11 41 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部署,這些部署需要相同的一組私有寶石。 –

相關問題