简体   繁体   中英

LoadError: cannot load such file — ffaker

Please forgive my ignorance. I'm having issues raking my database on heroku. When I run :

heroku run rake db:migrate

I get

rake aborted!
LoadError: cannot load such file -- ffaker
/app/vendor/bundle/ruby/1.9.1/gems/activesupport-4.1.7/lib/active_support/depend
encies.rb:247:in `require'
/app/vendor/bundle/ruby/1.9.1/gems/activesupport-4.1.7/lib/active_support/depend
encies.rb:247:in `block in require'
/app/vendor/bundle/ruby/1.9.1/gems/activesupport-4.1.7/lib/active_support/depend
encies.rb:232:in `load_dependency'
/app/vendor/bundle/ruby/1.9.1/gems/activesupport-4.1.7/lib/active_support/depend
encies.rb:247:in `require'
/app/lib/tasks/seed.rake:1:in `<top (required)>'
/app/vendor/bundle/ruby/1.9.1/gems/activesupport-4.1.7/lib/active_support/depend
encies.rb:241:in `load'
/app/vendor/bundle/ruby/1.9.1/gems/activesupport-4.1.7/lib/active_support/depend
encies.rb:241:in `block in load'
/app/vendor/bundle/ruby/1.9.1/gems/activesupport-4.1.7/lib/active_support/depend
encies.rb:232:in `load_dependency'
/app/vendor/bundle/ruby/1.9.1/gems/activesupport-4.1.7/lib/active_support/depend
encies.rb:241:in `load'
/app/vendor/bundle/ruby/1.9.1/gems/railties-4.1.7/lib/rails/engine.rb:654:in `bl
ock in run_tasks_blocks'
/app/vendor/bundle/ruby/1.9.1/gems/railties-4.1.7/lib/rails/engine.rb:654:in `ea
ch'
/app/vendor/bundle/ruby/1.9.1/gems/railties-4.1.7/lib/rails/engine.rb:654:in `ru
n_tasks_blocks'
/app/vendor/bundle/ruby/1.9.1/gems/railties-4.1.7/lib/rails/application.rb:384:i
n `run_tasks_blocks'
/app/vendor/bundle/ruby/1.9.1/gems/railties-4.1.7/lib/rails/engine.rb:449:in `lo
ad_tasks'
/app/vendor/bundle/ruby/1.9.1/gems/railties-4.1.7/lib/rails/railtie.rb:194:in `p
ublic_send'
/app/vendor/bundle/ruby/1.9.1/gems/railties-4.1.7/lib/rails/railtie.rb:194:in `m
ethod_missing'
/app/Rakefile:6:in `<top (required)>'
(See full trace by running task with --trace)

I've tried following the solutions from heroku rake db:migrate > no such file to load -- faker with no luck. I really am not sure where else to go from here. I would greatly appreciate any help. Thanks.

您应该在代码中指定此代码:

require 'ffaker'

Also, make sure you have ffaker in the right gem group. I was setting up a staging environment and wanted to load dummy data and forgot ffaker was only in development and testing environment groups.

I was using the git URL to add ffaker in my Gemfile. I removed this URL, run bundle again and everything works ok now.

-  gem 'ffaker', '~>2.10.0', git: 'https://github.com/ffaker/ffaker.git'
+  gem 'ffaker', '~>2.10.0'

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM