Ruby on rails 生产rails部署中的两个gems版本

Ruby on rails 生产rails部署中的两个gems版本,ruby-on-rails,ruby-on-rails-3,deployment,gemfile,gemset,Ruby On Rails,Ruby On Rails 3,Deployment,Gemfile,Gemset,我认为我的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

我认为我的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。我说我有两颗宝石在这里工作,对吗?我不太确定,不想打乱我的生产环境,所以我认为最好在部署.rb中获得一些建议

require "bundler/capistrano"

set :bundle_cmd, '/path/to/bundle'
因此bundler将自动安装所有必要的gems


否则,您需要手动执行此操作

如果它在您的计算机的开发环境中工作,那么我认为您应该将
Gemfile.lock
与您的代码一起推送并部署应用程序。然后,在您的生产环境中安装捆绑包也会安装与您的开发环境中相同的gems版本。

您使用capistrano部署了吗?是的,我会将这一点添加到问题中您的cap配方中是否需要“bundler/capistrano”,出现错误找不到bundler,我如何才能使我的produciton gemset与开发的gemset匹配,这可能会解决我相信这里也会问的问题:您的
Gemfile
是什么样子的?谢谢,愚蠢的问题,路径/到/bundle通常在哪里?即路径/目的地/包是什么/Gemfiles一些例子:
/home/user/.rbenv/shimmes/bundle
/home/user/.gems/bin/bundle
没有任何看起来像那样的东西,我看不到。现在手动方式是什么?在我的应用程序的根目录中挂起我有/.bundle/config,配置文件中是这个--bundle\u没有:产品这不正确吗?好,当我在生产环境中查看时,我有一个共享文件夹,但在任何地方都没有对bundle的引用,或者删除上面的文件夹是否解决了此问题?在我的生产环境中,Gemfile.lock将进行分页,所以我应该在生产环境中运行bundle install吗?很抱歉,在存储库的Gemfile.lock中列出了它的版本?如果您正在使用gemset,请删除gemset,创建一个同名的新gemset,安装bundler并运行bundle安装。如有必要,您可以将您的will_paginate gem版本修复为“3.0.4”(这是一个错误,保留为“>3.0.0”)。好的,所以我所做的是在生产中指定了一个gemset,所以rvm use@global然后运行bundle安装,现在似乎可以工作了,猜测将不得不等到我再次部署,看看是否有任何失败