After heroku rake db:migrate
I get the following error:
rake aborted!
no such file to load -- faker
/app/Rakefile:7
(See full trace by running task with --trace)
(in /app)*
I saw previous answers and I tried to shift require 'faker'
from the first line to the line below task :populate => :environment do
in my sample_data.rake
file. It didn't work.
I commented faker
in the gemfile (and it was present only in the dev environment) and I executed a bundle install
. It didn't work.
I'm really scared about the fact that I can't use faker with heroku. Could you please help me?
Is faker
part of your production gems (outside of any groups) in your Gemfile?
Heroku does not install test
or development
gems by default.
So, you could, for example, simply change
source 'http://rubygems.org'
gem 'rails', '3.0.7'
gem 'sqlite3-ruby', :require => 'sqlite3'
gem 'mysql'
group :development do
gem 'faker'
end
to
source 'http://rubygems.org'
gem 'rails', '3.0.7'
gem 'sqlite3-ruby', :require => 'sqlite3'
gem 'mysql'
gem 'faker'
You can instruct Heroku to install development gems by changing the Heroku environment variable BUNDLE_WITHOUT
, which lists groups to exclude.
The default is:
heroku config:set BUNDLE_WITHOUT="development:test"
so you might use something like:
heroku config:set BUNDLE_WITHOUT="test"
However, if your application requires the use of faker
in its production environment, you should probably just include the gem in the default Gemfile group.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With