2013-04-12 27 views
2

我想我的生產中我的gemfile有一些問題,因爲它與我的開發不同,我認爲這會導致我的部署(Capistrano)失敗,至少在安裝bundle時至少兩個版本的生產軌道部署中的寶石

發展

actionmailer (3.2.3) 
actionpack (3.2.3) 
activemodel (3.2.3) 
activerecord (3.2.3) 
activeresource (3.2.3) 
activesupport (3.2.3) 
arel (3.0.2) 
bcrypt-ruby (3.0.1) 
builder (3.0.4) 
bundler (1.3.4) 
capistrano (2.14.2, 2.12.0) 
climate_control (0.0.3) 
cocaine (0.5.1, 0.2.1) 
coffee-rails (3.2.2) 
coffee-script (2.2.0) 
coffee-script-source (1.6.2, 1.3.3) 
commonjs (0.2.6) 
daemon_controller (1.1.2, 1.0.0) 
daemons (1.1.9) 
database_cleaner (0.9.1, 0.8.0) 
devise (2.2.3) 
diff-lcs (1.2.2, 1.1.3) 
erubis (2.7.0) 
eventmachine (1.0.0) 
execjs (1.4.0) 
fastthread (1.0.7) 
ffi (1.6.0, 1.3.1) 
font-awesome-rails (3.0.2.0) 
highline (1.6.16, 1.6.13) 
hike (1.2.1) 
i18n (0.6.4, 0.6.1) 
journey (1.0.4) 
jquery-rails (2.2.1, 2.0.2) 
json (1.7.7, 1.7.6) 
less (2.3.1, 2.2.1) 
less-rails (2.3.2, 2.2.3) 
libv8 (3.11.8.17 x86_64-linux, 3.3.10.4 x86_64-linux) 
listen (0.7.3, 0.7.2) 
mail (2.4.4) 
mime-types (1.22, 1.19) 
multi_json (1.7.2, 1.5.0) 
mysql2 (0.3.11) 
nested_form (0.3.1, 0.3.0) 
net-scp (1.1.0, 1.0.4) 
net-sftp (2.1.1, 2.0.5) 
net-ssh (2.6.6, 2.5.2) 
net-ssh-gateway (1.2.0, 1.1.0) 
orm_adapter (0.4.0) 
paperclip (3.4.1, 3.1.4) 
passenger (3.0.19, 3.0.14) 
polyglot (0.3.3) 
rack (1.4.5, 1.4.4) 
rack-cache (1.2) 
rack-ssl (1.3.3) 
rack-test (0.6.2) 
rails (3.2.3) 
railties (3.2.3) 
rake (10.0.4, 10.0.3) 
rb-inotify (0.9.0, 0.8.8) 
rb-readline (0.4.2) 
rdoc (3.12.2, 3.12) 
ref (1.0.4) 
rmagick (2.13.2, 2.13.1) 
rspec (2.11.0) 
rspec-core (2.13.1, 2.11.1) 
rspec-expectations (2.13.0, 2.11.1) 
rspec-mocks (2.13.0, 2.11.1) 
rspec-rails (2.13.0, 2.11.0) 
rubygems-bundler (1.1.1) 
rvm (1.11.3.6) 
sass (3.2.7, 3.1.20) 
sass-rails (3.2.6, 3.2.5) 
sprockets (2.1.3) 
therubyracer (0.11.4, 0.10.1) 
thor (0.14.6) 
tilt (1.3.6, 1.3.3) 
treetop (1.4.12, 1.4.10) 
twitter-bootstrap-rails (2.2.6, 2.1.1) 
tzinfo (0.3.37, 0.3.33) 
uglifier (1.3.0, 1.2.6) 
warden (1.2.1) 
will_paginate (3.0.4) 

生產

actionmailer (3.2.3) 
actionpack (3.2.3) 
activemodel (3.2.3) 
activerecord (3.2.3) 
activeresource (3.2.3) 
activesupport (3.2.3) 
arel (3.0.2) 
bcrypt-ruby (3.0.1) 
builder (3.0.4) 
bundler (1.1.4, 1.1.3) 
capistrano (2.12.0) 
cocaine (0.2.1) 
coffee-rails (3.2.2) 
coffee-script (2.2.0) 
coffee-script-source (1.3.3) 
commonjs (0.2.6) 
daemon_controller (1.0.0) 
daemons (1.1.9) 
database_cleaner (0.8.0) 
devise (2.2.3) 
diff-lcs (1.1.3) 
erubis (2.7.0) 
eventmachine (1.0.0) 
execjs (1.4.0) 
fastthread (1.0.7) 
ffi (1.3.1) 
font-awesome-rails (3.0.2.0) 
highline (1.6.13) 
hike (1.2.1) 
i18n (0.6.1) 
journey (1.0.4) 
jquery-rails (2.0.2) 
json (1.7.6) 
less (2.2.1) 
less-rails (2.2.3) 
libv8 (3.3.10.4 x86_64-linux) 
listen (0.7.2) 
mail (2.4.4) 
mime-types (1.19) 
multi_json (1.5.0) 
mysql2 (0.3.11) 
nested_form (0.3.0) 
net-scp (1.0.4) 
net-sftp (2.0.5) 
net-ssh (2.5.2) 
net-ssh-gateway (1.1.0) 
orm_adapter (0.4.0) 
paperclip (3.1.4) 
passenger (3.0.14) 
pg (0.14.1) 
polyglot (0.3.3) 
rack (1.4.4) 
rack-cache (1.2) 
rack-ssl (1.3.3) 
rack-test (0.6.2) 
rails (3.2.3) 
railties (3.2.3) 
rake (10.0.3, 0.9.2.2) 
rb-inotify (0.8.8) 
rb-readline (0.4.2) 
rdoc (3.12) 
rmagick (2.13.1) 
rspec (2.11.0) 
rspec-core (2.11.1) 
rspec-expectations (2.11.1) 
rspec-mocks (2.11.1) 
rspec-rails (2.11.0) 
rubygems-bundler (1.0.3, 1.0.2) 
rvm (1.11.3.5, 1.11.3.3) 
sass (3.1.20) 
sass-rails (3.2.5) 
sprockets (2.1.3) 
therubyracer (0.10.1) 
thin (1.5.0) 
thor (0.14.6) 
tilt (1.3.3) 
treetop (1.4.10) 
twitter-bootstrap-rails (2.1.1) 
tzinfo (0.3.33) 
uglifier (1.2.6) 
warden (1.2.1) 

的Gemfile

source 'https://rubygems.org' 

gem 'rails', '3.2.3' 
gem 'mysql2' 

#Devise Gem 
gem "devise", "~> 2.2.3" 

#for uploading files 
gem "paperclip", "~> 3.0" 
gem 'rmagick' 

#Nested Form 
gem "nested_form" 

#need this for rails 3 
gem 'rb-readline' 

#Pagination 
gem 'will_paginate', '~> 3.0.0' 

# Gems used only for assets and not required 
# in production environments by default. 
group :assets do 
    gem 'sass-rails', '~> 3.2.3' 
    gem 'coffee-rails', '~> 3.2.1' 
    gem 'less-rails' 

    # See https://github.com/sstephenson/execjs#readme for more supported runtimes 
    # gem 'therubyracer', :platform => :ruby 

    gem 'uglifier', '>= 1.0.3' 
end 

#js stuff: 
gem 'execjs' 
gem 'jquery-rails' 
gem 'twitter-bootstrap-rails' 

gem "font-awesome-rails" 

#gem to allow running on ubuntu server 
gem 'therubyracer' 


group :development do 
    gem 'rails-dev-boost', :git => 'git://github.com/thedarkone/rails-dev-boost.git', :require => 'rails_development_boost' 
    gem 'rb-inotify', '~> 0.8.8' 
end 


group :test, :development do 
    gem 'rspec-rails' 
    #adding database cleaner for tests 
    gem 'database_cleaner' 
end 
# To use ActiveModel has_secure_password 
# gem 'bcrypt-ruby', '~> 3.0.0' 
group :production do 
    gem 'thin' 
    gem 'pg' 
end 

# Deploy with Capistrano 
    gem 'capistrano' 

#run with passenger 
    gem 'passenger' 

我得到的問題是部署應用程序時找不到will_paginate gem。我是否正確地說,它看起來像我有兩個gemsets試圖在這裏工作?我不是十分清楚,不想搞糟我的生產環境,因此認爲最好讓這一個

+0

你部署了capistrano嗎? – MikDiet

+0

是的,我做了,生病添加到問題 – Richlewis

+0

你有'require「bundler/capistrano」'在你的帽子食譜? – MikDiet

回答

1

如果它在您的機器的開發環境中工作,那麼我認爲您應該將Gemfile.lock與您的代碼一起推送並部署應用程序。然後,在您的生產環境中「捆綁安裝」也會安裝與開發環境中相同的gem版本。

+0

以及我的生產環境Gemfile.lock有will_paginate,所以我應該只在生產中運行bundle install?對所有問題抱歉 – Richlewis

+0

它在版本庫的Gemfile.lock中列出了哪個版本?如果您使用的是gemset,請刪除gemset,創建一個名稱相同的新gemset,安裝bundler並運行bundle install。如果有必要,你可以修復你的will_paginate gem版本爲'3.0.4'(這是給出錯誤,保留爲'> 3.0.0')。 – Prem

+0

好,所以我所做的是在生產中指定了一個gemset,所以rvm使用@global然後運行bundle install,似乎現在工作,猜測將不得不等待,直到我再次部署以查看是否有任何失敗 – Richlewis

1

你需要一些建議你deploy.rb

require "bundler/capistrano" 

set :bundle_cmd, '/path/to/bundle' 

所以打捆會自動安裝所有必要的寶石。

否則,您需要手動完成。

+0

謝謝,愚蠢的問題,路徑/到/束這通常是在哪裏?即什麼是路徑/到/束?/Gemfile – Richlewis

+0

一些例子:'/ home/user/.rbenv/shims/bundle','/ home/user/.gems/bin/bundle' – MikDiet

+0

沒有任何東西看起來像那樣,不是我能看見的。現在是手動方式嗎? – Richlewis