每次执行bundle exec rake db:create
时,总是在终端中遇到此错误:
rake aborted!
LoadError: cannot load such file -- /Users/davidnoldner/Documents/GitHub/RatatamBot/rakefile/User/Documents/RatatamBot
/Users/davidnoldner/Documents/GitHub/RatatamBot/rakefile:1:in `require'
/Users/davidnoldner/Documents/GitHub/RatatamBot/rakefile:1:in `<top (required)>'
/Users/davidnoldner/.rvm/gems/ruby-head/gems/rake-12.3.1/exe/rake:27:in `<top (required)>'
/Users/davidnoldner/.rvm/gems/ruby-head/bin/ruby_executable_hooks:24:in `eval'
/Users/davidnoldner/.rvm/gems/ruby-head/bin/ruby_executable_hooks:24:in `<main>'
(See full trace by running task with --trace)
从昨天开始,我就一直坚持这一点,并且经常在Stackoverflow上寻找答案,但是没有找到与我的问题相匹配的解决方案。有点令人沮丧。我真的需要你的帮助。
Rakefile:
require File.expand_path('/Users/davidnoldner/Documents/GitHub/RatatamBot/rakefile', __FILE__)
require 'rake'
require 'resque/tasks'
+ # temp fix for NoMethodError: undefined method `last_comment'
+ # remove when fixed in Rake 11.x
+ module TempFixForRakeLastComment
+ def last_comment
+ last_description
+ end
+ end
+ Rake::Application.send :include, TempFixForRakeLastComment
+ ### end of temfix
+
task "resque:preload" => :environment
Rails.application.load_tasks