skip to Main Content

Rails console won’t start in development. Rails server does start but not console. Running Ruby 2.5.1, Rails 5.2.2.1

Tried a number of similar looking errors on this site for the server not starting but could not find similar error for console. Tried commenting out both spring gems. No change. Tried commenting out bootsnap gem and that didn’t work either.

error

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'

Any ideas?

2

Answers


  1. Try cleaning bootsnap cache (rm -rf tmp/cache/bootsnap-*), if that does not help – reinstall ruby

    Login or Signup to reply.
  2. This error message

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

    tells you that Ruby doesn’t find that version of Readline anymore which it was built against:

    The reason might be that you ran brew upgrade recently and updated readline to version 8 on your machine, but Ruby is still expecting version 7.

    You have two options:

    1. De-install Ruby on your machine and re-install it. This would build Ruby against your latest readline version. Or
    2. Add a symlink that allows Ruby to find your current version of readline when it is looking for the old version.

    To add that symlink open your terminal and simply run:

    ln -s /usr/local/opt/readline/lib/libreadline.8.0.dylib /usr/local/opt/readline/lib/libreadline.7.dylib
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search