> rake db:migrate --trace
rake aborted!
NameError: undefined local variable or method `__dir__' for main:Object
F:/OpenServer/domains/localhost/webrails/config/boot.rb:1:in `<top (required)>' F:/OpenServer/domains/localhost/webrails/config/application.rb:1:in `require_relative'
F:/OpenServer/domains/localhost/webrails/config/application.rb:1:in `<top (required)>'
F:/OpenServer/domains/localhost/webrails/Rakefile:4:in `require_relative'
F:/OpenServer/domains/localhost/webrails/Rakefile:4:in `<top (required)>'
C:/Ruby19/lib/ruby/gems/1.9.1/gems/rake-12.0.0/lib/rake/rake_module.rb:28:in `load'
C:/Ruby19/lib/ruby/gems/1.9.1/gems/rake-12.0.0/lib/rake/rake_module.rb:28:in `load_rakefile'
C:/Ruby19/lib/ruby/gems/1.9.1/gems/rake-12.0.0/lib/rake/application.rb:687:in `raw_load_rakefile'
C:/Ruby19/lib/ruby/gems/1.9.1/gems/rake-12.0.0/lib/rake/application.rb:96:in `block in load_rakefile'
C:/Ruby19/lib/ruby/gems/1.9.1/gems/rake-12.0.0/lib/rake/application.rb:178:in `standard_exception_handling'
C:/Ruby19/lib/ruby/gems/1.9.1/gems/rake-12.0.0/lib/rake/application.rb:95:in `load_rakefile'
C:/Ruby19/lib/ruby/gems/1.9.1/gems/rake-12.0.0/lib/rake/application.rb:79:in `block in run'
C:/Ruby19/lib/ruby/gems/1.9.1/gems/rake-12.0.0/lib/rake/application.rb:178:in `standard_exception_handling'
C:/Ruby19/lib/ruby/gems/1.9.1/gems/rake-12.0.0/lib/rake/application.rb:77:in `run'
C:/Ruby19/lib/ruby/gems/1.9.1/gems/rake-12.0.0/exe/rake:27:in `<top (required)>'
C:/Ruby19/bin/rake:23:in `load'
C:/Ruby19/bin/rake:23:in `<main>'
我使用 openserver 和 win10
轨道 -v 轨道 5.0.1
宝石-v 1.8.24
耙耙中止!
__dir__
他抱怨的方法在 Ruby 1.9 中缺失了。一般来说,Rails 5 至少需要 2.2.2 版的 Ruby。
更新。