0
我試圖找出爲什麼我非環境耙的任務,如:當我運行「耙路線」,或任何耙的任務,它總是加載我的環境中第一
rake routes
需要很長時間跑。它加載我的應用程序的複雜環境需要一分多鐘。這是一個Rails應用程序2.3.12,而我的Rakefile如下:
# Add your own tasks in files placed in lib/tasks ending in .rake,
# for example lib/tasks/switchtower.rake, and they will automatically be available to Rake.
require 'thread'
require(File.join(File.dirname(__FILE__), 'config', 'boot'))
require 'rake'
require 'rake/testtask'
require 'rdoc/task'
require 'delayed/tasks'
require 'tasks/rails'
它只是不會那麼快。你有沒有試過[rake-sh](https://github.com/jugyo/rake-sh)? – 2012-08-01 14:05:00
另外,'rake routes'不是非環境任務:https://github.com/rails/rails/blob/2-3-stable/railties/lib/tasks/routes.rake – BaronVonBraun 2012-08-01 14:07:12