ruby-on-rails - `test/dummy/config/application (LoadError)` when using `rails console` in a Rails engine
问题描述
After generating binstubs with rails app:update:bin
post Rails 5 upgrade rails console
now gives the error: test/dummy/config/application (LoadError)
.
解决方案
This is because the generated code in bin/rails
does not take in to account that RSpec is being used, which uses the spec
directory, not test
.
To fix open bin/rails
and change the APP_PATH
to point to the dummy app in the spec directory, i.e.
APP_PATH = File.expand_path('../../spec/dummy/config/application', __FILE__)