我有一个 Rails 3.2.8 应用程序,它在我的机器上运行良好,Postgres 作为 ActiveRecord 的数据库后端。但是,当我通过 capistrano 或通过将我的项目同步到 EC2 实例将代码部署到 EC2 服务器时,rake 不再列出任何db:
任务:
$ rake -T
rake about # List versions of all Rails frameworks and the environment
rake assets:clean # Remove compiled assets
rake assets:precompile # Compile all the assets named in config.assets.precompile
rake doc:app # Generate docs for the app -- also available doc:rails, doc:guides, doc:plugins (options: TEMPLATE=/rdoc-t...
rake load_gml # Load GML source files into the environment database
rake log:clear # Truncates all *.log files in log/ to zero bytes
rake middleware # Prints out your Rack middleware stack
rake notes # Enumerate all annotations (use notes:optimize, :fixme, :todo for focus)
rake notes:custom # Enumerate a custom annotation, specify with ANNOTATION=CUSTOM
rake rails:template # Applies the template supplied by LOCATION=(/path/to/template) or URL
rake rails:update # Update configs and some other initially generated files (or use just update:configs, update:scripts, or u...
rake routes # Print out all defined routes in match order, with names.
rake secret # Generate a cryptographically secure secret key (this is typically used to generate a secret for cookie se...
rake stats # Report code statistics (KLOCs, etc) from the application
rake test # Runs test:units, test:functionals, test:integration together (also available: test:benchmark, test:profil...
rake test:recent # Run tests for {:recent=>"test:prepare"} / Test recent changes
rake test:single # Run tests for {:single=>"test:prepare"}
rake test:uncommitted # Run tests for {:uncommitted=>"test:prepare"} / Test changes since last checkin (only Subversion and Git)
rake time:zones:all # Displays all time zones, also available: time:zones:us, time:zones:local -- filter with OFFSET parameter,...
rake tmp:clear # Clear session, cache, and socket files from tmp/ (narrow w/ tmp:sessions:clear, tmp:cache:clear, tmp:sock...
rake tmp:create # Creates tmp directories for sessions, cache, sockets, and pids
rake -P
也报告没有db:
任务。
我猜这是某种依赖问题,但我看不到那会是什么,因为我在 Bundler 中声明了我所有的 gem 依赖项Gemfile
。Postgres 9.2.1 已安装并正在运行,但即使不是,我也不明白为什么 rake 任务会消失。
任何关于正在发生的事情的线索都非常感激!