0
votes

I have a problem with Rails, which may seem trivial to you, but I will describe below what is going on.

A set that I use everyday:

  • Ubuntu 18.04
  • ruby-2.4.0
  • Rails 5.2.1 (few days ago was and update to 5.2.2.1)

I had a problem with mysql for a few days, but I solved it and it works. I noticed that all projects stopped working for me at the local. When I try to run a project that was written in Rails 5.2.1, I get this error:

/home/mirek/.rvm/gems/ruby-2.4.0/gems/railties-5.2.1/lib/rails/railtie/configuration.rb:97:in method_missing': undefined methodactive_storage' for #Rails::Application::Configuration:0x00564a221eeae8 (NoMethodError)

The commands like rails s or rails c don't work and rails -T displays a very narrow list of available commands to use.

When I try to use rails db:schema:dump I get:

rails aborted! Don’t know how to build task 'db:schema:dump'

I also checked if other similar versions of Rails would also appear same error and it is the same. I'm looking for a solution in Google but still the same.

Can anyone help me with this?

1
Prepend bundle exec like: bundle exec rails c. - Aleksei Matiushkin
@AlekseiMatiushkin I tried this and I got: > /home/mirek/.rvm/gems/ruby-2.4.0/gems/railties-5.2.2.1/lib/rails/railtie/configuration.rb:97:in method_missing': undefined method active_storage' for #<Rails::Application::Configuration:0x00563f8c7bcd58> (NoMethodError) - Miro
Does your Gemfile has gem 'rails', '~> 5.2.2' line? Have you run bundle install after Gemfile was updated? - Aleksei Matiushkin
@Miro is active_storage required in your application.rb file? If not and you need it then add require 'active_storage/engine'. If you do not need active storage then comment out the line in question from your environment files (other files may need changes as well) See Here - engineersmnky
Double check active_storage installation github.com/rails/rails/tree/master/activestorage#installation and that the gem is properly installed by bundler. - arieljuod

1 Answers

0
votes

It started after an update? Are you working in a linux environment? Check your file permissions and owner:group values, they may have changed after your update and you may need to switch to root to set them back to a usable state. Obvious? Maybe, but this has caught me out too many times lately!