每当我尝试创建迁移时,都会收到以下错误。有谁知道是什么原因造成的?
$ rails generate migration NewMigration
/Users/myuser/.rvm/gems/ruby-2.1.4/bin/ruby_executable_hooks:15:in `eval': /Users/myuser/.rvm/gems/ruby-2.1.4/bin/rails:19: syntax error, unexpected '=', expecting keyword_end (SyntaxError) /Users/myuser/.rvm/gems/ruby 2.1.4/bin/rails:23: syntax error, unexpected end-of-input, expecting keyword_end
from /Users/myuser/.rvm/gems/ruby-2.1.4/bin/ruby_executable_hooks:15:in `<main>'
不知何故,您的垃圾箱/轨道文件被修改了。在之前使用的同一 rvm 中运行gem pristine -a
。这将重建/重新安装所有 gem 文件。