You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In v3.6.0, the DSL supported an import method to load another config file within a given file. We use this to have a default.rb that gets loaded into each of our environments, which have environment-specific config in development.rb, production.rb, etc.
This method was removed in #1234 without any obvious explanation. There is a load method, but that doesn't load the file immediately (or at all?) the way that import does:
# config/puma/development.rbload'default'puts'Should not get here'# config/puma/default.rbraise'Raising from default.rb'
$ bundleexecpuma -edevelopmentShould not getherePumastartinginsinglemode...
# ...
With import instead of load:
# config/puma/development.rbimport'default'puts'Should not get here'# config/puma/default.rbraise'Raising from default.rb'
$ bundleexecpuma -edevelopmentRuntimeError: Raisingfromdefault.rbconfig/puma/default.rb:1:in`_load_from' /Users/brandan/repos/baseline/vendor/bundle/ruby/2.5.0/gems/puma-3.6.0/lib/puma/dsl.rb:26:in `instance_eval' /Users/brandan/repos/baseline/vendor/bundle/ruby/2.5.0/gems/puma-3.6.0/lib/puma/dsl.rb:26:in `_load_from'/Users/brandan/repos/baseline/vendor/bundle/ruby/2.5.0/gems/puma-3.6.0/lib/puma/dsl.rb:70:in`import' config/puma/development.rb:1:in `_load_from' /Users/brandan/repos/baseline/vendor/bundle/ruby/2.5.0/gems/puma-3.6.0/lib/puma/dsl.rb:26:in `instance_eval'/Users/brandan/repos/baseline/vendor/bundle/ruby/2.5.0/gems/puma-3.6.0/lib/puma/dsl.rb:26:in`_load_from' /Users/brandan/repos/baseline/vendor/bundle/ruby/2.5.0/gems/puma-3.6.0/lib/puma/dsl.rb:9:in `load' /Users/brandan/repos/baseline/vendor/bundle/ruby/2.5.0/gems/puma-3.6.0/lib/puma/configuration.rb:205:in `block in load'/Users/brandan/repos/baseline/vendor/bundle/ruby/2.5.0/gems/puma-3.6.0/lib/puma/configuration.rb:202:in`each' /Users/brandan/repos/baseline/vendor/bundle/ruby/2.5.0/gems/puma-3.6.0/lib/puma/configuration.rb:202:in `load' /Users/brandan/repos/baseline/vendor/bundle/ruby/2.5.0/gems/puma-3.6.0/lib/puma/launcher.rb:62:in `initialize'/Users/brandan/repos/baseline/vendor/bundle/ruby/2.5.0/gems/puma-3.6.0/lib/puma/cli.rb:65:in`new' /Users/brandan/repos/baseline/vendor/bundle/ruby/2.5.0/gems/puma-3.6.0/lib/puma/cli.rb:65:in `initialize' /Users/brandan/repos/baseline/vendor/bundle/ruby/2.5.0/gems/puma-3.6.0/bin/puma:8:in `new'/Users/brandan/repos/baseline/vendor/bundle/ruby/2.5.0/gems/puma-3.6.0/bin/puma:8:in`<top (required)>' /Users/brandan/repos/baseline/vendor/bundle/ruby/2.5.0/bin/puma:23:in `load' /Users/brandan/repos/baseline/vendor/bundle/ruby/2.5.0/bin/puma:23:in `<top (required)>'
According to the docs in the source, we would have to call Configuration#load at some point, but I'm not sure how or when to do that, since we're not explicitly creating a Configuration.
Expected behavior
I expected that import would still be supported when upgrading to v3.12.0, but since it's been over a year since it was removed and it doesn't seem to be affecting others (based on searching issues here), is there a different pattern that we should be following? Is there a way to make load work the way import worked?
Actual behavior
The "loaded" file does not seem to be loaded at all.
I should note that _load_from appears to work the same as import if you pass it an absolute path:
# config/puma/development.rb_load_fromFile.join(__dir__,'default.rb')puts'Should not get here'# config/puma/default.rbraise'Raising from default.rb'
$ bundleexecpuma -edevelopmentRuntimeError: Raisingfromdefault.rbconfig/puma/default.rb:1:in `_load_from'# ...
I believe we'd like you to use the new system introduced in #1234 instead. Not really SemVer there so sorry about that. Is there a reason you can't do that?
Steps to reproduce
In v3.6.0, the DSL supported an
import
method to load another config file within a given file. We use this to have adefault.rb
that gets loaded into each of our environments, which have environment-specific config indevelopment.rb
,production.rb
, etc.This method was removed in #1234 without any obvious explanation. There is a
load
method, but that doesn't load the file immediately (or at all?) the way thatimport
does:With
import
instead ofload
:According to the docs in the source, we would have to call
Configuration#load
at some point, but I'm not sure how or when to do that, since we're not explicitly creating a Configuration.Expected behavior
I expected that
import
would still be supported when upgrading to v3.12.0, but since it's been over a year since it was removed and it doesn't seem to be affecting others (based on searching issues here), is there a different pattern that we should be following? Is there a way to makeload
work the wayimport
worked?Actual behavior
The "loaded" file does not seem to be loaded at all.
System configuration
Ruby version: 2.5.1
Rails version: 5.2.1
Puma version: 3.12.0
The text was updated successfully, but these errors were encountered: