2010-09-08 28 views
4

我有這樣的線的Gemfile:Bundler,Rails3:如何在部署期間避免在測試組中使用邊緣寶石的git檢查?

group :test do 
    ... 
    gem 'cucumber', :git => "git://github.com/aslakhellesoy/cucumber.git" 
    ... 
end 

當我嘗試做通過bundle install --deployment --quiet --without development test部署在服務器上,我得到一個錯誤:

sh: git: command not found 
** An error has occurred in git when running `git clone "git://github.com/aslakhellesoy/cucumber.git" "/home/test/rails_apps/test_app/shared/bundle/ruby/1.8/cache/bundler/git/cucumber-3eb3f1a09813a1271fada66aac31d953ef2ad625" --bare --no-hardlinks. Cannot complete bundling. 

我對服務器沒有git的可執行文件。但我不想在測試組中使用git,而我使用「--without test」執行bundler!

我該怎麼辦?

回答

3

有沒有辦法做到這一點。因爲這是捆綁

Note that on bundle install, bundler downloads and evaluates all gems, in order to create a single canonical list of all of the required gems and their dependencies. This means that you cannot list different versions of the same gems in different groups. For more details, see Understanding Bundler.

http://gembundler.com/man/gemfile.5.html的特徵(見組部分)

什麼你沒有的Git或在您的服務器的任何寶石。你應該使用bundle pack。但是,現在bundle packdon't work with git。然後,你需要手動打包混帳來源:

cd vendor/git 
git clone git://github.com/foo/foo.git 

然後,在你的Gemfile,

gem "foo", :path => "vendor/git/foo"

http://github.com/carlhuda/bundler/issues/labels/git#issue/67