最近我开始在ruby on rails项目中工作。这是一个非常古老的项目。我是这项技术的初学者。请引导我。我的Gemfile包含

source 'https://rubygems.org'

gem 'rails', '3.2.17'
gem 'xmlrpc'
# Bundle edge Rails instead:
# gem 'rails', :git => 'git://github.com/rails/rails.git'

#gem 'mysql2', '0.3.11'
gem 'maxminddb', '~> 0.1.8'
gem 'rake', '10.1.0'
gem 'mysql', '2.9.1'
gem 'domainatrix', '0.0.11'
gem 'addressable', '2.3.5'
gem 'guid', '0.1.1'
gem 'json'
gem 'ystock', '0.4.5'
gem 'httparty', '0.10.2'
gem 'fastercsv', '1.5.5'
#gem 'fog', '1.18.0'
gem 'aws-s3', '0.6.3', :require => 'aws/s3'
gem 'builder', '3.0.4'
gem 'mime-types', '1.25'
gem 'xml-simple', '1.1.2'
# gem 'newrelic_rpm', '3.7.3.199'
gem 'newrelic_rpm', '~> 3.15', '>= 3.15.0.314'
gem 'redis', '3.0.6'
gem 'redis-store', '1.1.4'
gem 'redis-rails', '3.2.4'
gem 'dalli', '2.6.4'
gem 'rack-uri_sanitizer'

gem 'whenever', :require => false

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

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

gem 'uglifier'
end

gem 'jquery-rails'
gem 'unf'

group :development do
gem 'ruby-prof'
gem 'thin',  '1.3.1'

#pimp out your dev environment if these cause you issues you can
comment them out.
gem 'annotate'
gem 'quiet_assets'
#gem 'better_errors'
gem 'binding_of_caller'
gem 'letters'
gem 'meta_request' # for RailsPanel:
https://github.com/dejan/rails_panel

# let guard listen for file changes on linux, mac, and windows
gem 'rb-inotify', :require => false
gem 'rb-fsevent', :require => false
gem 'rb-fchange', :require => false

# Get growl notifications from Guard
# Be sure to turn on Network to "Listen for incoming notifications"
# Growl (Mac): http://growl.info/
# Growl for Windows: http://www.growlforwindows.com/gfw/
# Growl for Linux: http://mattn.github.com/growl-for-linux/
#gem 'ruby_gntp' if guard_notifications

gem 'guard'
gem 'guard-bundler'
gem 'guard-cucumber'
gem 'guard-rspec'
# gem 'guard-unicorn'
gem 'guard-livereload'
gem 'rack-livereload'

gem 'term-ansicolor'
gem 'pry-rails' #saves history in your rails console
gem 'rails-erd'
end
# Deploy with Capistrano
gem 'rvm-capistrano'
gem 'capistrano', '~>2.15.4'
gem 'tinder', '1.9.4'
gem 'chef'
gem 'knife-ec2'
gem 'capistrano-chef'


group :staging do
 gem 'ruby-prof'
end

# To use ActiveModel has_secure_password
# gem 'bcrypt-ruby', '~> 3.0.0'

# To use Jbuilder templates for JSON
# gem 'jbuilder'

# Use unicorn as the app server
# gem 'unicorn'

# Deploy with Capistrano
# gem 'capistrano'

# To use debugger
# gem 'debugger'
gem 'ruby-xxHash', '~> 0.3.0'

在完成bundle install之后。我正试着去做
RAILS_ENV=development bundle exec rake cache:generate

但是,我犯了错误,
rake aborted!
Please require this file from within a Capistrano recipe
/Users/sireesha/.rvm/gems/ruby-1.9.3-p551/gems/capistrano-
2.15.9/lib/capistrano/configuration/loading.rb:18:in `instance'
/Users/sireesha/.rvm/gems/ruby-1.9.3-p551/gems/rvm-capistrano-
1.5.6/lib/rvm/capistrano/helpers/base.rb:16:in `rvm_with_capistrano'
/Users/sireesha/.rvm/gems/ruby-1.9.3-p551/gems/rvm-capistrano-
1.5.6/lib/rvm/capistrano/helpers/_cset.rb:3:in `<top (required)>'
/Users/sireesha/.rvm/gems/ruby-1.9.3-p551/gems/rvm-capistrano-
1.5.6/lib/rvm/capistrano/base.rb:1:in `require'
/Users/sireesha/.rvm/gems/ruby-1.9.3-p551/gems/rvm-capistrano-
1.5.6/lib/rvm/capistrano/base.rb:1:in `<top (required)>'
/Users/sireesha/.rvm/gems/ruby-1.9.3-p551/gems/rvm-capistrano-
1.5.6/lib/rvm/capistrano/selector.rb:1:in `require'
/Users/sireesha/.rvm/gems/ruby-1.9.3-p551/gems/rvm-capistrano-
1.5.6/lib/rvm/capistrano/selector.rb:1:in `<top (required)>'
/Users/sireesha/.rvm/gems/ruby-1.9.3-p551/gems/rvm-capistrano-
1.5.6/lib/rvm/capistrano.rb:3:in `require'
/Users/sireesha/.rvm/gems/ruby-1.9.3-p551/gems/rvm-capistrano-
1.5.6/lib/rvm/capistrano.rb:3:in `<top (required)>'
/Users/sireesha/.rvm/gems/ruby-1.9.3-p551/gems/bundler-
1.15.4/lib/bundler/runtime.rb:96:in `require'
/Users/sireesha/.rvm/gems/ruby-1.9.3-p551/gems/bundler-
1.15.4/lib/bundler/runtime.rb:96:in `rescue in block in require'
/Users/sireesha/.rvm/gems/ruby-1.9.3-p551/gems/bundler-
1.15.4/lib/bundler/runtime.rb:73:in `block in require'
/Users/sireesha/.rvm/gems/ruby-1.9.3-p551/gems/bundler-
1.15.4/lib/bundler/runtime.rb:66:in `each'
/Users/sireesha/.rvm/gems/ruby-1.9.3-p551/gems/bundler-
1.15.4/lib/bundler/runtime.rb:66:in `require'
/Users/sireesha/.rvm/gems/ruby-1.9.3-p551/gems/bundler-
1.15.4/lib/bundler.rb:108:in `require'
/Users/sireesha/Desktop/config/application.rb:8:in `<top
(required)>'
/Users/sireesha/Desktop/Rakefile:5:in `require'
/Users/sireesha/Desktop/Rakefile:5:in `<top (required)>'
/Users/sireesha/.rvm/gems/ruby-1.9.3-
p551/bin/ruby_executable_hooks:15:in `eval'
/Users/sireesha/.rvm/gems/ruby-1.9.3-
p551/bin/ruby_executable_hooks:15:in `<main>'
(See full trace by running task with --trace)

我使用的是非常老的ruby版本。但是,我没有升级的选择。那么有办法解决这个问题吗?请引导我。这是我第一次看到1.9.3。谢谢您。

最佳答案

参阅Please require this file from within a Capistrano recipe (LoadError)
另外,您应该对gems进行分组,这样就不会部署(和加载!)根据生产环境开发和测试库。
例如,与Capistrano&Guard相关的所有内容都应位于group :development块中。

07-26 08:10