Ask A Question

Notifications

You’re not receiving notifications from this thread.

Having some Issues regarding Rails 5.2 upgrade

Damian Nelwep asked in Rails

Hi everyone,

I was working on using ActiveStorage on an app I had begun like 6month to 1year ago. So Rails wasn't the right version and I put 'gem 'rails', '~> 5.2', '>= 5.2.2' ' in my Gemfile and then 'bundle install rails' to upgrade it and be able to use the new Storage function.

But when I type rails s (db:migrate worked well) , I have some error which seem to be connected to the fact I upgraded rails.. :

/home/meaw/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/railties-5.2.2/lib/rails/railtie/configuration.rb:97:in `method_missing': undefined method `action_storage' for #<Rails::Application::Configuration:0x000055e7bdaaed30> (NoMethodError)

This is the last line. Before it there is :

$ rails s
=> Booting Puma
=> Rails 5.2.2 application starting in development 
=> Run `rails server -h` for more startup options
Exiting
Traceback (most recent call last):
    70: from bin/rails:3:in `<main>'
    69: from bin/rails:3:in `load'
    68: from /home/meaw/work/tryfour/meaw/bin/spring:15:in `<top (required)>'
    67: from /home/meaw/.rbenv/versions/2.5.3/lib/ruby/2.5.0/rubygems/core_ext/kernel_require.rb:70:in `require'
    66: from /home/meaw/.rbenv/versions/2.5.3/lib/ruby/2.5.0/rubygems/core_ext/kernel_require.rb:70:in `require'
    65: from /home/meaw/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/spring-2.0.2/lib/spring/binstub.rb:31:in `<top (required)>'
    64: from /home/meaw/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/spring-2.0.2/lib/spring/binstub.rb:31:in `load'
    63: from /home/meaw/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/spring-2.0.2/bin/spring:49:in `<top (required)>'
    62: from /home/meaw/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/spring-2.0.2/lib/spring/client.rb:30:in `run'
    61: from /home/meaw/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/spring-2.0.2/lib/spring/client/command.rb:7:in `call'
    60: from /home/meaw/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/spring-2.0.2/lib/spring/client/rails.rb:28:in `call'
    59: from /home/meaw/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/spring-2.0.2/lib/spring/client/rails.rb:28:in `load'
    58: from /home/meaw/work/tryfour/meaw/bin/rails:9:in `<top (required)>'
    57: from /home/meaw/work/tryfour/meaw/bin/rails:9:in `require'
    56: from /home/meaw/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/railties-5.2.2/lib/rails/commands.rb:18:in `<top (required)>'
    55: from /home/meaw/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/railties-5.2.2/lib/rails/command.rb:46:in `invoke'
    54: from /home/meaw/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/railties-5.2.2/lib/rails/command/base.rb:65:in `perform'
    53: from /home/meaw/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/thor-0.20.3/lib/thor.rb:387:in `dispatch'
    52: from /home/meaw/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/thor-0.20.3/lib/thor/invocation.rb:126:in `invoke_command'
    51: from /home/meaw/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/thor-0.20.3/lib/thor/command.rb:27:in `run'
    50: from /home/meaw/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/railties-5.2.2/lib/rails/commands/server/server_command.rb:142:in `perform'
    49: from /home/meaw/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/railties-5.2.2/lib/rails/commands/server/server_command.rb:142:in `tap'
    48: from /home/meaw/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/railties-5.2.2/lib/rails/commands/server/server_command.rb:147:in `block in perform'
    47: from /home/meaw/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/railties-5.2.2/lib/rails/commands/server/server_command.rb:51:in `start'
    46: from /home/meaw/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/railties-5.2.2/lib/rails/commands/server/server_command.rb:89:in `log_to_stdout'
    45: from /home/meaw/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/rack-2.0.6/lib/rack/server.rb:354:in `wrapped_app'
    44: from /home/meaw/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/railties-5.2.2/lib/rails/commands/server/server_command.rb:27:in `app'
    43: from /home/meaw/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/rack-2.0.6/lib/rack/server.rb:219:in `app'
    42: from /home/meaw/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/rack-2.0.6/lib/rack/server.rb:319:in `build_app_and_options_from_config'
    41: from /home/meaw/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/rack-2.0.6/lib/rack/builder.rb:40:in `parse_file'
    40: from /home/meaw/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/rack-2.0.6/lib/rack/builder.rb:49:in `new_from_string'
    39: from /home/meaw/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/rack-2.0.6/lib/rack/builder.rb:49:in `eval'
    38: from config.ru:in `<main>'
    37: from config.ru:in `new'
    36: from /home/meaw/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/rack-2.0.6/lib/rack/builder.rb:55:in `initialize'
    35: from /home/meaw/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/rack-2.0.6/lib/rack/builder.rb:55:in `instance_eval'
    34: from config.ru:3:in `block in <main>'
    33: from config.ru:3:in `require_relative'
    32: from /home/meaw/work/tryfour/meaw/config/environment.rb:5:in `<top (required)>'
    31: from /home/meaw/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/railties-5.2.2/lib/rails/application.rb:361:in `initialize!'
    30: from /home/meaw/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/railties-5.2.2/lib/rails/initializable.rb:60:in `run_initializers'
    29: from /home/meaw/.rbenv/versions/2.5.3/lib/ruby/2.5.0/tsort.rb:205:in `tsort_each'
    28: from /home/meaw/.rbenv/versions/2.5.3/lib/ruby/2.5.0/tsort.rb:226:in `tsort_each'
    27: from /home/meaw/.rbenv/versions/2.5.3/lib/ruby/2.5.0/tsort.rb:347:in `each_strongly_connected_component'
    26: from /home/meaw/.rbenv/versions/2.5.3/lib/ruby/2.5.0/tsort.rb:347:in `call'
    25: from /home/meaw/.rbenv/versions/2.5.3/lib/ruby/2.5.0/tsort.rb:347:in `each'
    24: from /home/meaw/.rbenv/versions/2.5.3/lib/ruby/2.5.0/tsort.rb:349:in `block in each_strongly_connected_component'
    23: from /home/meaw/.rbenv/versions/2.5.3/lib/ruby/2.5.0/tsort.rb:415:in `each_strongly_connected_component_from'
    22: from /home/meaw/.rbenv/versions/2.5.3/lib/ruby/2.5.0/tsort.rb:415:in `call'
    21: from /home/meaw/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/railties-5.2.2/lib/rails/initializable.rb:50:in `tsort_each_child'
    20: from /home/meaw/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/railties-5.2.2/lib/rails/initializable.rb:50:in `each'
    19: from /home/meaw/.rbenv/versions/2.5.3/lib/ruby/2.5.0/tsort.rb:421:in `block in each_strongly_connected_component_from'
    18: from /home/meaw/.rbenv/versions/2.5.3/lib/ruby/2.5.0/tsort.rb:431:in `each_strongly_connected_component_from'
    17: from /home/meaw/.rbenv/versions/2.5.3/lib/ruby/2.5.0/tsort.rb:422:in `block (2 levels) in each_strongly_connected_component_from'
    16: from /home/meaw/.rbenv/versions/2.5.3/lib/ruby/2.5.0/tsort.rb:350:in `block (2 levels) in each_strongly_connected_component'
    15: from /home/meaw/.rbenv/versions/2.5.3/lib/ruby/2.5.0/tsort.rb:228:in `block in tsort_each'
    14: from /home/meaw/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/railties-5.2.2/lib/rails/initializable.rb:61:in `block in run_initializers'
    13: from /home/meaw/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/railties-5.2.2/lib/rails/initializable.rb:32:in `run'
    12: from /home/meaw/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/railties-5.2.2/lib/rails/initializable.rb:32:in `instance_exec'
    11: from /home/meaw/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/railties-5.2.2/lib/rails/engine.rb:601:in `block in <class:Engine>'
    10: from /home/meaw/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/railties-5.2.2/lib/rails/engine.rb:601:in `each'
     9: from /home/meaw/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/railties-5.2.2/lib/rails/engine.rb:602:in `block (2 levels) in <class:Engine>'
     8: from /home/meaw/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/activesupport-5.2.2/lib/active_support/dependencies.rb:291:in `require'
     7: from /home/meaw/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/activesupport-5.2.2/lib/active_support/dependencies.rb:257:in `load_dependency'
     6: from /home/meaw/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/activesupport-5.2.2/lib/active_support/dependencies.rb:291:in `block in require'
     5: from /home/meaw/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/activesupport-5.2.2/lib/active_support/dependencies.rb:291:in `require'
     4: from /home/meaw/work/tryfour/meaw/config/environments/development.rb:1:in `<top (required)>'
     3: from /home/meaw/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/railties-5.2.2/lib/rails/railtie.rb:216:in `configure'
     2: from /home/meaw/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/railties-5.2.2/lib/rails/railtie.rb:216:in `instance_eval'
     1: from /home/meaw/work/tryfour/meaw/config/environments/development.rb:29:in `block in <top (required)>'

So I don't know how to debug this without going back to the earlier rails version I was working on....

Thanks in advance to the kind person who would come to help me!

Reply

Have you ran $ rails active_storage:install which generates a migration to add the two new tables active_storage_attachments and active_storage_blobs? You'll of course also need to then run $ rails db:migrate.

Reply

Yes I did that of course...

Reply

I found an issue like this today and it turned out that I had misspelled something in my configuration. I wrote action_storage when it should have been active_storage 😊

I know it has been a while, but in case it helps anyone else...

Reply
Join the discussion
Create an account Log in

Want to stay up-to-date with Ruby on Rails?

Join 85,376+ developers who get early access to new tutorials, screencasts, articles, and more.

    We care about the protection of your data. Read our Privacy Policy.