I\'m trying to deploy a rails 3 app to heroku for the first time. It seems to push up ok but when I try to run
heroku rake db:migrate
I get
for me, Simone’s first approach didn’t work, but the second did: require 'faker'
can be deleted from the rake file.
Move the require statement into the task. For instance
# sample_data.rake
require 'faker'
task :sample_data => :environment do
# ...
end
to
# sample_data.rake
task :sample_data => :environment do
require 'faker'
# ...
end
In this way, the library will be required only when the task is invoked.
The other alternative is to not require Faker in your rake file. In fact, it is already loaded by Bundler when the bundle is executed in development.
If you don't want Bundler to load the Gem, use
gem 'faker', '0.3.1', :require => false
I too commented out require 'faker' in the lib/tasks/sample_data.rake file and (After committing this change via git) pushed the files to heroku, which allowed
$heroku rake db:migrate --app <my app name>
to successfully execute, and ergo the heorku site began working again.
Thanks!