Не знаю точно, почему или как это начало происходить, но внезапно мое приложение, которое нормально работало в моей локальной среде, больше не работает.
Моя локальная среда разработки: MacOS Sierra 10.12.5
Приложение использует:
- рельсы 5.2.2
- Ruby 2.5.0
- rbenv
При каждом запускерельсы или рельсы c приложение запускается и сразу завершается сбоем со следующим выводом:
➜ pwf-site git:(master) ✗ rails c
Traceback (most recent call last):
67: from bin/rails:4:in `<main>'
66: from /Users/herbyraynaud/code/personal/pwf-site/vendor/bundle/ruby/2.5.0/gems/activesupport-5.2.2/lib/active_support/dependencies.rb:291:in `require'
65: from /Users/herbyraynaud/code/personal/pwf-site/vendor/bundle/ruby/2.5.0/gems/activesupport-5.2.2/lib/active_support/dependencies.rb:257:in `load_dependency'
64: from /Users/herbyraynaud/code/personal/pwf-site/vendor/bundle/ruby/2.5.0/gems/activesupport-5.2.2/lib/active_support/dependencies.rb:291:in `block in require'
63: from /Users/herbyraynaud/code/personal/pwf-site/vendor/bundle/ruby/2.5.0/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:29:in `require'
62: from /Users/herbyraynaud/code/personal/pwf-site/vendor/bundle/ruby/2.5.0/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:20:in `require_with_bootsnap_lfi'
61: from /Users/herbyraynaud/code/personal/pwf-site/vendor/bundle/ruby/2.5.0/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/loaded_features_index.rb:65:in `register'
60: from /Users/herbyraynaud/code/personal/pwf-site/vendor/bundle/ruby/2.5.0/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21:in `block in require_with_bootsnap_lfi'
59: from /Users/herbyraynaud/code/personal/pwf-site/vendor/bundle/ruby/2.5.0/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21:in `require'
58: from /Users/herbyraynaud/code/personal/pwf-site/vendor/bundle/ruby/2.5.0/gems/railties-5.2.2/lib/rails/commands.rb:18:in `<main>'
57: from /Users/herbyraynaud/code/personal/pwf-site/vendor/bundle/ruby/2.5.0/gems/railties-5.2.2/lib/rails/command.rb:46:in `invoke'
56: from /Users/herbyraynaud/code/personal/pwf-site/vendor/bundle/ruby/2.5.0/gems/railties-5.2.2/lib/rails/command/base.rb:65:in `perform'
55: from /Users/herbyraynaud/code/personal/pwf-site/vendor/bundle/ruby/2.5.0/gems/thor-0.20.3/lib/thor.rb:387:in `dispatch'
54: from /Users/herbyraynaud/code/personal/pwf-site/vendor/bundle/ruby/2.5.0/gems/thor-0.20.3/lib/thor/invocation.rb:126:in `invoke_command'
53: from /Users/herbyraynaud/code/personal/pwf-site/vendor/bundle/ruby/2.5.0/gems/thor-0.20.3/lib/thor/command.rb:27:in `run'
52: from /Users/herbyraynaud/code/personal/pwf-site/vendor/bundle/ruby/2.5.0/gems/railties-5.2.2/lib/rails/commands/console/console_command.rb:95:in `perform'
51: from /Users/herbyraynaud/code/personal/pwf-site/vendor/bundle/ruby/2.5.0/gems/railties-5.2.2/lib/rails/command/actions.rb:18:in `require_application_and_environment!'
50: from /Users/herbyraynaud/code/personal/pwf-site/vendor/bundle/ruby/2.5.0/gems/railties-5.2.2/lib/rails/application.rb:337:in `require_environment!'
49: from /Users/herbyraynaud/code/personal/pwf-site/vendor/bundle/ruby/2.5.0/gems/activesupport-5.2.2/lib/active_support/dependencies.rb:291:in `require'
48: from /Users/herbyraynaud/code/personal/pwf-site/vendor/bundle/ruby/2.5.0/gems/activesupport-5.2.2/lib/active_support/dependencies.rb:257:in `load_dependency'
47: from /Users/herbyraynaud/code/personal/pwf-site/vendor/bundle/ruby/2.5.0/gems/activesupport-5.2.2/lib/active_support/dependencies.rb:291:in `block in require'
46: from /Users/herbyraynaud/code/personal/pwf-site/vendor/bundle/ruby/2.5.0/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:29:in `require'
45: from /Users/herbyraynaud/code/personal/pwf-site/vendor/bundle/ruby/2.5.0/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:20:in `require_with_bootsnap_lfi'
44: from /Users/herbyraynaud/code/personal/pwf-site/vendor/bundle/ruby/2.5.0/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/loaded_features_index.rb:65:in `register'
43: from /Users/herbyraynaud/code/personal/pwf-site/vendor/bundle/ruby/2.5.0/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21:in `block in require_with_bootsnap_lfi'
42: from /Users/herbyraynaud/code/personal/pwf-site/vendor/bundle/ruby/2.5.0/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21:in `require'
41: from /Users/herbyraynaud/code/personal/pwf-site/config/environment.rb:5:in `<main>'
40: from /Users/herbyraynaud/code/personal/pwf-site/vendor/bundle/ruby/2.5.0/gems/railties-5.2.2/lib/rails/application.rb:361:in `initialize!'
39: from /Users/herbyraynaud/code/personal/pwf-site/vendor/bundle/ruby/2.5.0/gems/railties-5.2.2/lib/rails/initializable.rb:60:in `run_initializers'
38: from /Users/herbyraynaud/.rbenv/versions/2.5.0/lib/ruby/2.5.0/tsort.rb:205:in `tsort_each'
37: from /Users/herbyraynaud/.rbenv/versions/2.5.0/lib/ruby/2.5.0/tsort.rb:226:in `tsort_each'
36: from /Users/herbyraynaud/.rbenv/versions/2.5.0/lib/ruby/2.5.0/tsort.rb:347:in `each_strongly_connected_component'
35: from /Users/herbyraynaud/.rbenv/versions/2.5.0/lib/ruby/2.5.0/tsort.rb:347:in `call'
34: from /Users/herbyraynaud/.rbenv/versions/2.5.0/lib/ruby/2.5.0/tsort.rb:347:in `each'
33: from /Users/herbyraynaud/.rbenv/versions/2.5.0/lib/ruby/2.5.0/tsort.rb:349:in `block in each_strongly_connected_component'
32: from /Users/herbyraynaud/.rbenv/versions/2.5.0/lib/ruby/2.5.0/tsort.rb:431:in `each_strongly_connected_component_from'
31: from /Users/herbyraynaud/.rbenv/versions/2.5.0/lib/ruby/2.5.0/tsort.rb:350:in `block (2 levels) in each_strongly_connected_component'
30: from /Users/herbyraynaud/.rbenv/versions/2.5.0/lib/ruby/2.5.0/tsort.rb:228:in `block in tsort_each'
29: from /Users/herbyraynaud/code/personal/pwf-site/vendor/bundle/ruby/2.5.0/gems/railties-5.2.2/lib/rails/initializable.rb:61:in `block in run_initializers'
28: from /Users/herbyraynaud/code/personal/pwf-site/vendor/bundle/ruby/2.5.0/gems/railties-5.2.2/lib/rails/initializable.rb:32:in `run'
27: from /Users/herbyraynaud/code/personal/pwf-site/vendor/bundle/ruby/2.5.0/gems/railties-5.2.2/lib/rails/initializable.rb:32:in `instance_exec'
26: from /Users/herbyraynaud/code/personal/pwf-site/vendor/bundle/ruby/2.5.0/gems/railties-5.2.2/lib/rails/application/finisher.rb:130:in `block in <module:Finisher>'
25: from /Users/herbyraynaud/code/personal/pwf-site/vendor/bundle/ruby/2.5.0/gems/railties-5.2.2/lib/rails/application/routes_reloader.rb:10:in `execute'
24: from /Users/herbyraynaud/code/personal/pwf-site/vendor/bundle/ruby/2.5.0/gems/activesupport-5.2.2/lib/active_support/file_update_checker.rb:83:in `execute'
23: from /Users/herbyraynaud/code/personal/pwf-site/vendor/bundle/ruby/2.5.0/gems/railties-5.2.2/lib/rails/application/routes_reloader.rb:30:in `block in updater'
22: from /Users/herbyraynaud/code/personal/pwf-site/vendor/bundle/ruby/2.5.0/gems/railties-5.2.2/lib/rails/application/routes_reloader.rb:20:in `reload!'
21: from /Users/herbyraynaud/code/personal/pwf-site/vendor/bundle/ruby/2.5.0/gems/railties-5.2.2/lib/rails/application/routes_reloader.rb:41:in `load_paths'
20: from /Users/herbyraynaud/code/personal/pwf-site/vendor/bundle/ruby/2.5.0/gems/railties-5.2.2/lib/rails/application/routes_reloader.rb:41:in `each'
19: from /Users/herbyraynaud/code/personal/pwf-site/vendor/bundle/ruby/2.5.0/gems/railties-5.2.2/lib/rails/application/routes_reloader.rb:41:in `block in load_paths'
18: from /Users/herbyraynaud/code/personal/pwf-site/vendor/bundle/ruby/2.5.0/gems/activesupport-5.2.2/lib/active_support/dependencies.rb:285:in `load'
17: from /Users/herbyraynaud/code/personal/pwf-site/vendor/bundle/ruby/2.5.0/gems/activesupport-5.2.2/lib/active_support/dependencies.rb:257:in `load_dependency'
16: from /Users/herbyraynaud/code/personal/pwf-site/vendor/bundle/ruby/2.5.0/gems/activesupport-5.2.2/lib/active_support/dependencies.rb:285:in `block in load'
15: from /Users/herbyraynaud/code/personal/pwf-site/vendor/bundle/ruby/2.5.0/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:50:in `load'
14: from /Users/herbyraynaud/code/personal/pwf-site/vendor/bundle/ruby/2.5.0/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:50:in `load'
13: from /Users/herbyraynaud/code/personal/pwf-site/config/routes.rb:1:in `<main>'
12: from /Users/herbyraynaud/code/personal/pwf-site/vendor/bundle/ruby/2.5.0/gems/activesupport-5.2.2/lib/active_support/dependencies.rb:291:in `require'
11: from /Users/herbyraynaud/code/personal/pwf-site/vendor/bundle/ruby/2.5.0/gems/activesupport-5.2.2/lib/active_support/dependencies.rb:257:in `load_dependency'
10: from /Users/herbyraynaud/code/personal/pwf-site/vendor/bundle/ruby/2.5.0/gems/activesupport-5.2.2/lib/active_support/dependencies.rb:291:in `block in require'
9: from /Users/herbyraynaud/code/personal/pwf-site/vendor/bundle/ruby/2.5.0/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:29:in `require'
8: from /Users/herbyraynaud/code/personal/pwf-site/vendor/bundle/ruby/2.5.0/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:20:in `require_with_bootsnap_lfi'
7: from /Users/herbyraynaud/code/personal/pwf-site/vendor/bundle/ruby/2.5.0/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/loaded_features_index.rb:65:in `register'
6: from /Users/herbyraynaud/code/personal/pwf-site/vendor/bundle/ruby/2.5.0/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21:in `block in require_with_bootsnap_lfi'
5: from /Users/herbyraynaud/code/personal/pwf-site/vendor/bundle/ruby/2.5.0/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21:in `require'
4: from /Users/herbyraynaud/code/personal/pwf-site/vendor/bundle/ruby/2.5.0/gems/sidekiq-5.2.5/lib/sidekiq/web.rb:13:in `<main>'
3: from /Users/herbyraynaud/code/personal/pwf-site/vendor/bundle/ruby/2.5.0/gems/activesupport-5.2.2/lib/active_support/dependencies.rb:291:in `require'
2: from /Users/herbyraynaud/code/personal/pwf-site/vendor/bundle/ruby/2.5.0/gems/activesupport-5.2.2/lib/active_support/dependencies.rb:257:in `load_dependency'
1: from /Users/herbyraynaud/code/personal/pwf-site/vendor/bundle/ruby/2.5.0/gems/activesupport-5.2.2/lib/active_support/dependencies.rb:291:in `block in require'
/Users/herbyraynaud/code/personal/pwf-site/vendor/bundle/ruby/2.5.0/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32:in `require': cannot load such file -- rack/protection (LoadError)
стойка защиты драгоценный камень является частью Sinatra , поэтому я попыталсядобавить sinatra к Gemfile, а также выполнить обычную установку gem, но похоже, что это была красная селедка.
Вот вещи, которые я пробовал в различных комбинациях и порядках.и ничего не работает,
- комплект чистых --force
- gem uninstall --all
- gem нетронутый --all
- удаление моих приложенийкаталог vendor / bundle
- удалил мои приложения / каталог tmp
- непосредственно добавив sinatra в мой gem-файл
- gem uninstall sinatra
- gem install sinatra
- gem install rack-protection
- обновление gem --system
Существуют аналогичные проблемы, свидетельствующие о том, что проблема связана с гемом bootsnap, но они оказались красной селедкой, удалив гем и отключив загрузчик в файле boot.rb, но это не помогло.
Наконец, я могу создать новое приложение rails, кроме устранения проблемы с версией sqlite3. Я могу запустить сервер и консоль без проблем.
Это наводит меня на мысль, что проблема должна заключаться в том, что какие-то проблемы с драгоценными камнями привели к возникновению проблемы.
Эта проблема - полная ошибка.
Вот мой Gemfile
source 'https://rubygems.org'
ruby "2.5.0"
gem 'rails', '5.2.2'
gem 'bootsnap'
gem 'devise'
gem "simple_form"
gem 'simple_enum', git: 'git://github.com/lwe/simple_enum.git'
gem 'kaminari'
gem 'activerecord-import'
gem 'font-awesome-sass', '~> 5.2.0'
gem 'pg'
gem 'puma', '~> 3.7'
gem 'activeadmin'
gem 'activeadmin_blaze_theme'
gem 'inherited_resources'
gem 'stripe'
gem "aws-sdk-s3", require: false
gem "image_processing", "~> 1.2"
gem "prawn"#, :git => "git://github.com/prawnpdf/prawn.git"
gem 'prawn-table' #, '~> 0.1.0'
gem "bootstrap", ">= 4.3.1"
gem 'jquery-rails'
gem "chosen-rails"
gem 'rails-observers'
gem 'combine_pdf'
gem 'figaro'
gem 'exception_handler'
gem "chartkick"
gem 'activeadmin_medium_editor', git: "git://github.com/hraynaud/activeadmin_medium_editor.git"
gem 'sidekiq'
group :development, :test do
gem "better_errors"
gem "hirb"
gem 'rspec'
gem "rspec-rails"
gem 'factory_bot'
gem "factory_bot_rails"
gem "faker"
gem "populator"
gem "pry"
gem "pry-nav"
gem "fakeweb", git: "https://github.com/chrisk/fakeweb.git"
gem "letter_opener"
end
group :test do
gem 'capybara'
gem "guard-rspec"
gem "rspec-activemodel-mocks"
gem "database_cleaner"
gem "launchy"
gem 'simplecov', :require => false
gem 'selenium-webdriver'
gem 'chromedriver-helper'
end