2
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

rails console にエラーが出たが、gem 'rb-readline'で直ったお話

Last updated at Posted at 2018-09-23

##環境

  • Windows Subsystem for Linux 上の Ubuntu18.04
    (Windows10 Home 64bit)
  • rbenv 1.1.1-37-g1c772d5
  • ruby 2.3.3p222 (2016-11-21 revision 56859)
  • rails 5.2.1

##現象
rails newで作成したサンプルアプリにて、いつの間にかrails c すると以下のようにエラーが出るようになった。

$ rails c
/mnt/c/linux_home/.rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/railties-5.2.1/lib/rails/app_loader.rb:53: warning: Insecure world writable dir /mnt/c/linux_home/.rbenv/versions/2.3.3/bin in PATH, mode 040777
Running via Spring preloader in process 831
/mnt/c/linux_home/.rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21:in `require': libreadline.so.6: cannot open shared object file: No such file or directory - /mnt/c/linux_home/.rbenv/versions/2.3.3/lib/ruby/2.3.0/x86_64-linux/readline.so (LoadError)
        from /mnt/c/linux_home/.rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21:in `block in require_with_bootsnap_lfi'
        from /mnt/c/linux_home/.rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/loaded_features_index.rb:65:in `register'
        (以下略)

##やったこと
三行目のlibreadline.so.6: cannot open shared object fileに目を付け検索したところ、こちらの投稿を発見。

参考にしてGemfilegem 'rb-readline'を追加し、bundle installしたところ、正常に起動するようになった。

Gemfile
gem 'rb-readline'

解決はしたが、その後に以下のQiitaの記事も拝見した。

そういえばWSLのUbuntuを16.04から18.04にバージョンアップしたばかりだった。
同じような現象だろうか?(あまり深入りはしたくない)

##参考にさせていただいたページ
https://github.com/rails/rails/issues/26658
https://qiita.com/kure/items/90d6d065e820be528e3f

2
1
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
2
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?