rake db:migrate doesn't work after ruby 2.2.2 to 2.2.3 upgrade via RVM

安稳与你 提交于 2019-12-07 02:44:33

问题


I recently upgraded from Ruby 2.2.2 to 2.2.3 using RVM. This messed up some things in my development environment but I could handle it so far thanks to useful error messages.

Now I wanted to add some migrations to my DB and encountered this error:

$ rake db:migrate
/Users/howard/.rvm/gems/ruby-2.2.3/bin/ruby_executable_hooks:15:in `eval': /Users/howard/.rvm/rubies/ruby-2.2.3/bin/rake:4: syntax error, unexpected tSTRING_BEG, expecting keyword_do or '{' or '(' (SyntaxError)
exec "$bindir/ruby" -x "$0" "$@"
                        ^
    from /Users/howard/.rvm/gems/ruby-2.2.3/bin/ruby_executable_hooks:15:in `<main>'

Any help is very appreciated.

I thought RVM prevents stuff like this from happening?

I use the latest versions of OS X, Ruby and Rails.

Thanks a lot in advance!


回答1:


I had the same issue today and resolved it with the following commands:

rvm uninstall 2.2.3

rvm install 2.2.3

rvm use 2.2.3 --default

gem install bundler

bundle install

You may also want to select a gemset before you run the last two with:

rvm gemset create your_gemset_name

rvm use 2.2.3@your_gemset_name

For whatever reason, the reinstall seemed to fix everything



来源:https://stackoverflow.com/questions/32186242/rake-dbmigrate-doesnt-work-after-ruby-2-2-2-to-2-2-3-upgrade-via-rvm

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