Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Rails Console error after upgrading to Ubuntu 18.04

After upgrading from ubuntu 16.04 to ubuntu 18.04 I am receiving the following error when running rails console from the root directory of rails project. Only the console seems to be affected, I am able to start the puma server without issue.

Running via Spring preloader in process 23887
/home/user/.rvm/gems/ruby-2.4.1/gems/activesupport-5.1.6/lib/active_support/dependencies.rb:292:in `require': libreadline.so.6: cannot open shared object file: No such file or directory - /home/user/.rvm/rubies/ruby-2.4.1/lib/ruby/2.4.0/x86_64-linux/readline.so (LoadError)
    from /home/user/.rvm/gems/ruby-2.4.1/gems/activesupport-5.1.6/lib/active_support/dependencies.rb:292:in `block in require'
    from /home/user/.rvm/gems/ruby-2.4.1/gems/activesupport-5.1.6/lib/active_support/dependencies.rb:258:in `load_dependency'
    from /home/user/.rvm/gems/ruby-2.4.1/gems/activesupport-5.1.6/lib/active_support/dependencies.rb:292:in `require'
    from /home/user/.rvm/rubies/ruby-2.4.1/lib/ruby/2.4.0/irb/completion.rb:10:in `<top (required)>'
    from /home/user/.rvm/gems/ruby-2.4.1/gems/activesupport-5.1.6/lib/active_support/dependencies.rb:292:in `require'
    from /home/user/.rvm/gems/ruby-2.4.1/gems/activesupport-5.1.6/lib/active_support/dependencies.rb:292:in `block in require'
    from /home/user/.rvm/gems/ruby-2.4.1/gems/activesupport-5.1.6/lib/active_support/dependencies.rb:258:in `load_dependency'
    from /home/user/.rvm/gems/ruby-2.4.1/gems/activesupport-5.1.6/lib/active_support/dependencies.rb:292:in `require'
    from /home/user/.rvm/gems/ruby-2.4.1/gems/railties-5.1.6/lib/rails/commands/console/console_command.rb:2:in `<top (required)>'
    from /home/user/.rvm/gems/ruby-2.4.1/gems/activesupport-5.1.6/lib/active_support/dependencies.rb:292:in `require'
    from /home/user/.rvm/gems/ruby-2.4.1/gems/activesupport-5.1.6/lib/active_support/dependencies.rb:292:in `block in require'
    from /home/user/.rvm/gems/ruby-2.4.1/gems/activesupport-5.1.6/lib/active_support/dependencies.rb:258:in `load_dependency'
    from /home/user/.rvm/gems/ruby-2.4.1/gems/activesupport-5.1.6/lib/active_support/dependencies.rb:292:in `require'
    from /home/user/.rvm/gems/ruby-2.4.1/gems/railties-5.1.6/lib/rails/command/behavior.rb:82:in `block (2 levels) in lookup'
    from /home/user/.rvm/gems/ruby-2.4.1/gems/railties-5.1.6/lib/rails/command/behavior.rb:78:in `each'
    from /home/user/.rvm/gems/ruby-2.4.1/gems/railties-5.1.6/lib/rails/command/behavior.rb:78:in `block in lookup'
    from /home/user/.rvm/gems/ruby-2.4.1/gems/railties-5.1.6/lib/rails/command/behavior.rb:77:in `each'
    from /home/user/.rvm/gems/ruby-2.4.1/gems/railties-5.1.6/lib/rails/command/behavior.rb:77:in `lookup'
    from /home/user/.rvm/gems/ruby-2.4.1/gems/railties-5.1.6/lib/rails/command.rb:68:in `find_by_namespace'
    from /home/user/.rvm/gems/ruby-2.4.1/gems/railties-5.1.6/lib/rails/command.rb:42:in `invoke'
    from /home/user/.rvm/gems/ruby-2.4.1/gems/railties-5.1.6/lib/rails/commands.rb:16:in `<top (required)>'
    from /home/user/.rvm/gems/ruby-2.4.1/gems/activesupport-5.1.6/lib/active_support/dependencies.rb:292:in `require'
    from /home/user/.rvm/gems/ruby-2.4.1/gems/activesupport-5.1.6/lib/active_support/dependencies.rb:292:in `block in require'
    from /home/user/.rvm/gems/ruby-2.4.1/gems/activesupport-5.1.6/lib/active_support/dependencies.rb:258:in `load_dependency'
    from /home/user/.rvm/gems/ruby-2.4.1/gems/activesupport-5.1.6/lib/active_support/dependencies.rb:292:in `require'
    from /home/user/dev/projects/SRTrackerMySQL/bin/rails:9:in `<top (required)>'
    from /home/user/.rvm/gems/ruby-2.4.1/gems/activesupport-5.1.6/lib/active_support/dependencies.rb:286:in `load'
    from /home/user/.rvm/gems/ruby-2.4.1/gems/activesupport-5.1.6/lib/active_support/dependencies.rb:286:in `block in load'
    from /home/user/.rvm/gems/ruby-2.4.1/gems/activesupport-5.1.6/lib/active_support/dependencies.rb:258:in `load_dependency'
    from /home/user/.rvm/gems/ruby-2.4.1/gems/activesupport-5.1.6/lib/active_support/dependencies.rb:286:in `load'
    from /home/user/.rvm/rubies/ruby-2.4.1/lib/ruby/site_ruby/2.4.0/rubygems/core_ext/kernel_require.rb:59:in `require'
    from /home/user/.rvm/rubies/ruby-2.4.1/lib/ruby/site_ruby/2.4.0/rubygems/core_ext/kernel_require.rb:59:in `require'
    from -e:1:in `<main>'

I've run bundle install and tried it with new rails projects with both Rails 5.1.6 and Rails 5.2

I also tried running RAILS_ENV=production bundle exec rails console

I'm using Ruby version:

ruby 2.4.1p111 (2017-03-22 revision 58053) [x86_64-linux]
like image 585
James Avatar asked Apr 19 '18 00:04

James


1 Answers

Running the following code on the terminal solved the problem for me:

cd /lib/x86_64-linux-gnu
sudo ln -s libreadline.so.7.0 libreadline.so.6
like image 183
Augusto Carmo Avatar answered Sep 24 '22 02:09

Augusto Carmo