R
R
Roman Ivanov2019-06-25 09:38:49
Ruby on Rails
Roman Ivanov, 2019-06-25 09:38:49

Why is Ruby on Rails giving this error?

I'm trying to run the command:

ubuntu:~/environment/sample_app (static-pages) $ rails generate controller StaticPages home help

The result is
Traceback (most recent call last):
        28: from bin/rails:4:in `<main>'
        27: from /home/ubuntu/.rvm/gems/ruby-2.6.3/gems/activesupport-5.1.6/lib/active_support/dependencies.rb:292:in `require'
        26: from /home/ubuntu/.rvm/gems/ruby-2.6.3/gems/activesupport-5.1.6/lib/active_support/dependencies.rb:258:in `load_dependency'
        25: from /home/ubuntu/.rvm/gems/ruby-2.6.3/gems/activesupport-5.1.6/lib/active_support/dependencies.rb:292:in `block in require'
        24: from /home/ubuntu/.rvm/gems/ruby-2.6.3/gems/bootsnap-1.4.4/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:30:in `require'
        23: from /home/ubuntu/.rvm/gems/ruby-2.6.3/gems/bootsnap-1.4.4/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21:in `require_with_bootsnap_lfi'
        22: from /home/ubuntu/.rvm/gems/ruby-2.6.3/gems/bootsnap-1.4.4/lib/bootsnap/load_path_cache/loaded_features_index.rb:92:in `register'
        21: from /home/ubuntu/.rvm/gems/ruby-2.6.3/gems/bootsnap-1.4.4/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `block in require_with_bootsnap_lfi'
        20: from /home/ubuntu/.rvm/gems/ruby-2.6.3/gems/bootsnap-1.4.4/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `require'
        19: from /home/ubuntu/.rvm/gems/ruby-2.6.3/gems/railties-5.1.6/lib/rails/commands.rb:16:in `<main>'
        18: from /home/ubuntu/.rvm/gems/ruby-2.6.3/gems/railties-5.1.6/lib/rails/command.rb:44:in `invoke'
        17: from /home/ubuntu/.rvm/gems/ruby-2.6.3/gems/railties-5.1.6/lib/rails/command/base.rb:63:in `perform'
        16: from /home/ubuntu/.rvm/gems/ruby-2.6.3/gems/thor-0.20.3/lib/thor.rb:387:in `dispatch'
        15: from /home/ubuntu/.rvm/gems/ruby-2.6.3/gems/thor-0.20.3/lib/thor/invocation.rb:126:in `invoke_command'
        14: from /home/ubuntu/.rvm/gems/ruby-2.6.3/gems/thor-0.20.3/lib/thor/command.rb:27:in `run'
        13: from /home/ubuntu/.rvm/gems/ruby-2.6.3/gems/railties-5.1.6/lib/rails/commands/generate/generate_command.rb:19:in `perform'
        12: from /home/ubuntu/.rvm/gems/ruby-2.6.3/gems/railties-5.1.6/lib/rails/command/actions.rb:15:in `require_application_and_environment!'
        11: from /home/ubuntu/.rvm/gems/ruby-2.6.3/gems/activesupport-5.1.6/lib/active_support/dependencies.rb:292:in `require'
        10: from /home/ubuntu/.rvm/gems/ruby-2.6.3/gems/activesupport-5.1.6/lib/active_support/dependencies.rb:258:in `load_dependency'
         9: from /home/ubuntu/.rvm/gems/ruby-2.6.3/gems/activesupport-5.1.6/lib/active_support/dependencies.rb:292:in `block in require'
         8: from /home/ubuntu/.rvm/gems/ruby-2.6.3/gems/bootsnap-1.4.4/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:30:in `require'
         7: from /home/ubuntu/.rvm/gems/ruby-2.6.3/gems/bootsnap-1.4.4/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21:in `require_with_bootsnap_lfi'
         6: from /home/ubuntu/.rvm/gems/ruby-2.6.3/gems/bootsnap-1.4.4/lib/bootsnap/load_path_cache/loaded_features_index.rb:92:in `register'
         5: from /home/ubuntu/.rvm/gems/ruby-2.6.3/gems/bootsnap-1.4.4/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `block in require_with_bootsnap_lfi'
         4: from /home/ubuntu/.rvm/gems/ruby-2.6.3/gems/bootsnap-1.4.4/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `require'
         3: from /home/ubuntu/environment/sample_app/config/application.rb:9:in `<main>'
         2: from /home/ubuntu/environment/sample_app/config/application.rb:10:in `<module:SampleApp>'
         1: from /home/ubuntu/environment/sample_app/config/application.rb:12:in `<class:Application>'
/home/ubuntu/.rvm/gems/ruby-2.6.3/gems/railties-5.1.6/lib/rails/application/configuration.rb:81:in `load_defaults': Unknown version "5.2" (RuntimeError)

The last line refers to gem railties-5.1.6 and immediately writes about the unknown version 5.2 . What is the result of inconsistency?
gemfile
source 'https://rubygems.org'
git_source(:github) { |repo| "https://github.com/#{repo}.git" }

ruby '2.6.3'

gem 'rails',        '5.1.6'
gem 'puma',         '3.9.1'
gem 'sass-rails',   '5.0.6'
gem 'uglifier',     '3.2.0'
gem 'coffee-rails', '4.2.2'
gem 'jquery-rails', '4.3.1'
gem 'turbolinks',   '5.0.1'
gem 'jbuilder',     '2.7.0'
gem 'bootsnap', require: false
gem 'rake'

group :development, :test do
  gem 'sqlite3', '1.3.13'
  gem 'byebug',  '9.0.6', platform: :mri
end

group :development do
  gem 'web-console',           '3.5.1'
  gem 'listen',                '3.1.5'
  gem 'spring',                '2.0.2'
  gem 'spring-watcher-listen', '2.0.1'
end

group :test do
  gem 'rails-controller-testing', '1.0.2'
  gem 'minitest',                 '5.10.3'
  gem 'minitest-reporters',       '1.1.14'
  gem 'guard',                    '2.13.0'
  gem 'guard-minitest',           '2.4.4'
end

group :production do
  gem 'pg', '0.20.0'
end

# Windows does not include zoneinfo files, so bundle the tzinfo-data gem
gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby]

Gemfile.lock
pastebin

PS The toaster does not allow placing the entire Gemfile.lock, so the link to Pastebin.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
R
Roman Ivanov, 2019-06-25
@dogocat

Maybe someone will be interested. It seems to have worked. Let's see what will happen next. Installed gem rails 5.2.3 in Gemfile. Next bundle update. While it works.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question