dogocat
@dogocat

Почему Ruby on Rails выдает такую ошибку?

Пытаюсь выполнить команду:
ubuntu:~/environment/sample_app (static-pages) $ rails generate controller StaticPages home help

Результат такой
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)

Последняя строчка ссылается на gem railties-5.1.6 и тут же пишет про неизвестную версию 5.2 . В чём в итоге возникает нестыковка?
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


P.S. Тостер не дает разместить весь Gemfile.lock, поэтому ссылка на Pastebin.
  • Вопрос задан
  • 597 просмотров
Пригласить эксперта
Ответы на вопрос 1
dogocat
@dogocat Автор вопроса
Может кому будет интересно. Вроде сработало. Посмотрим что будет дальше. В Gemfile установил gem rails 5.2.3. Далее bundle update. Пока работает.
Ответ написан
Комментировать
Ваш ответ на вопрос

Войдите, чтобы написать ответ

Похожие вопросы