这个问题和特定的rake版本有关,因为Rails要使用rake的last_comment方法在较新版本的rake中已被废弃,所以很多人卸载了新版本的rake去安装旧版本的rake.
这样也能解决问题,但显然用旧的东西感觉不那么好.
好在你遇到的是ruby语言,所以没有什么不可能了,我们只需要写一个模块然后包装last_comment方法到rake中对应的新方法中即可,打开Rakefile,在其中新建一个module,最后将其include进来即可:
module TempFixForRakeLastComment
def last_comment
last_description
end
end
Rake::Application.send :include, TempFixForRakeLastComment
如果你觉得太神奇,那么你是out了,动态语言必须是这么玩滴… ;)