Rails 5.2 fails to load in Production Environment












-1














I'm trying to run my new app in production, but I get a strange error.



$ rails server --environment=production
=> Booting Puma
=> Rails 5.2.2 application starting in production
=> Run `rails server -h` for more startup options
Exiting
/Users/user/.rvm/gems/ruby-2.4.1/gems/activerecord-5.2.2/lib/active_record/dynamic_matchers.rb:22:in `method_missing': undefined method `has_one_attached' for #<Class:0x007fc50e4e3e70> (NoMethodError)
from /Users/user/.rvm/gems/ruby-2.4.1/gems/activestorage-5.2.2/app/models/active_storage/blob/representable.rb:7:in `block in <module:Representable>'
from /Users/user/.rvm/gems/ruby-2.4.1/gems/activesupport-5.2.2/lib/active_support/concern.rb:122:in `class_eval'
from /Users/user/.rvm/gems/ruby-2.4.1/gems/activesupport-5.2.2/lib/active_support/concern.rb:122:in `append_features'
from /Users/user/.rvm/gems/ruby-2.4.1/gems/activestorage-5.2.2/app/models/active_storage/blob.rb:23:in `include'
from /Users/user/.rvm/gems/ruby-2.4.1/gems/activestorage-5.2.2/app/models/active_storage/blob.rb:23:in `<class:Blob>'
from /Users/user/.rvm/gems/ruby-2.4.1/gems/activestorage-5.2.2/app/models/active_storage/blob.rb:16:in `<main>'
from /Users/user/.rvm/gems/ruby-2.4.1/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21:in `require'
from /Users/user/.rvm/gems/ruby-2.4.1/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21:in `block in require_with_bootsnap_lfi'
from /Users/user/.rvm/gems/ruby-2.4.1/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/loaded_features_index.rb:65:in `register'
from /Users/user/.rvm/gems/ruby-2.4.1/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:20:in `require_with_bootsnap_lfi'
from /Users/user/.rvm/gems/ruby-2.4.1/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:29:in `require'
from /Users/user/.rvm/gems/ruby-2.4.1/gems/activesupport-5.2.2/lib/active_support/dependencies.rb:291:in `block in require'
from /Users/user/.rvm/gems/ruby-2.4.1/gems/activesupport-5.2.2/lib/active_support/dependencies.rb:257:in `load_dependency'
from /Users/user/.rvm/gems/ruby-2.4.1/gems/activesupport-5.2.2/lib/active_support/dependencies.rb:291:in `require'
from /Users/user/.rvm/gems/ruby-2.4.1/gems/activesupport-5.2.2/lib/active_support/dependencies.rb:378:in `block in require_or_load'
from /Users/user/.rvm/gems/ruby-2.4.1/gems/activesupport-5.2.2/lib/active_support/dependencies.rb:37:in `block in load_interlock'
from /Users/user/.rvm/gems/ruby-2.4.1/gems/activesupport-5.2.2/lib/active_support/dependencies/interlock.rb:14:in `block in loading'
from /Users/user/.rvm/gems/ruby-2.4.1/gems/activesupport-5.2.2/lib/active_support/concurrency/share_lock.rb:151:in `exclusive'
from /Users/user/.rvm/gems/ruby-2.4.1/gems/activesupport-5.2.2/lib/active_support/dependencies/interlock.rb:13:in `loading'
from /Users/user/.rvm/gems/ruby-2.4.1/gems/activesupport-5.2.2/lib/active_support/dependencies.rb:37:in `load_interlock'
from /Users/user/.rvm/gems/ruby-2.4.1/gems/activesupport-5.2.2/lib/active_support/dependencies.rb:356:in `require_or_load'
from /Users/user/.rvm/gems/ruby-2.4.1/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/core_ext/active_support.rb:46:in `block in require_or_load'
from /Users/user/.rvm/gems/ruby-2.4.1/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/core_ext/active_support.rb:16:in `allow_bootsnap_retry'
from /Users/user/.rvm/gems/ruby-2.4.1/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/core_ext/active_support.rb:45:in `require_or_load'
from /Users/user/.rvm/gems/ruby-2.4.1/gems/activesupport-5.2.2/lib/active_support/dependencies.rb:334:in `depend_on'
from /Users/user/.rvm/gems/ruby-2.4.1/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/core_ext/active_support.rb:80:in `depend_on'
from /Users/user/.rvm/gems/ruby-2.4.1/gems/activesupport-5.2.2/lib/active_support/dependencies.rb:246:in `require_dependency'
from /Users/user/.rvm/gems/ruby-2.4.1/gems/railties-5.2.2/lib/rails/engine.rb:478:in `block (2 levels) in eager_load!'
from /Users/user/.rvm/gems/ruby-2.4.1/gems/railties-5.2.2/lib/rails/engine.rb:477:in `each'
from /Users/user/.rvm/gems/ruby-2.4.1/gems/railties-5.2.2/lib/rails/engine.rb:477:in `block in eager_load!'
from /Users/user/.rvm/gems/ruby-2.4.1/gems/railties-5.2.2/lib/rails/engine.rb:475:in `each'
from /Users/user/.rvm/gems/ruby-2.4.1/gems/railties-5.2.2/lib/rails/engine.rb:475:in `eager_load!'
from /Users/user/.rvm/gems/ruby-2.4.1/gems/railties-5.2.2/lib/rails/engine.rb:356:in `eager_load!'
from /Users/user/.rvm/gems/ruby-2.4.1/gems/railties-5.2.2/lib/rails/application/finisher.rb:69:in `each'
from /Users/user/.rvm/gems/ruby-2.4.1/gems/railties-5.2.2/lib/rails/application/finisher.rb:69:in `block in <module:Finisher>'
from /Users/user/.rvm/gems/ruby-2.4.1/gems/railties-5.2.2/lib/rails/initializable.rb:32:in `instance_exec'
from /Users/user/.rvm/gems/ruby-2.4.1/gems/railties-5.2.2/lib/rails/initializable.rb:32:in `run'
from /Users/user/.rvm/gems/ruby-2.4.1/gems/railties-5.2.2/lib/rails/initializable.rb:61:in `block in run_initializers'
from /Users/user/.rvm/rubies/ruby-2.4.1/lib/ruby/2.4.0/tsort.rb:228:in `block in tsort_each'
from /Users/user/.rvm/rubies/ruby-2.4.1/lib/ruby/2.4.0/tsort.rb:350:in `block (2 levels) in each_strongly_connected_component'
from /Users/user/.rvm/rubies/ruby-2.4.1/lib/ruby/2.4.0/tsort.rb:431:in `each_strongly_connected_component_from'
from /Users/user/.rvm/rubies/ruby-2.4.1/lib/ruby/2.4.0/tsort.rb:349:in `block in each_strongly_connected_component'
from /Users/user/.rvm/rubies/ruby-2.4.1/lib/ruby/2.4.0/tsort.rb:347:in `each'
from /Users/user/.rvm/rubies/ruby-2.4.1/lib/ruby/2.4.0/tsort.rb:347:in `call'
from /Users/user/.rvm/rubies/ruby-2.4.1/lib/ruby/2.4.0/tsort.rb:347:in `each_strongly_connected_component'
from /Users/user/.rvm/rubies/ruby-2.4.1/lib/ruby/2.4.0/tsort.rb:226:in `tsort_each'
from /Users/user/.rvm/rubies/ruby-2.4.1/lib/ruby/2.4.0/tsort.rb:205:in `tsort_each'
from /Users/user/.rvm/gems/ruby-2.4.1/gems/railties-5.2.2/lib/rails/initializable.rb:60:in `run_initializers'
from /Users/user/.rvm/gems/ruby-2.4.1/gems/railties-5.2.2/lib/rails/application.rb:361:in `initialize!'
from /Users/user/Projects/My App/app-name/config/environment.rb:5:in `<main>'
from /Users/user/.rvm/gems/ruby-2.4.1/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21:in `require'
from /Users/user/.rvm/gems/ruby-2.4.1/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21:in `block in require_with_bootsnap_lfi'
from /Users/user/.rvm/gems/ruby-2.4.1/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/loaded_features_index.rb:65:in `register'
from /Users/user/.rvm/gems/ruby-2.4.1/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:20:in `require_with_bootsnap_lfi'
from /Users/user/.rvm/gems/ruby-2.4.1/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:29:in `require'
from /Users/user/.rvm/gems/ruby-2.4.1/gems/activesupport-5.2.2/lib/active_support/dependencies.rb:291:in `block in require'
from /Users/user/.rvm/gems/ruby-2.4.1/gems/activesupport-5.2.2/lib/active_support/dependencies.rb:257:in `load_dependency'
from /Users/user/.rvm/gems/ruby-2.4.1/gems/activesupport-5.2.2/lib/active_support/dependencies.rb:291:in `require'
from /Users/user/.rvm/gems/ruby-2.4.1/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:44:in `require_relative'
from config.ru:3:in `block in <main>'
from /Users/user/.rvm/gems/ruby-2.4.1/gems/rack-2.0.6/lib/rack/builder.rb:55:in `instance_eval'
from /Users/user/.rvm/gems/ruby-2.4.1/gems/rack-2.0.6/lib/rack/builder.rb:55:in `initialize'
from config.ru:in `new'
from config.ru:in `<main>'
from /Users/user/.rvm/gems/ruby-2.4.1/gems/rack-2.0.6/lib/rack/builder.rb:49:in `eval'
from /Users/user/.rvm/gems/ruby-2.4.1/gems/rack-2.0.6/lib/rack/builder.rb:49:in `new_from_string'
from /Users/user/.rvm/gems/ruby-2.4.1/gems/rack-2.0.6/lib/rack/builder.rb:40:in `parse_file'
from /Users/user/.rvm/gems/ruby-2.4.1/gems/rack-2.0.6/lib/rack/server.rb:319:in `build_app_and_options_from_config'
from /Users/user/.rvm/gems/ruby-2.4.1/gems/rack-2.0.6/lib/rack/server.rb:219:in `app'
from /Users/user/.rvm/gems/ruby-2.4.1/gems/railties-5.2.2/lib/rails/commands/server/server_command.rb:27:in `app'
from /Users/user/.rvm/gems/ruby-2.4.1/gems/rack-2.0.6/lib/rack/server.rb:354:in `wrapped_app'
from /Users/user/.rvm/gems/ruby-2.4.1/gems/rack-2.0.6/lib/rack/server.rb:283:in `start'
from /Users/user/.rvm/gems/ruby-2.4.1/gems/railties-5.2.2/lib/rails/commands/server/server_command.rb:53:in `start'
from /Users/user/.rvm/gems/ruby-2.4.1/gems/railties-5.2.2/lib/rails/commands/server/server_command.rb:147:in `block in perform'
from /Users/user/.rvm/gems/ruby-2.4.1/gems/railties-5.2.2/lib/rails/commands/server/server_command.rb:142:in `tap'
from /Users/user/.rvm/gems/ruby-2.4.1/gems/railties-5.2.2/lib/rails/commands/server/server_command.rb:142:in `perform'
from /Users/user/.rvm/gems/ruby-2.4.1/gems/thor-0.20.3/lib/thor/command.rb:27:in `run'
from /Users/user/.rvm/gems/ruby-2.4.1/gems/thor-0.20.3/lib/thor/invocation.rb:126:in `invoke_command'
from /Users/user/.rvm/gems/ruby-2.4.1/gems/thor-0.20.3/lib/thor.rb:387:in `dispatch'
from /Users/user/.rvm/gems/ruby-2.4.1/gems/railties-5.2.2/lib/rails/command/base.rb:65:in `perform'
from /Users/user/.rvm/gems/ruby-2.4.1/gems/railties-5.2.2/lib/rails/command.rb:46:in `invoke'
from /Users/user/.rvm/gems/ruby-2.4.1/gems/railties-5.2.2/lib/rails/commands.rb:18:in `<main>'
from /Users/user/.rvm/gems/ruby-2.4.1/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21:in `require'
from /Users/user/.rvm/gems/ruby-2.4.1/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21:in `block in require_with_bootsnap_lfi'
from /Users/user/.rvm/gems/ruby-2.4.1/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/loaded_features_index.rb:65:in `register'
from /Users/user/.rvm/gems/ruby-2.4.1/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:20:in `require_with_bootsnap_lfi'
from /Users/user/.rvm/gems/ruby-2.4.1/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:29:in `require'
from /Users/user/.rvm/gems/ruby-2.4.1/gems/activesupport-5.2.2/lib/active_support/dependencies.rb:291:in `block in require'
from /Users/user/.rvm/gems/ruby-2.4.1/gems/activesupport-5.2.2/lib/active_support/dependencies.rb:257:in `load_dependency'
from /Users/user/.rvm/gems/ruby-2.4.1/gems/activesupport-5.2.2/lib/active_support/dependencies.rb:291:in `require'
from bin/rails:4:in `<main>'


The usual googling hasn't turned up and helpful answers. Does anyone have an idea of how I can get this to run in the production environment?



Interestingly, the stack trace points to line 5 of environment.rb, which hasn't changed from the default, but has this line.



Rails.application.initialize!


When I comment that out, the server finally starts, but the fails as soon as I load any page (obviously).



Any pointers would be greatly appreciated! I'm not using any has_one_attached methods in my app, so I’m not sure where to look next!










share|improve this question
























  • You're not using Active Storage at all? Do you have any config.active_storage things in your configs?
    – mu is too short
    Dec 28 '18 at 2:28










  • In development.rb it's set to :local, but in production it's commented out.
    – pappy
    Dec 28 '18 at 12:10










  • does it boot in development?
    – y.bregey
    Dec 28 '18 at 14:49










  • Yep! Never had issues when running rails server
    – pappy
    Dec 29 '18 at 13:18
















-1














I'm trying to run my new app in production, but I get a strange error.



$ rails server --environment=production
=> Booting Puma
=> Rails 5.2.2 application starting in production
=> Run `rails server -h` for more startup options
Exiting
/Users/user/.rvm/gems/ruby-2.4.1/gems/activerecord-5.2.2/lib/active_record/dynamic_matchers.rb:22:in `method_missing': undefined method `has_one_attached' for #<Class:0x007fc50e4e3e70> (NoMethodError)
from /Users/user/.rvm/gems/ruby-2.4.1/gems/activestorage-5.2.2/app/models/active_storage/blob/representable.rb:7:in `block in <module:Representable>'
from /Users/user/.rvm/gems/ruby-2.4.1/gems/activesupport-5.2.2/lib/active_support/concern.rb:122:in `class_eval'
from /Users/user/.rvm/gems/ruby-2.4.1/gems/activesupport-5.2.2/lib/active_support/concern.rb:122:in `append_features'
from /Users/user/.rvm/gems/ruby-2.4.1/gems/activestorage-5.2.2/app/models/active_storage/blob.rb:23:in `include'
from /Users/user/.rvm/gems/ruby-2.4.1/gems/activestorage-5.2.2/app/models/active_storage/blob.rb:23:in `<class:Blob>'
from /Users/user/.rvm/gems/ruby-2.4.1/gems/activestorage-5.2.2/app/models/active_storage/blob.rb:16:in `<main>'
from /Users/user/.rvm/gems/ruby-2.4.1/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21:in `require'
from /Users/user/.rvm/gems/ruby-2.4.1/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21:in `block in require_with_bootsnap_lfi'
from /Users/user/.rvm/gems/ruby-2.4.1/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/loaded_features_index.rb:65:in `register'
from /Users/user/.rvm/gems/ruby-2.4.1/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:20:in `require_with_bootsnap_lfi'
from /Users/user/.rvm/gems/ruby-2.4.1/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:29:in `require'
from /Users/user/.rvm/gems/ruby-2.4.1/gems/activesupport-5.2.2/lib/active_support/dependencies.rb:291:in `block in require'
from /Users/user/.rvm/gems/ruby-2.4.1/gems/activesupport-5.2.2/lib/active_support/dependencies.rb:257:in `load_dependency'
from /Users/user/.rvm/gems/ruby-2.4.1/gems/activesupport-5.2.2/lib/active_support/dependencies.rb:291:in `require'
from /Users/user/.rvm/gems/ruby-2.4.1/gems/activesupport-5.2.2/lib/active_support/dependencies.rb:378:in `block in require_or_load'
from /Users/user/.rvm/gems/ruby-2.4.1/gems/activesupport-5.2.2/lib/active_support/dependencies.rb:37:in `block in load_interlock'
from /Users/user/.rvm/gems/ruby-2.4.1/gems/activesupport-5.2.2/lib/active_support/dependencies/interlock.rb:14:in `block in loading'
from /Users/user/.rvm/gems/ruby-2.4.1/gems/activesupport-5.2.2/lib/active_support/concurrency/share_lock.rb:151:in `exclusive'
from /Users/user/.rvm/gems/ruby-2.4.1/gems/activesupport-5.2.2/lib/active_support/dependencies/interlock.rb:13:in `loading'
from /Users/user/.rvm/gems/ruby-2.4.1/gems/activesupport-5.2.2/lib/active_support/dependencies.rb:37:in `load_interlock'
from /Users/user/.rvm/gems/ruby-2.4.1/gems/activesupport-5.2.2/lib/active_support/dependencies.rb:356:in `require_or_load'
from /Users/user/.rvm/gems/ruby-2.4.1/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/core_ext/active_support.rb:46:in `block in require_or_load'
from /Users/user/.rvm/gems/ruby-2.4.1/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/core_ext/active_support.rb:16:in `allow_bootsnap_retry'
from /Users/user/.rvm/gems/ruby-2.4.1/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/core_ext/active_support.rb:45:in `require_or_load'
from /Users/user/.rvm/gems/ruby-2.4.1/gems/activesupport-5.2.2/lib/active_support/dependencies.rb:334:in `depend_on'
from /Users/user/.rvm/gems/ruby-2.4.1/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/core_ext/active_support.rb:80:in `depend_on'
from /Users/user/.rvm/gems/ruby-2.4.1/gems/activesupport-5.2.2/lib/active_support/dependencies.rb:246:in `require_dependency'
from /Users/user/.rvm/gems/ruby-2.4.1/gems/railties-5.2.2/lib/rails/engine.rb:478:in `block (2 levels) in eager_load!'
from /Users/user/.rvm/gems/ruby-2.4.1/gems/railties-5.2.2/lib/rails/engine.rb:477:in `each'
from /Users/user/.rvm/gems/ruby-2.4.1/gems/railties-5.2.2/lib/rails/engine.rb:477:in `block in eager_load!'
from /Users/user/.rvm/gems/ruby-2.4.1/gems/railties-5.2.2/lib/rails/engine.rb:475:in `each'
from /Users/user/.rvm/gems/ruby-2.4.1/gems/railties-5.2.2/lib/rails/engine.rb:475:in `eager_load!'
from /Users/user/.rvm/gems/ruby-2.4.1/gems/railties-5.2.2/lib/rails/engine.rb:356:in `eager_load!'
from /Users/user/.rvm/gems/ruby-2.4.1/gems/railties-5.2.2/lib/rails/application/finisher.rb:69:in `each'
from /Users/user/.rvm/gems/ruby-2.4.1/gems/railties-5.2.2/lib/rails/application/finisher.rb:69:in `block in <module:Finisher>'
from /Users/user/.rvm/gems/ruby-2.4.1/gems/railties-5.2.2/lib/rails/initializable.rb:32:in `instance_exec'
from /Users/user/.rvm/gems/ruby-2.4.1/gems/railties-5.2.2/lib/rails/initializable.rb:32:in `run'
from /Users/user/.rvm/gems/ruby-2.4.1/gems/railties-5.2.2/lib/rails/initializable.rb:61:in `block in run_initializers'
from /Users/user/.rvm/rubies/ruby-2.4.1/lib/ruby/2.4.0/tsort.rb:228:in `block in tsort_each'
from /Users/user/.rvm/rubies/ruby-2.4.1/lib/ruby/2.4.0/tsort.rb:350:in `block (2 levels) in each_strongly_connected_component'
from /Users/user/.rvm/rubies/ruby-2.4.1/lib/ruby/2.4.0/tsort.rb:431:in `each_strongly_connected_component_from'
from /Users/user/.rvm/rubies/ruby-2.4.1/lib/ruby/2.4.0/tsort.rb:349:in `block in each_strongly_connected_component'
from /Users/user/.rvm/rubies/ruby-2.4.1/lib/ruby/2.4.0/tsort.rb:347:in `each'
from /Users/user/.rvm/rubies/ruby-2.4.1/lib/ruby/2.4.0/tsort.rb:347:in `call'
from /Users/user/.rvm/rubies/ruby-2.4.1/lib/ruby/2.4.0/tsort.rb:347:in `each_strongly_connected_component'
from /Users/user/.rvm/rubies/ruby-2.4.1/lib/ruby/2.4.0/tsort.rb:226:in `tsort_each'
from /Users/user/.rvm/rubies/ruby-2.4.1/lib/ruby/2.4.0/tsort.rb:205:in `tsort_each'
from /Users/user/.rvm/gems/ruby-2.4.1/gems/railties-5.2.2/lib/rails/initializable.rb:60:in `run_initializers'
from /Users/user/.rvm/gems/ruby-2.4.1/gems/railties-5.2.2/lib/rails/application.rb:361:in `initialize!'
from /Users/user/Projects/My App/app-name/config/environment.rb:5:in `<main>'
from /Users/user/.rvm/gems/ruby-2.4.1/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21:in `require'
from /Users/user/.rvm/gems/ruby-2.4.1/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21:in `block in require_with_bootsnap_lfi'
from /Users/user/.rvm/gems/ruby-2.4.1/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/loaded_features_index.rb:65:in `register'
from /Users/user/.rvm/gems/ruby-2.4.1/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:20:in `require_with_bootsnap_lfi'
from /Users/user/.rvm/gems/ruby-2.4.1/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:29:in `require'
from /Users/user/.rvm/gems/ruby-2.4.1/gems/activesupport-5.2.2/lib/active_support/dependencies.rb:291:in `block in require'
from /Users/user/.rvm/gems/ruby-2.4.1/gems/activesupport-5.2.2/lib/active_support/dependencies.rb:257:in `load_dependency'
from /Users/user/.rvm/gems/ruby-2.4.1/gems/activesupport-5.2.2/lib/active_support/dependencies.rb:291:in `require'
from /Users/user/.rvm/gems/ruby-2.4.1/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:44:in `require_relative'
from config.ru:3:in `block in <main>'
from /Users/user/.rvm/gems/ruby-2.4.1/gems/rack-2.0.6/lib/rack/builder.rb:55:in `instance_eval'
from /Users/user/.rvm/gems/ruby-2.4.1/gems/rack-2.0.6/lib/rack/builder.rb:55:in `initialize'
from config.ru:in `new'
from config.ru:in `<main>'
from /Users/user/.rvm/gems/ruby-2.4.1/gems/rack-2.0.6/lib/rack/builder.rb:49:in `eval'
from /Users/user/.rvm/gems/ruby-2.4.1/gems/rack-2.0.6/lib/rack/builder.rb:49:in `new_from_string'
from /Users/user/.rvm/gems/ruby-2.4.1/gems/rack-2.0.6/lib/rack/builder.rb:40:in `parse_file'
from /Users/user/.rvm/gems/ruby-2.4.1/gems/rack-2.0.6/lib/rack/server.rb:319:in `build_app_and_options_from_config'
from /Users/user/.rvm/gems/ruby-2.4.1/gems/rack-2.0.6/lib/rack/server.rb:219:in `app'
from /Users/user/.rvm/gems/ruby-2.4.1/gems/railties-5.2.2/lib/rails/commands/server/server_command.rb:27:in `app'
from /Users/user/.rvm/gems/ruby-2.4.1/gems/rack-2.0.6/lib/rack/server.rb:354:in `wrapped_app'
from /Users/user/.rvm/gems/ruby-2.4.1/gems/rack-2.0.6/lib/rack/server.rb:283:in `start'
from /Users/user/.rvm/gems/ruby-2.4.1/gems/railties-5.2.2/lib/rails/commands/server/server_command.rb:53:in `start'
from /Users/user/.rvm/gems/ruby-2.4.1/gems/railties-5.2.2/lib/rails/commands/server/server_command.rb:147:in `block in perform'
from /Users/user/.rvm/gems/ruby-2.4.1/gems/railties-5.2.2/lib/rails/commands/server/server_command.rb:142:in `tap'
from /Users/user/.rvm/gems/ruby-2.4.1/gems/railties-5.2.2/lib/rails/commands/server/server_command.rb:142:in `perform'
from /Users/user/.rvm/gems/ruby-2.4.1/gems/thor-0.20.3/lib/thor/command.rb:27:in `run'
from /Users/user/.rvm/gems/ruby-2.4.1/gems/thor-0.20.3/lib/thor/invocation.rb:126:in `invoke_command'
from /Users/user/.rvm/gems/ruby-2.4.1/gems/thor-0.20.3/lib/thor.rb:387:in `dispatch'
from /Users/user/.rvm/gems/ruby-2.4.1/gems/railties-5.2.2/lib/rails/command/base.rb:65:in `perform'
from /Users/user/.rvm/gems/ruby-2.4.1/gems/railties-5.2.2/lib/rails/command.rb:46:in `invoke'
from /Users/user/.rvm/gems/ruby-2.4.1/gems/railties-5.2.2/lib/rails/commands.rb:18:in `<main>'
from /Users/user/.rvm/gems/ruby-2.4.1/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21:in `require'
from /Users/user/.rvm/gems/ruby-2.4.1/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21:in `block in require_with_bootsnap_lfi'
from /Users/user/.rvm/gems/ruby-2.4.1/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/loaded_features_index.rb:65:in `register'
from /Users/user/.rvm/gems/ruby-2.4.1/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:20:in `require_with_bootsnap_lfi'
from /Users/user/.rvm/gems/ruby-2.4.1/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:29:in `require'
from /Users/user/.rvm/gems/ruby-2.4.1/gems/activesupport-5.2.2/lib/active_support/dependencies.rb:291:in `block in require'
from /Users/user/.rvm/gems/ruby-2.4.1/gems/activesupport-5.2.2/lib/active_support/dependencies.rb:257:in `load_dependency'
from /Users/user/.rvm/gems/ruby-2.4.1/gems/activesupport-5.2.2/lib/active_support/dependencies.rb:291:in `require'
from bin/rails:4:in `<main>'


The usual googling hasn't turned up and helpful answers. Does anyone have an idea of how I can get this to run in the production environment?



Interestingly, the stack trace points to line 5 of environment.rb, which hasn't changed from the default, but has this line.



Rails.application.initialize!


When I comment that out, the server finally starts, but the fails as soon as I load any page (obviously).



Any pointers would be greatly appreciated! I'm not using any has_one_attached methods in my app, so I’m not sure where to look next!










share|improve this question
























  • You're not using Active Storage at all? Do you have any config.active_storage things in your configs?
    – mu is too short
    Dec 28 '18 at 2:28










  • In development.rb it's set to :local, but in production it's commented out.
    – pappy
    Dec 28 '18 at 12:10










  • does it boot in development?
    – y.bregey
    Dec 28 '18 at 14:49










  • Yep! Never had issues when running rails server
    – pappy
    Dec 29 '18 at 13:18














-1












-1








-1







I'm trying to run my new app in production, but I get a strange error.



$ rails server --environment=production
=> Booting Puma
=> Rails 5.2.2 application starting in production
=> Run `rails server -h` for more startup options
Exiting
/Users/user/.rvm/gems/ruby-2.4.1/gems/activerecord-5.2.2/lib/active_record/dynamic_matchers.rb:22:in `method_missing': undefined method `has_one_attached' for #<Class:0x007fc50e4e3e70> (NoMethodError)
from /Users/user/.rvm/gems/ruby-2.4.1/gems/activestorage-5.2.2/app/models/active_storage/blob/representable.rb:7:in `block in <module:Representable>'
from /Users/user/.rvm/gems/ruby-2.4.1/gems/activesupport-5.2.2/lib/active_support/concern.rb:122:in `class_eval'
from /Users/user/.rvm/gems/ruby-2.4.1/gems/activesupport-5.2.2/lib/active_support/concern.rb:122:in `append_features'
from /Users/user/.rvm/gems/ruby-2.4.1/gems/activestorage-5.2.2/app/models/active_storage/blob.rb:23:in `include'
from /Users/user/.rvm/gems/ruby-2.4.1/gems/activestorage-5.2.2/app/models/active_storage/blob.rb:23:in `<class:Blob>'
from /Users/user/.rvm/gems/ruby-2.4.1/gems/activestorage-5.2.2/app/models/active_storage/blob.rb:16:in `<main>'
from /Users/user/.rvm/gems/ruby-2.4.1/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21:in `require'
from /Users/user/.rvm/gems/ruby-2.4.1/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21:in `block in require_with_bootsnap_lfi'
from /Users/user/.rvm/gems/ruby-2.4.1/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/loaded_features_index.rb:65:in `register'
from /Users/user/.rvm/gems/ruby-2.4.1/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:20:in `require_with_bootsnap_lfi'
from /Users/user/.rvm/gems/ruby-2.4.1/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:29:in `require'
from /Users/user/.rvm/gems/ruby-2.4.1/gems/activesupport-5.2.2/lib/active_support/dependencies.rb:291:in `block in require'
from /Users/user/.rvm/gems/ruby-2.4.1/gems/activesupport-5.2.2/lib/active_support/dependencies.rb:257:in `load_dependency'
from /Users/user/.rvm/gems/ruby-2.4.1/gems/activesupport-5.2.2/lib/active_support/dependencies.rb:291:in `require'
from /Users/user/.rvm/gems/ruby-2.4.1/gems/activesupport-5.2.2/lib/active_support/dependencies.rb:378:in `block in require_or_load'
from /Users/user/.rvm/gems/ruby-2.4.1/gems/activesupport-5.2.2/lib/active_support/dependencies.rb:37:in `block in load_interlock'
from /Users/user/.rvm/gems/ruby-2.4.1/gems/activesupport-5.2.2/lib/active_support/dependencies/interlock.rb:14:in `block in loading'
from /Users/user/.rvm/gems/ruby-2.4.1/gems/activesupport-5.2.2/lib/active_support/concurrency/share_lock.rb:151:in `exclusive'
from /Users/user/.rvm/gems/ruby-2.4.1/gems/activesupport-5.2.2/lib/active_support/dependencies/interlock.rb:13:in `loading'
from /Users/user/.rvm/gems/ruby-2.4.1/gems/activesupport-5.2.2/lib/active_support/dependencies.rb:37:in `load_interlock'
from /Users/user/.rvm/gems/ruby-2.4.1/gems/activesupport-5.2.2/lib/active_support/dependencies.rb:356:in `require_or_load'
from /Users/user/.rvm/gems/ruby-2.4.1/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/core_ext/active_support.rb:46:in `block in require_or_load'
from /Users/user/.rvm/gems/ruby-2.4.1/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/core_ext/active_support.rb:16:in `allow_bootsnap_retry'
from /Users/user/.rvm/gems/ruby-2.4.1/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/core_ext/active_support.rb:45:in `require_or_load'
from /Users/user/.rvm/gems/ruby-2.4.1/gems/activesupport-5.2.2/lib/active_support/dependencies.rb:334:in `depend_on'
from /Users/user/.rvm/gems/ruby-2.4.1/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/core_ext/active_support.rb:80:in `depend_on'
from /Users/user/.rvm/gems/ruby-2.4.1/gems/activesupport-5.2.2/lib/active_support/dependencies.rb:246:in `require_dependency'
from /Users/user/.rvm/gems/ruby-2.4.1/gems/railties-5.2.2/lib/rails/engine.rb:478:in `block (2 levels) in eager_load!'
from /Users/user/.rvm/gems/ruby-2.4.1/gems/railties-5.2.2/lib/rails/engine.rb:477:in `each'
from /Users/user/.rvm/gems/ruby-2.4.1/gems/railties-5.2.2/lib/rails/engine.rb:477:in `block in eager_load!'
from /Users/user/.rvm/gems/ruby-2.4.1/gems/railties-5.2.2/lib/rails/engine.rb:475:in `each'
from /Users/user/.rvm/gems/ruby-2.4.1/gems/railties-5.2.2/lib/rails/engine.rb:475:in `eager_load!'
from /Users/user/.rvm/gems/ruby-2.4.1/gems/railties-5.2.2/lib/rails/engine.rb:356:in `eager_load!'
from /Users/user/.rvm/gems/ruby-2.4.1/gems/railties-5.2.2/lib/rails/application/finisher.rb:69:in `each'
from /Users/user/.rvm/gems/ruby-2.4.1/gems/railties-5.2.2/lib/rails/application/finisher.rb:69:in `block in <module:Finisher>'
from /Users/user/.rvm/gems/ruby-2.4.1/gems/railties-5.2.2/lib/rails/initializable.rb:32:in `instance_exec'
from /Users/user/.rvm/gems/ruby-2.4.1/gems/railties-5.2.2/lib/rails/initializable.rb:32:in `run'
from /Users/user/.rvm/gems/ruby-2.4.1/gems/railties-5.2.2/lib/rails/initializable.rb:61:in `block in run_initializers'
from /Users/user/.rvm/rubies/ruby-2.4.1/lib/ruby/2.4.0/tsort.rb:228:in `block in tsort_each'
from /Users/user/.rvm/rubies/ruby-2.4.1/lib/ruby/2.4.0/tsort.rb:350:in `block (2 levels) in each_strongly_connected_component'
from /Users/user/.rvm/rubies/ruby-2.4.1/lib/ruby/2.4.0/tsort.rb:431:in `each_strongly_connected_component_from'
from /Users/user/.rvm/rubies/ruby-2.4.1/lib/ruby/2.4.0/tsort.rb:349:in `block in each_strongly_connected_component'
from /Users/user/.rvm/rubies/ruby-2.4.1/lib/ruby/2.4.0/tsort.rb:347:in `each'
from /Users/user/.rvm/rubies/ruby-2.4.1/lib/ruby/2.4.0/tsort.rb:347:in `call'
from /Users/user/.rvm/rubies/ruby-2.4.1/lib/ruby/2.4.0/tsort.rb:347:in `each_strongly_connected_component'
from /Users/user/.rvm/rubies/ruby-2.4.1/lib/ruby/2.4.0/tsort.rb:226:in `tsort_each'
from /Users/user/.rvm/rubies/ruby-2.4.1/lib/ruby/2.4.0/tsort.rb:205:in `tsort_each'
from /Users/user/.rvm/gems/ruby-2.4.1/gems/railties-5.2.2/lib/rails/initializable.rb:60:in `run_initializers'
from /Users/user/.rvm/gems/ruby-2.4.1/gems/railties-5.2.2/lib/rails/application.rb:361:in `initialize!'
from /Users/user/Projects/My App/app-name/config/environment.rb:5:in `<main>'
from /Users/user/.rvm/gems/ruby-2.4.1/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21:in `require'
from /Users/user/.rvm/gems/ruby-2.4.1/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21:in `block in require_with_bootsnap_lfi'
from /Users/user/.rvm/gems/ruby-2.4.1/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/loaded_features_index.rb:65:in `register'
from /Users/user/.rvm/gems/ruby-2.4.1/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:20:in `require_with_bootsnap_lfi'
from /Users/user/.rvm/gems/ruby-2.4.1/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:29:in `require'
from /Users/user/.rvm/gems/ruby-2.4.1/gems/activesupport-5.2.2/lib/active_support/dependencies.rb:291:in `block in require'
from /Users/user/.rvm/gems/ruby-2.4.1/gems/activesupport-5.2.2/lib/active_support/dependencies.rb:257:in `load_dependency'
from /Users/user/.rvm/gems/ruby-2.4.1/gems/activesupport-5.2.2/lib/active_support/dependencies.rb:291:in `require'
from /Users/user/.rvm/gems/ruby-2.4.1/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:44:in `require_relative'
from config.ru:3:in `block in <main>'
from /Users/user/.rvm/gems/ruby-2.4.1/gems/rack-2.0.6/lib/rack/builder.rb:55:in `instance_eval'
from /Users/user/.rvm/gems/ruby-2.4.1/gems/rack-2.0.6/lib/rack/builder.rb:55:in `initialize'
from config.ru:in `new'
from config.ru:in `<main>'
from /Users/user/.rvm/gems/ruby-2.4.1/gems/rack-2.0.6/lib/rack/builder.rb:49:in `eval'
from /Users/user/.rvm/gems/ruby-2.4.1/gems/rack-2.0.6/lib/rack/builder.rb:49:in `new_from_string'
from /Users/user/.rvm/gems/ruby-2.4.1/gems/rack-2.0.6/lib/rack/builder.rb:40:in `parse_file'
from /Users/user/.rvm/gems/ruby-2.4.1/gems/rack-2.0.6/lib/rack/server.rb:319:in `build_app_and_options_from_config'
from /Users/user/.rvm/gems/ruby-2.4.1/gems/rack-2.0.6/lib/rack/server.rb:219:in `app'
from /Users/user/.rvm/gems/ruby-2.4.1/gems/railties-5.2.2/lib/rails/commands/server/server_command.rb:27:in `app'
from /Users/user/.rvm/gems/ruby-2.4.1/gems/rack-2.0.6/lib/rack/server.rb:354:in `wrapped_app'
from /Users/user/.rvm/gems/ruby-2.4.1/gems/rack-2.0.6/lib/rack/server.rb:283:in `start'
from /Users/user/.rvm/gems/ruby-2.4.1/gems/railties-5.2.2/lib/rails/commands/server/server_command.rb:53:in `start'
from /Users/user/.rvm/gems/ruby-2.4.1/gems/railties-5.2.2/lib/rails/commands/server/server_command.rb:147:in `block in perform'
from /Users/user/.rvm/gems/ruby-2.4.1/gems/railties-5.2.2/lib/rails/commands/server/server_command.rb:142:in `tap'
from /Users/user/.rvm/gems/ruby-2.4.1/gems/railties-5.2.2/lib/rails/commands/server/server_command.rb:142:in `perform'
from /Users/user/.rvm/gems/ruby-2.4.1/gems/thor-0.20.3/lib/thor/command.rb:27:in `run'
from /Users/user/.rvm/gems/ruby-2.4.1/gems/thor-0.20.3/lib/thor/invocation.rb:126:in `invoke_command'
from /Users/user/.rvm/gems/ruby-2.4.1/gems/thor-0.20.3/lib/thor.rb:387:in `dispatch'
from /Users/user/.rvm/gems/ruby-2.4.1/gems/railties-5.2.2/lib/rails/command/base.rb:65:in `perform'
from /Users/user/.rvm/gems/ruby-2.4.1/gems/railties-5.2.2/lib/rails/command.rb:46:in `invoke'
from /Users/user/.rvm/gems/ruby-2.4.1/gems/railties-5.2.2/lib/rails/commands.rb:18:in `<main>'
from /Users/user/.rvm/gems/ruby-2.4.1/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21:in `require'
from /Users/user/.rvm/gems/ruby-2.4.1/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21:in `block in require_with_bootsnap_lfi'
from /Users/user/.rvm/gems/ruby-2.4.1/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/loaded_features_index.rb:65:in `register'
from /Users/user/.rvm/gems/ruby-2.4.1/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:20:in `require_with_bootsnap_lfi'
from /Users/user/.rvm/gems/ruby-2.4.1/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:29:in `require'
from /Users/user/.rvm/gems/ruby-2.4.1/gems/activesupport-5.2.2/lib/active_support/dependencies.rb:291:in `block in require'
from /Users/user/.rvm/gems/ruby-2.4.1/gems/activesupport-5.2.2/lib/active_support/dependencies.rb:257:in `load_dependency'
from /Users/user/.rvm/gems/ruby-2.4.1/gems/activesupport-5.2.2/lib/active_support/dependencies.rb:291:in `require'
from bin/rails:4:in `<main>'


The usual googling hasn't turned up and helpful answers. Does anyone have an idea of how I can get this to run in the production environment?



Interestingly, the stack trace points to line 5 of environment.rb, which hasn't changed from the default, but has this line.



Rails.application.initialize!


When I comment that out, the server finally starts, but the fails as soon as I load any page (obviously).



Any pointers would be greatly appreciated! I'm not using any has_one_attached methods in my app, so I’m not sure where to look next!










share|improve this question















I'm trying to run my new app in production, but I get a strange error.



$ rails server --environment=production
=> Booting Puma
=> Rails 5.2.2 application starting in production
=> Run `rails server -h` for more startup options
Exiting
/Users/user/.rvm/gems/ruby-2.4.1/gems/activerecord-5.2.2/lib/active_record/dynamic_matchers.rb:22:in `method_missing': undefined method `has_one_attached' for #<Class:0x007fc50e4e3e70> (NoMethodError)
from /Users/user/.rvm/gems/ruby-2.4.1/gems/activestorage-5.2.2/app/models/active_storage/blob/representable.rb:7:in `block in <module:Representable>'
from /Users/user/.rvm/gems/ruby-2.4.1/gems/activesupport-5.2.2/lib/active_support/concern.rb:122:in `class_eval'
from /Users/user/.rvm/gems/ruby-2.4.1/gems/activesupport-5.2.2/lib/active_support/concern.rb:122:in `append_features'
from /Users/user/.rvm/gems/ruby-2.4.1/gems/activestorage-5.2.2/app/models/active_storage/blob.rb:23:in `include'
from /Users/user/.rvm/gems/ruby-2.4.1/gems/activestorage-5.2.2/app/models/active_storage/blob.rb:23:in `<class:Blob>'
from /Users/user/.rvm/gems/ruby-2.4.1/gems/activestorage-5.2.2/app/models/active_storage/blob.rb:16:in `<main>'
from /Users/user/.rvm/gems/ruby-2.4.1/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21:in `require'
from /Users/user/.rvm/gems/ruby-2.4.1/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21:in `block in require_with_bootsnap_lfi'
from /Users/user/.rvm/gems/ruby-2.4.1/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/loaded_features_index.rb:65:in `register'
from /Users/user/.rvm/gems/ruby-2.4.1/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:20:in `require_with_bootsnap_lfi'
from /Users/user/.rvm/gems/ruby-2.4.1/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:29:in `require'
from /Users/user/.rvm/gems/ruby-2.4.1/gems/activesupport-5.2.2/lib/active_support/dependencies.rb:291:in `block in require'
from /Users/user/.rvm/gems/ruby-2.4.1/gems/activesupport-5.2.2/lib/active_support/dependencies.rb:257:in `load_dependency'
from /Users/user/.rvm/gems/ruby-2.4.1/gems/activesupport-5.2.2/lib/active_support/dependencies.rb:291:in `require'
from /Users/user/.rvm/gems/ruby-2.4.1/gems/activesupport-5.2.2/lib/active_support/dependencies.rb:378:in `block in require_or_load'
from /Users/user/.rvm/gems/ruby-2.4.1/gems/activesupport-5.2.2/lib/active_support/dependencies.rb:37:in `block in load_interlock'
from /Users/user/.rvm/gems/ruby-2.4.1/gems/activesupport-5.2.2/lib/active_support/dependencies/interlock.rb:14:in `block in loading'
from /Users/user/.rvm/gems/ruby-2.4.1/gems/activesupport-5.2.2/lib/active_support/concurrency/share_lock.rb:151:in `exclusive'
from /Users/user/.rvm/gems/ruby-2.4.1/gems/activesupport-5.2.2/lib/active_support/dependencies/interlock.rb:13:in `loading'
from /Users/user/.rvm/gems/ruby-2.4.1/gems/activesupport-5.2.2/lib/active_support/dependencies.rb:37:in `load_interlock'
from /Users/user/.rvm/gems/ruby-2.4.1/gems/activesupport-5.2.2/lib/active_support/dependencies.rb:356:in `require_or_load'
from /Users/user/.rvm/gems/ruby-2.4.1/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/core_ext/active_support.rb:46:in `block in require_or_load'
from /Users/user/.rvm/gems/ruby-2.4.1/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/core_ext/active_support.rb:16:in `allow_bootsnap_retry'
from /Users/user/.rvm/gems/ruby-2.4.1/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/core_ext/active_support.rb:45:in `require_or_load'
from /Users/user/.rvm/gems/ruby-2.4.1/gems/activesupport-5.2.2/lib/active_support/dependencies.rb:334:in `depend_on'
from /Users/user/.rvm/gems/ruby-2.4.1/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/core_ext/active_support.rb:80:in `depend_on'
from /Users/user/.rvm/gems/ruby-2.4.1/gems/activesupport-5.2.2/lib/active_support/dependencies.rb:246:in `require_dependency'
from /Users/user/.rvm/gems/ruby-2.4.1/gems/railties-5.2.2/lib/rails/engine.rb:478:in `block (2 levels) in eager_load!'
from /Users/user/.rvm/gems/ruby-2.4.1/gems/railties-5.2.2/lib/rails/engine.rb:477:in `each'
from /Users/user/.rvm/gems/ruby-2.4.1/gems/railties-5.2.2/lib/rails/engine.rb:477:in `block in eager_load!'
from /Users/user/.rvm/gems/ruby-2.4.1/gems/railties-5.2.2/lib/rails/engine.rb:475:in `each'
from /Users/user/.rvm/gems/ruby-2.4.1/gems/railties-5.2.2/lib/rails/engine.rb:475:in `eager_load!'
from /Users/user/.rvm/gems/ruby-2.4.1/gems/railties-5.2.2/lib/rails/engine.rb:356:in `eager_load!'
from /Users/user/.rvm/gems/ruby-2.4.1/gems/railties-5.2.2/lib/rails/application/finisher.rb:69:in `each'
from /Users/user/.rvm/gems/ruby-2.4.1/gems/railties-5.2.2/lib/rails/application/finisher.rb:69:in `block in <module:Finisher>'
from /Users/user/.rvm/gems/ruby-2.4.1/gems/railties-5.2.2/lib/rails/initializable.rb:32:in `instance_exec'
from /Users/user/.rvm/gems/ruby-2.4.1/gems/railties-5.2.2/lib/rails/initializable.rb:32:in `run'
from /Users/user/.rvm/gems/ruby-2.4.1/gems/railties-5.2.2/lib/rails/initializable.rb:61:in `block in run_initializers'
from /Users/user/.rvm/rubies/ruby-2.4.1/lib/ruby/2.4.0/tsort.rb:228:in `block in tsort_each'
from /Users/user/.rvm/rubies/ruby-2.4.1/lib/ruby/2.4.0/tsort.rb:350:in `block (2 levels) in each_strongly_connected_component'
from /Users/user/.rvm/rubies/ruby-2.4.1/lib/ruby/2.4.0/tsort.rb:431:in `each_strongly_connected_component_from'
from /Users/user/.rvm/rubies/ruby-2.4.1/lib/ruby/2.4.0/tsort.rb:349:in `block in each_strongly_connected_component'
from /Users/user/.rvm/rubies/ruby-2.4.1/lib/ruby/2.4.0/tsort.rb:347:in `each'
from /Users/user/.rvm/rubies/ruby-2.4.1/lib/ruby/2.4.0/tsort.rb:347:in `call'
from /Users/user/.rvm/rubies/ruby-2.4.1/lib/ruby/2.4.0/tsort.rb:347:in `each_strongly_connected_component'
from /Users/user/.rvm/rubies/ruby-2.4.1/lib/ruby/2.4.0/tsort.rb:226:in `tsort_each'
from /Users/user/.rvm/rubies/ruby-2.4.1/lib/ruby/2.4.0/tsort.rb:205:in `tsort_each'
from /Users/user/.rvm/gems/ruby-2.4.1/gems/railties-5.2.2/lib/rails/initializable.rb:60:in `run_initializers'
from /Users/user/.rvm/gems/ruby-2.4.1/gems/railties-5.2.2/lib/rails/application.rb:361:in `initialize!'
from /Users/user/Projects/My App/app-name/config/environment.rb:5:in `<main>'
from /Users/user/.rvm/gems/ruby-2.4.1/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21:in `require'
from /Users/user/.rvm/gems/ruby-2.4.1/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21:in `block in require_with_bootsnap_lfi'
from /Users/user/.rvm/gems/ruby-2.4.1/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/loaded_features_index.rb:65:in `register'
from /Users/user/.rvm/gems/ruby-2.4.1/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:20:in `require_with_bootsnap_lfi'
from /Users/user/.rvm/gems/ruby-2.4.1/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:29:in `require'
from /Users/user/.rvm/gems/ruby-2.4.1/gems/activesupport-5.2.2/lib/active_support/dependencies.rb:291:in `block in require'
from /Users/user/.rvm/gems/ruby-2.4.1/gems/activesupport-5.2.2/lib/active_support/dependencies.rb:257:in `load_dependency'
from /Users/user/.rvm/gems/ruby-2.4.1/gems/activesupport-5.2.2/lib/active_support/dependencies.rb:291:in `require'
from /Users/user/.rvm/gems/ruby-2.4.1/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:44:in `require_relative'
from config.ru:3:in `block in <main>'
from /Users/user/.rvm/gems/ruby-2.4.1/gems/rack-2.0.6/lib/rack/builder.rb:55:in `instance_eval'
from /Users/user/.rvm/gems/ruby-2.4.1/gems/rack-2.0.6/lib/rack/builder.rb:55:in `initialize'
from config.ru:in `new'
from config.ru:in `<main>'
from /Users/user/.rvm/gems/ruby-2.4.1/gems/rack-2.0.6/lib/rack/builder.rb:49:in `eval'
from /Users/user/.rvm/gems/ruby-2.4.1/gems/rack-2.0.6/lib/rack/builder.rb:49:in `new_from_string'
from /Users/user/.rvm/gems/ruby-2.4.1/gems/rack-2.0.6/lib/rack/builder.rb:40:in `parse_file'
from /Users/user/.rvm/gems/ruby-2.4.1/gems/rack-2.0.6/lib/rack/server.rb:319:in `build_app_and_options_from_config'
from /Users/user/.rvm/gems/ruby-2.4.1/gems/rack-2.0.6/lib/rack/server.rb:219:in `app'
from /Users/user/.rvm/gems/ruby-2.4.1/gems/railties-5.2.2/lib/rails/commands/server/server_command.rb:27:in `app'
from /Users/user/.rvm/gems/ruby-2.4.1/gems/rack-2.0.6/lib/rack/server.rb:354:in `wrapped_app'
from /Users/user/.rvm/gems/ruby-2.4.1/gems/rack-2.0.6/lib/rack/server.rb:283:in `start'
from /Users/user/.rvm/gems/ruby-2.4.1/gems/railties-5.2.2/lib/rails/commands/server/server_command.rb:53:in `start'
from /Users/user/.rvm/gems/ruby-2.4.1/gems/railties-5.2.2/lib/rails/commands/server/server_command.rb:147:in `block in perform'
from /Users/user/.rvm/gems/ruby-2.4.1/gems/railties-5.2.2/lib/rails/commands/server/server_command.rb:142:in `tap'
from /Users/user/.rvm/gems/ruby-2.4.1/gems/railties-5.2.2/lib/rails/commands/server/server_command.rb:142:in `perform'
from /Users/user/.rvm/gems/ruby-2.4.1/gems/thor-0.20.3/lib/thor/command.rb:27:in `run'
from /Users/user/.rvm/gems/ruby-2.4.1/gems/thor-0.20.3/lib/thor/invocation.rb:126:in `invoke_command'
from /Users/user/.rvm/gems/ruby-2.4.1/gems/thor-0.20.3/lib/thor.rb:387:in `dispatch'
from /Users/user/.rvm/gems/ruby-2.4.1/gems/railties-5.2.2/lib/rails/command/base.rb:65:in `perform'
from /Users/user/.rvm/gems/ruby-2.4.1/gems/railties-5.2.2/lib/rails/command.rb:46:in `invoke'
from /Users/user/.rvm/gems/ruby-2.4.1/gems/railties-5.2.2/lib/rails/commands.rb:18:in `<main>'
from /Users/user/.rvm/gems/ruby-2.4.1/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21:in `require'
from /Users/user/.rvm/gems/ruby-2.4.1/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21:in `block in require_with_bootsnap_lfi'
from /Users/user/.rvm/gems/ruby-2.4.1/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/loaded_features_index.rb:65:in `register'
from /Users/user/.rvm/gems/ruby-2.4.1/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:20:in `require_with_bootsnap_lfi'
from /Users/user/.rvm/gems/ruby-2.4.1/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:29:in `require'
from /Users/user/.rvm/gems/ruby-2.4.1/gems/activesupport-5.2.2/lib/active_support/dependencies.rb:291:in `block in require'
from /Users/user/.rvm/gems/ruby-2.4.1/gems/activesupport-5.2.2/lib/active_support/dependencies.rb:257:in `load_dependency'
from /Users/user/.rvm/gems/ruby-2.4.1/gems/activesupport-5.2.2/lib/active_support/dependencies.rb:291:in `require'
from bin/rails:4:in `<main>'


The usual googling hasn't turned up and helpful answers. Does anyone have an idea of how I can get this to run in the production environment?



Interestingly, the stack trace points to line 5 of environment.rb, which hasn't changed from the default, but has this line.



Rails.application.initialize!


When I comment that out, the server finally starts, but the fails as soon as I load any page (obviously).



Any pointers would be greatly appreciated! I'm not using any has_one_attached methods in my app, so I’m not sure where to look next!







ruby-on-rails activerecord dependencies






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Dec 28 '18 at 1:22

























asked Dec 28 '18 at 0:32









pappy

372720




372720












  • You're not using Active Storage at all? Do you have any config.active_storage things in your configs?
    – mu is too short
    Dec 28 '18 at 2:28










  • In development.rb it's set to :local, but in production it's commented out.
    – pappy
    Dec 28 '18 at 12:10










  • does it boot in development?
    – y.bregey
    Dec 28 '18 at 14:49










  • Yep! Never had issues when running rails server
    – pappy
    Dec 29 '18 at 13:18


















  • You're not using Active Storage at all? Do you have any config.active_storage things in your configs?
    – mu is too short
    Dec 28 '18 at 2:28










  • In development.rb it's set to :local, but in production it's commented out.
    – pappy
    Dec 28 '18 at 12:10










  • does it boot in development?
    – y.bregey
    Dec 28 '18 at 14:49










  • Yep! Never had issues when running rails server
    – pappy
    Dec 29 '18 at 13:18
















You're not using Active Storage at all? Do you have any config.active_storage things in your configs?
– mu is too short
Dec 28 '18 at 2:28




You're not using Active Storage at all? Do you have any config.active_storage things in your configs?
– mu is too short
Dec 28 '18 at 2:28












In development.rb it's set to :local, but in production it's commented out.
– pappy
Dec 28 '18 at 12:10




In development.rb it's set to :local, but in production it's commented out.
– pappy
Dec 28 '18 at 12:10












does it boot in development?
– y.bregey
Dec 28 '18 at 14:49




does it boot in development?
– y.bregey
Dec 28 '18 at 14:49












Yep! Never had issues when running rails server
– pappy
Dec 29 '18 at 13:18




Yep! Never had issues when running rails server
– pappy
Dec 29 '18 at 13:18












2 Answers
2






active

oldest

votes


















-1














Install active storage by running the following commands:



 rails active_storage:install
db:migrate


Add a new attribute on your model as:



has_one_attached :image


Also, you'll need to require "active_storage" in your application.rb file






share|improve this answer





















  • But, I don't need active storage for this project?
    – pappy
    Dec 29 '18 at 13:18










  • If you do not need, than delete activestorage-5.2.2, maybe problem with this gem!
    – Alexandr
    Dec 29 '18 at 22:36



















-1














Whelp. You know what? It looks like it was down to my incorrect config on the production: section of the database.yml file.






share|improve this answer





















    Your Answer






    StackExchange.ifUsing("editor", function () {
    StackExchange.using("externalEditor", function () {
    StackExchange.using("snippets", function () {
    StackExchange.snippets.init();
    });
    });
    }, "code-snippets");

    StackExchange.ready(function() {
    var channelOptions = {
    tags: "".split(" "),
    id: "1"
    };
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function() {
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled) {
    StackExchange.using("snippets", function() {
    createEditor();
    });
    }
    else {
    createEditor();
    }
    });

    function createEditor() {
    StackExchange.prepareEditor({
    heartbeatType: 'answer',
    autoActivateHeartbeat: false,
    convertImagesToLinks: true,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: 10,
    bindNavPrevention: true,
    postfix: "",
    imageUploader: {
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    },
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    });


    }
    });














    draft saved

    draft discarded


















    StackExchange.ready(
    function () {
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53952384%2frails-5-2-fails-to-load-in-production-environment%23new-answer', 'question_page');
    }
    );

    Post as a guest















    Required, but never shown

























    2 Answers
    2






    active

    oldest

    votes








    2 Answers
    2






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    -1














    Install active storage by running the following commands:



     rails active_storage:install
    db:migrate


    Add a new attribute on your model as:



    has_one_attached :image


    Also, you'll need to require "active_storage" in your application.rb file






    share|improve this answer





















    • But, I don't need active storage for this project?
      – pappy
      Dec 29 '18 at 13:18










    • If you do not need, than delete activestorage-5.2.2, maybe problem with this gem!
      – Alexandr
      Dec 29 '18 at 22:36
















    -1














    Install active storage by running the following commands:



     rails active_storage:install
    db:migrate


    Add a new attribute on your model as:



    has_one_attached :image


    Also, you'll need to require "active_storage" in your application.rb file






    share|improve this answer





















    • But, I don't need active storage for this project?
      – pappy
      Dec 29 '18 at 13:18










    • If you do not need, than delete activestorage-5.2.2, maybe problem with this gem!
      – Alexandr
      Dec 29 '18 at 22:36














    -1












    -1








    -1






    Install active storage by running the following commands:



     rails active_storage:install
    db:migrate


    Add a new attribute on your model as:



    has_one_attached :image


    Also, you'll need to require "active_storage" in your application.rb file






    share|improve this answer












    Install active storage by running the following commands:



     rails active_storage:install
    db:migrate


    Add a new attribute on your model as:



    has_one_attached :image


    Also, you'll need to require "active_storage" in your application.rb file







    share|improve this answer












    share|improve this answer



    share|improve this answer










    answered Dec 28 '18 at 22:40









    Alexandr

    30856




    30856












    • But, I don't need active storage for this project?
      – pappy
      Dec 29 '18 at 13:18










    • If you do not need, than delete activestorage-5.2.2, maybe problem with this gem!
      – Alexandr
      Dec 29 '18 at 22:36


















    • But, I don't need active storage for this project?
      – pappy
      Dec 29 '18 at 13:18










    • If you do not need, than delete activestorage-5.2.2, maybe problem with this gem!
      – Alexandr
      Dec 29 '18 at 22:36
















    But, I don't need active storage for this project?
    – pappy
    Dec 29 '18 at 13:18




    But, I don't need active storage for this project?
    – pappy
    Dec 29 '18 at 13:18












    If you do not need, than delete activestorage-5.2.2, maybe problem with this gem!
    – Alexandr
    Dec 29 '18 at 22:36




    If you do not need, than delete activestorage-5.2.2, maybe problem with this gem!
    – Alexandr
    Dec 29 '18 at 22:36













    -1














    Whelp. You know what? It looks like it was down to my incorrect config on the production: section of the database.yml file.






    share|improve this answer


























      -1














      Whelp. You know what? It looks like it was down to my incorrect config on the production: section of the database.yml file.






      share|improve this answer
























        -1












        -1








        -1






        Whelp. You know what? It looks like it was down to my incorrect config on the production: section of the database.yml file.






        share|improve this answer












        Whelp. You know what? It looks like it was down to my incorrect config on the production: section of the database.yml file.







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Dec 29 '18 at 17:50









        pappy

        372720




        372720






























            draft saved

            draft discarded




















































            Thanks for contributing an answer to Stack Overflow!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid



            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.


            To learn more, see our tips on writing great answers.





            Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


            Please pay close attention to the following guidance:


            • Please be sure to answer the question. Provide details and share your research!

            But avoid



            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.


            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53952384%2frails-5-2-fails-to-load-in-production-environment%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            Monofisismo

            Angular Downloading a file using contenturl with Basic Authentication

            Olmecas