Как исправить консоль Rails 5.2, которая не запускается - PullRequest
0 голосов
/ 29 марта 2019

Консоль Rails не запускается в разработке.Сервер Rails запускается, но не консоль.Запуск Ruby 2.5.1, Rails 5.2.2.1

Попробовал несколько похожих ошибок на этом сайте, когда сервер не запускался, но не смог найти похожую ошибку для консоли.Попробовал закомментировать обе весенние жемчужины.Без изменений.Попробовал закомментировать гем bootnap, и он тоже не сработал.

ошибка

rails c
Running via Spring preloader in process 772
Traceback (most recent call last):
    50: from -e:1:in `<main>'
    49: from /Users/me/.rvm/rubies/ruby-2.5.1/lib/ruby/site_ruby/2.5.0/rubygems/core_ext/kernel_require.rb:59:in `require'
    48: from /Users/me/.rvm/rubies/ruby-2.5.1/lib/ruby/site_ruby/2.5.0/rubygems/core_ext/kernel_require.rb:59:in `require'
    47: from /Users/me/.rvm/rubies/ruby-2.5.1/lib/ruby/gems/2.5.0/gems/activesupport-5.2.2.1/lib/active_support/dependencies.rb:285:in `load'
    46: from /Users/me/.rvm/rubies/ruby-2.5.1/lib/ruby/gems/2.5.0/gems/activesupport-5.2.2.1/lib/active_support/dependencies.rb:257:in `load_dependency'
    45: from /Users/me/.rvm/rubies/ruby-2.5.1/lib/ruby/gems/2.5.0/gems/activesupport-5.2.2.1/lib/active_support/dependencies.rb:285:in `block in load'
    44: from /Users/me/.rvm/rubies/ruby-2.5.1/lib/ruby/gems/2.5.0/gems/bootsnap-1.4.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:54:in `load'
    43: from /Users/me/.rvm/rubies/ruby-2.5.1/lib/ruby/gems/2.5.0/gems/bootsnap-1.4.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:54:in `load'
    42: from /Users/me/Documents/projects/hosting/principle/bin/rails:9:in `<main>'
    41: from /Users/me/.rvm/rubies/ruby-2.5.1/lib/ruby/gems/2.5.0/gems/activesupport-5.2.2.1/lib/active_support/dependencies.rb:291:in `require'
    40: from /Users/me/.rvm/rubies/ruby-2.5.1/lib/ruby/gems/2.5.0/gems/activesupport-5.2.2.1/lib/active_support/dependencies.rb:257:in `load_dependency'
    39: from /Users/me/.rvm/rubies/ruby-2.5.1/lib/ruby/gems/2.5.0/gems/activesupport-5.2.2.1/lib/active_support/dependencies.rb:291:in `block in require'
    38: from /Users/me/.rvm/rubies/ruby-2.5.1/lib/ruby/gems/2.5.0/gems/bootsnap-1.4.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:30:in `require'
    37: from /Users/me/.rvm/rubies/ruby-2.5.1/lib/ruby/gems/2.5.0/gems/bootsnap-1.4.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21:in `require_with_bootsnap_lfi'
    36: from /Users/me/.rvm/rubies/ruby-2.5.1/lib/ruby/gems/2.5.0/gems/bootsnap-1.4.2/lib/bootsnap/load_path_cache/loaded_features_index.rb:92:in `register'
    35: from /Users/me/.rvm/rubies/ruby-2.5.1/lib/ruby/gems/2.5.0/gems/bootsnap-1.4.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `block in require_with_bootsnap_lfi'
    34: from /Users/me/.rvm/rubies/ruby-2.5.1/lib/ruby/gems/2.5.0/gems/bootsnap-1.4.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `require'
    33: from /Users/me/.rvm/rubies/ruby-2.5.1/lib/ruby/gems/2.5.0/gems/railties-5.2.2.1/lib/rails/commands.rb:18:in `<main>'
    32: from /Users/me/.rvm/rubies/ruby-2.5.1/lib/ruby/gems/2.5.0/gems/railties-5.2.2.1/lib/rails/command.rb:44:in `invoke'
    31: from /Users/me/.rvm/rubies/ruby-2.5.1/lib/ruby/gems/2.5.0/gems/railties-5.2.2.1/lib/rails/command.rb:70:in `find_by_namespace'
    30: from /Users/me/.rvm/rubies/ruby-2.5.1/lib/ruby/gems/2.5.0/gems/railties-5.2.2.1/lib/rails/command/behavior.rb:79:in `lookup'
    29: from /Users/me/.rvm/rubies/ruby-2.5.1/lib/ruby/gems/2.5.0/gems/railties-5.2.2.1/lib/rails/command/behavior.rb:79:in `each'
    28: from /Users/me/.rvm/rubies/ruby-2.5.1/lib/ruby/gems/2.5.0/gems/railties-5.2.2.1/lib/rails/command/behavior.rb:80:in `block in lookup'
    27: from /Users/me/.rvm/rubies/ruby-2.5.1/lib/ruby/gems/2.5.0/gems/railties-5.2.2.1/lib/rails/command/behavior.rb:80:in `each'
    26: from /Users/me/.rvm/rubies/ruby-2.5.1/lib/ruby/gems/2.5.0/gems/railties-5.2.2.1/lib/rails/command/behavior.rb:84:in `block (2 levels) in lookup'
    25: from /Users/me/.rvm/rubies/ruby-2.5.1/lib/ruby/gems/2.5.0/gems/activesupport-5.2.2.1/lib/active_support/dependencies.rb:291:in `require'
    24: from /Users/me/.rvm/rubies/ruby-2.5.1/lib/ruby/gems/2.5.0/gems/activesupport-5.2.2.1/lib/active_support/dependencies.rb:257:in `load_dependency'
    23: from /Users/me/.rvm/rubies/ruby-2.5.1/lib/ruby/gems/2.5.0/gems/activesupport-5.2.2.1/lib/active_support/dependencies.rb:291:in `block in require'
    22: from /Users/me/.rvm/rubies/ruby-2.5.1/lib/ruby/gems/2.5.0/gems/bootsnap-1.4.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:30:in `require'
    21: from /Users/me/.rvm/rubies/ruby-2.5.1/lib/ruby/gems/2.5.0/gems/bootsnap-1.4.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21:in `require_with_bootsnap_lfi'
    20: from /Users/me/.rvm/rubies/ruby-2.5.1/lib/ruby/gems/2.5.0/gems/bootsnap-1.4.2/lib/bootsnap/load_path_cache/loaded_features_index.rb:92:in `register'
    19: from /Users/me/.rvm/rubies/ruby-2.5.1/lib/ruby/gems/2.5.0/gems/bootsnap-1.4.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `block in require_with_bootsnap_lfi'
    18: from /Users/me/.rvm/rubies/ruby-2.5.1/lib/ruby/gems/2.5.0/gems/bootsnap-1.4.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `require'
    17: from /Users/me/.rvm/rubies/ruby-2.5.1/lib/ruby/gems/2.5.0/gems/railties-5.2.2.1/lib/rails/commands/console/console_command.rb:4:in `<main>'
    16: from /Users/me/.rvm/rubies/ruby-2.5.1/lib/ruby/gems/2.5.0/gems/activesupport-5.2.2.1/lib/active_support/dependencies.rb:291:in `require'
    15: from /Users/me/.rvm/rubies/ruby-2.5.1/lib/ruby/gems/2.5.0/gems/activesupport-5.2.2.1/lib/active_support/dependencies.rb:257:in `load_dependency'
    14: from /Users/me/.rvm/rubies/ruby-2.5.1/lib/ruby/gems/2.5.0/gems/activesupport-5.2.2.1/lib/active_support/dependencies.rb:291:in `block in require'
    13: from /Users/me/.rvm/rubies/ruby-2.5.1/lib/ruby/gems/2.5.0/gems/bootsnap-1.4.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:30:in `require'
    12: from /Users/me/.rvm/rubies/ruby-2.5.1/lib/ruby/gems/2.5.0/gems/bootsnap-1.4.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21:in `require_with_bootsnap_lfi'
    11: from /Users/me/.rvm/rubies/ruby-2.5.1/lib/ruby/gems/2.5.0/gems/bootsnap-1.4.2/lib/bootsnap/load_path_cache/loaded_features_index.rb:92:in `register'
    10: from /Users/me/.rvm/rubies/ruby-2.5.1/lib/ruby/gems/2.5.0/gems/bootsnap-1.4.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `block in require_with_bootsnap_lfi'
     9: from /Users/me/.rvm/rubies/ruby-2.5.1/lib/ruby/gems/2.5.0/gems/bootsnap-1.4.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `require'
     8: from /Users/me/.rvm/rubies/ruby-2.5.1/lib/ruby/2.5.0/irb/completion.rb:10:in `<main>'
     7: from /Users/me/.rvm/rubies/ruby-2.5.1/lib/ruby/gems/2.5.0/gems/activesupport-5.2.2.1/lib/active_support/dependencies.rb:291:in `require'
     6: from /Users/me/.rvm/rubies/ruby-2.5.1/lib/ruby/gems/2.5.0/gems/activesupport-5.2.2.1/lib/active_support/dependencies.rb:257:in `load_dependency'
     5: from /Users/me/.rvm/rubies/ruby-2.5.1/lib/ruby/gems/2.5.0/gems/activesupport-5.2.2.1/lib/active_support/dependencies.rb:291:in `block in require'
     4: from /Users/me/.rvm/rubies/ruby-2.5.1/lib/ruby/gems/2.5.0/gems/bootsnap-1.4.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:30:in `require'
     3: from /Users/me/.rvm/rubies/ruby-2.5.1/lib/ruby/gems/2.5.0/gems/bootsnap-1.4.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21:in `require_with_bootsnap_lfi'
     2: from /Users/me/.rvm/rubies/ruby-2.5.1/lib/ruby/gems/2.5.0/gems/bootsnap-1.4.2/lib/bootsnap/load_path_cache/loaded_features_index.rb:92:in `register'
     1: from /Users/me/.rvm/rubies/ruby-2.5.1/lib/ruby/gems/2.5.0/gems/bootsnap-1.4.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `block in require_with_bootsnap_lfi'
