如何构建任务'gems:install'

ric*_*oss 4 linux deployment capistrano rubygems ruby-on-rails

我正在将我的rails应用程序部署到Linux服务器上,并且我有一些rake任务没有包含rake gems:install和rake db

我正在从GEM运行rails 2.3.4.

为什么是这样?

我该如何解决?我能以某种方式更新吗?


rake -T列表中缺少它们

rake apache2                   # Build Apache 2 module
rake clean                     # Remove compiled files
rake clobber                   # Remove all generated files
rake default                   # Build everything
rake doc                       # Generate all documentation
rake doxygen                   # Generate Doxygen C++ API documentation if ...
rake doxygen:clobber           # Remove generated Doxygen C++ API documenta...
rake doxygen:force             # Force generation of Doxygen C++ API docume...
rake fakeroot                  # Create a fakeroot, useful for building nat...
rake nginx                     # Build Nginx helper server
rake package                   # Build all the packages
rake package:clean             # Remove package products
rake package:debian            # Create a Debian package
rake package:force             # Force a rebuild of the package files
rake package:gem               # Build the gem file passenger-2.2.4.gem
rake rdoc                      # Build the rdoc HTML Files
rake rdoc:clobber              # Remove rdoc products
rake rdoc:force                # Force a rebuild of the RDOC files
rake sloccount                 # Run 'sloccount' to see how much code Passe...
rake test                      # Run all unit tests and integration tests
rake test:cxx                  # Run unit tests for the Apache 2 and Nginx ...
rake test:integration          # Run all integration tests
rake test:integration:apache2  # Run Apache 2 integration tests
rake test:integration:nginx    # Run Nginx integration tests
rake test:oxt                  # Run unit tests for the OXT library
rake test:rcov                 # Run coverage tests for the Ruby libraries
rake test:restart              # Run the 'restart' integration test infinit...
rake test:ruby                 # Run unit tests for the Ruby libraries
Run Code Online (Sandbox Code Playgroud)

我的rake文件包含这个:

# Add your own tasks in files placed in lib/tasks ending in .rake,
# for example lib/tasks/capistrano.rake, and they will automatically be available to Rake.

require(File.join(File.dirname(__FILE__), 'config', 'boot'))

require 'rake'
require 'rake/testtask'
require 'rake/rdoctask'

require 'tasks/rails'
Run Code Online (Sandbox Code Playgroud)

如何添加gems和db rake任务?他们为什么失踪?

小智 6

什么是输出rake -T?这应该列出所有可用的任务.在RoR应用程序中,Rakefile定义您的任务.

您可以使用更新宝石gem update.