webpacker
webpacker copied to clipboard
binstubs should NOT honor the RACK_ENV environment variable in addition to the RAILS_ENV environment variable
See issue #773 and associated commit: https://github.com/rails/webpacker/commit/f0ce2a5e66f13cd2b562f71ec851f6f18c195121
When this works, it is by accident. The available values of RACK_ENV supported by Rack are development, deployment and none. Of these, only development is a common value of RAILS_ENV.
See: https://github.com/rack/rack/blob/master/lib/rack/server.rb#L180
I found this confusing when debugging an unrelated issue.
This seems reasonable.
@saltvedt would you like to submit a PR on this?
CC: @guillaumebriday
Here's the documentation.
https://github.com/rack/rack/blob/master/lib/rack/server.rb#L184-L190
# * :environment
# this selects the middleware that will be wrapped around
# your application. Default options available are:
# - development: CommonLogger, ShowExceptions, and Lint
# - deployment: CommonLogger
# - none: no extra middleware
def default_options
environment = ENV['RACK_ENV'] || 'development'
default_host = environment == 'development' ? 'localhost' : '0.0.0.0'