/Users/me/.rvm/rubies/ruby-2.5.1/lib/ruby/gems/2.5.0/gems/bootsnap-1.4.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `require': dlopen(/Users/me/.rvm/rubies/ruby-2.5.1/lib/ruby/2.5.0/x86_64-darwin17/readline.bundle, 9): Library not loaded: /usr/local/opt/readline/lib/libreadline.7.dylib (LoadError)
  Referenced from: /Users/me/.rvm/rubies/ruby-2.5.1/lib/ruby/2.5.0/x86_64-darwin17/readline.bundle
  Reason: image not found - /Users/me/.rvm/rubies/ruby-2.5.1/lib/ruby/2.5.0/x86_64-darwin17/readline.bundle

Gemfile:

source 'https://rubygems.org'
git_source(:github) { |repo| "https://github.com/#{repo}.git" }

ruby '2.5.1'


gem 'rails', '~> 5.2.2', '>= 5.2.2.1'
gem 'pg', '>= 0.18', '< 2.0'
gem 'puma', '~> 3.11'
gem 'sass-rails', '~> 5.0'
gem 'uglifier', '>= 1.3.0'
gem 'coffee-rails', '~> 4.2'
gem 'turbolinks', '~> 5'
gem 'jbuilder', '~> 2.5'
gem 'bootsnap', '>= 1.1.0', require: false

group :development, :test do
  gem 'byebug', platforms: [:mri, :mingw, :x64_mingw]
end

group :development do
  gem 'web-console', '>= 3.3.0'
  gem 'listen', '>= 3.0.5', '< 3.2'
  gem 'spring'
  gem 'spring-watcher-listen', '~> 2.0.0'
end

group :test do
  gem 'capybara', '>= 2.15'
  gem 'selenium-webdriver'
  gem 'chromedriver-helper'
end

gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby]

gem 'administrate', github: 'excid3/administrate', branch: 'zeitwerk'
gem 'bootstrap', '~> 4.3', '>= 4.3.1'
gem 'devise', '~> 4.6', '>= 4.6.1'
gem 'devise-bootstrapped', github: 'excid3/devise-bootstrapped', branch: 'bootstrap4'
gem 'devise_masquerade', '~> 0.6.2'
gem 'font-awesome-sass', '~> 5.6', '>= 5.6.1'
gem 'friendly_id', '~> 5.2', '>= 5.2.5'
gem 'gravatar_image_tag', github: 'mdeering/gravatar_image_tag'
gem 'mini_magick', '~> 4.9', '>= 4.9.2'
gem 'name_of_person', '~> 1.1'
gem 'omniauth-facebook', '~> 5.0'
gem 'omniauth-github', '~> 1.3'
gem 'omniauth-twitter', '~> 1.4'
gem 'sidekiq', '~> 5.2', '>= 5.2.5'
gem 'sitemap_generator', '~> 6.0', '>= 6.0.1'
gem 'whenever', require: false
gem 'webpacker', '~> 4.0.1'

Есть идеи?

Ответы [ 2 ]

1 голос
/ 29 марта 2019

Это сообщение об ошибке

Library not loaded: /usr/local/opt/readline/lib/libreadline.7.dylib

говорит вам, что Ruby больше не находит ту версию Readline, против которой она была построена:

Возможно, причина в том, что вы недавно запустили brew upgrade и обновили readline до версии 8 на своем компьютере, но Ruby все еще ожидает версию 7.

У вас есть два варианта:

  1. Удалите Ruby с вашего компьютера и установите заново. Это создаст Ruby против вашей последней версии readline. Или
  2. Добавьте символическую ссылку, которая позволяет Ruby найти вашу текущую версию readline, когда она ищет старую версию.

Чтобы добавить эту символическую ссылку, откройте свой терминал и просто запустите:

ln -s /usr/local/opt/readline/lib/libreadline.8.0.dylib /usr/local/opt/readline/lib/libreadline.7.dylib
0 голосов
/ 29 марта 2019

Попробуйте очистить кэш начальной загрузки (rm -rf tmp/cache/bootsnap-*), если это не поможет - переустановите ruby ​​

Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...