Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How Do I Correct An Error with rails console command?

When I'm in the root directory of my Rails app I can successfully execute rails server. However when I try to do rails console or rails c I get the following error.

[myrailsapp (master)]$ rails c
/Users/myuserid/.rvm/rubies/ruby-2.3.0/lib/ruby/2.3.0/irb/completion.rb:10:in `require': dlopen(/Users/myuserid/.rvm/rubies/ruby-2.3.0/lib/ruby/2.3.0/x86_64-darwin15/readline.bundle, 9): Library not loaded: /usr/local/opt/readline/lib/libreadline.6.dylib (LoadError)
  Referenced from: /Users/myuserid/.rvm/rubies/ruby-2.3.0/lib/ruby/2.3.0/x86_64-darwin15/readline.bundle
  Reason: image not found - /Users/myuserid/.rvm/rubies/ruby-2.3.0/lib/ruby/2.3.0/x86_64-darwin15/readline.bundle
    from /Users/myuserid/.rvm/rubies/ruby-2.3.0/lib/ruby/2.3.0/irb/completion.rb:10:in `<top (required)>'
    from /Users/myuserid/.rvm/gems/ruby-2.3.0@mygemset/gems/railties-4.2.5.2/lib/rails/commands/console.rb:3:in `require'
    from /Users/myuserid/.rvm/gems/ruby-2.3.0@mygemset/gems/railties-4.2.5.2/lib/rails/commands/console.rb:3:in `<top (required)>'
    from /Users/myuserid/.rvm/gems/ruby-2.3.0@mygemset/gems/railties-4.2.5.2/lib/rails/commands/commands_tasks.rb:123:in `require'
    from /Users/myuserid/.rvm/gems/ruby-2.3.0@mygemset/gems/railties-4.2.5.2/lib/rails/commands/commands_tasks.rb:123:in `require_command!'
    from /Users/myuserid/.rvm/gems/ruby-2.3.0@mygemset/gems/railties-4.2.5.2/lib/rails/commands/commands_tasks.rb:58:in `console'
    from /Users/myuserid/.rvm/gems/ruby-2.3.0@mygemset/gems/railties-4.2.5.2/lib/rails/commands/commands_tasks.rb:39:in `run_command!'
    from /Users/myuserid/.rvm/gems/ruby-2.3.0@mygemset/gems/railties-4.2.5.2/lib/rails/commands.rb:17:in `<top (required)>'
    from bin/rails:4:in `require'
    from bin/rails:4:in `<main>'

I have done web searches but I have not found any solutions for this type of error.

like image 807
xxx Avatar asked Feb 06 '23 19:02

xxx


1 Answers

brew rm -f readline

brew install readline

brew link readline --force

Reference link: rails console doesn't load due to libreadline

like image 88
Junan Chakma Avatar answered Feb 26 '23 07:02

Junan Chakma