Cannot generate any migrations for Rails 4.2, Ruby 2.1.4. Syntax error in bin/rails

三世轮回 提交于 2019-12-25 01:09:03

问题


Whenever I try to create a migration, I get the following error. Does anyone know what could be causing this?

$ 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>'

回答1:


Somehow your bin/rails file got modified. Run gem pristine -a in the same rvm you were using before. This rebuilds / reinstalls all your gem files.



来源:https://stackoverflow.com/questions/29020913/cannot-generate-any-migrations-for-rails-4-2-ruby-2-1-4-syntax-error-in-bin-ra

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!