LoginSignup
4
4

More than 5 years have passed since last update.

Ubuntuを18.04にアップグレードしたらRailsが動かなくなったときのメモ

Posted at

起きたこと

Ubuntuを16.04から18.04にアップグレードした後にRailsを動作させようとしたところ、以下のエラーが発生

 % rails s -b 0.0.0.0                                             
    Sorry, you can't use byebug without Readline. To solve this, you need to
    rebuild Ruby with Readline support. If using Ubuntu, try `sudo apt-get
    install libreadline-dev` and then reinstall your Ruby
(略)
history.rb:4:in `require': libreadline.so.6: cannot open shared object file: No such file or directory - .rbenv/versions/2.5.0/lib/ruby/2.5.0/x86_64-linux/readline.so (LoadError)

メッセージを確認すると byebug というライブラリの動作に失敗しているようで、確認したところ以下の通り同様のメッセージを確認

 % byebug                               
    Sorry, you can't use byebug without Readline. To solve this, you need to
    rebuild Ruby with Readline support. If using Ubuntu, try `sudo apt-get
    install libreadline-dev` and then reinstall your Ruby.

やったこと

libreadline.so.6 が読み込めないとのことだったので、読み込み状況を確認すると以下の通り。多分.7にアップグレードされたせい?か?

% ldconfig -p | grep libread
    libreadline.so.7 (libc6,x86-64) => /lib/x86_64-linux-gnu/libreadline.so.7
    libreadline.so (libc6,x86-64) => /usr/lib/x86_64-linux-gnu/libreadline.so

とりあえず以下の通り、シンボリックリンクを貼って対処。これが良いかどうかはよく分からない。

% ln -s /usr/lib/x86_64-linux-gnu/libreadline.so /usr/lib/x86_64-linux-gnu/libreadline.so.6

参考

pryでReadlineがないエラーの解決方法 - Qiita https://qiita.com/kanpou0108/items/0fe67e313c03e87277e7

railsで Sorry, you can't use byebug without Readline ていうエラーになるとき - development log http://makotottn.hatenablog.com/entry/2017/08/24/001250

4
4
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
4
4