我想部署一個rails 3應用程序到heroku第一次。這似乎推OK,但是當我嘗試運行heroku rake db:migrate>沒有這樣的文件加載 - faker
heroku rake db:migrate
我收到以下錯誤:
rake aborted!
no such file to load -- faker
/app/98c71cc3-375f-4397-9de3-034dd7268be3/home/Rakefile:7
(See full trace by running task with --trace)
(in /app/98c71cc3-375f-4397-9de3-034dd7268be3/home)
這裏是我的Rakefile(7號線是最後一個):
require File.expand_path('../config/application', __FILE__)
require 'rake'
SampleApp::Application.load_tasks
現在我有一個名爲sample_data.rake的任務,它使用faker gem用示例數據填充開發數據庫,該任務包含以下行:
require 'faker'
在頂部必須是什麼導致問題。
我該如何解決這個錯誤,或者有沒有辦法讓我可以讓heroku忽略這個任務文件?無論如何,我不打算用無意義的樣本數據填充生產版本。
順便說一句,騙子只是在我gemsfile發展環境活動:
# gemfiles for the rspec testing environment
group :development do
gem 'rspec-rails', '2.5.0'
gem 'annotate-models', '1.0.4'
gem 'faker', '0.3.1'
end
第一個解決方案對我不起作用,但添加`:require => false`確實 – 2012-07-17 04:00:46