1

I am trying to run rails c under my application's folder but I keep getting this error and don't know how to fix it.

Running via Spring preloader in process 15492
Traceback (most recent call last):
        40: from -e:1:in `<main>'
        39: from /usr/local/lib64/ruby/2.5.0/rubygems/core_ext/kernel_require.rb:59:in `require'
        38: from /usr/local/lib64/ruby/2.5.0/rubygems/core_ext/kernel_require.rb:59:in `require'
        37: from /usr/local/lib64/ruby/gems/2.5.0/gems/bootsnap-1.4.7/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:55:in `load'
        36: from /usr/local/lib64/ruby/gems/2.5.0/gems/bootsnap-1.4.7/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:55:in `load'
        35: from /home/youssef/ruby_projects/reddit-clone/bin/rails:9:in `<top (required)>'
        34: from /usr/local/lib64/ruby/gems/2.5.0/gems/zeitwerk-2.4.0/lib/zeitwerk/kernel.rb:34:in `require'
        33: from /usr/local/lib64/ruby/gems/2.5.0/gems/bootsnap-1.4.7/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:31:in `require'
        32: from /usr/local/lib64/ruby/gems/2.5.0/gems/bootsnap-1.4.7/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `require_with_bootsnap_lfi'
        31: from /usr/local/lib64/ruby/gems/2.5.0/gems/bootsnap-1.4.7/lib/bootsnap/load_path_cache/loaded_features_index.rb:92:in `register'
        30: from /usr/local/lib64/ruby/gems/2.5.0/gems/bootsnap-1.4.7/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:23:in `block in require_with_bootsnap_lfi'
        29: from /usr/local/lib64/ruby/gems/2.5.0/gems/bootsnap-1.4.7/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:23:in `require'
        28: from /usr/local/lib64/ruby/gems/2.5.0/gems/railties-6.0.3.2/lib/rails/commands.rb:18:in `<top (required)>'
        27: from /usr/local/lib64/ruby/gems/2.5.0/gems/railties-6.0.3.2/lib/rails/command.rb:44:in `invoke'
        26: from /usr/local/lib64/ruby/gems/2.5.0/gems/railties-6.0.3.2/lib/rails/command.rb:70:in `find_by_namespace'
        25: from /usr/local/lib64/ruby/gems/2.5.0/gems/railties-6.0.3.2/lib/rails/command/behavior.rb:39:in `lookup'
        24: from /usr/local/lib64/ruby/gems/2.5.0/gems/railties-6.0.3.2/lib/rails/command/behavior.rb:39:in `each'
        23: from /usr/local/lib64/ruby/gems/2.5.0/gems/railties-6.0.3.2/lib/rails/command/behavior.rb:40:in `block in lookup'
        22: from /usr/local/lib64/ruby/gems/2.5.0/gems/railties-6.0.3.2/lib/rails/command/behavior.rb:40:in `each'
        21: from /usr/local/lib64/ruby/gems/2.5.0/gems/railties-6.0.3.2/lib/rails/command/behavior.rb:44:in `block (2 levels) in lookup'
        20: from /usr/local/lib64/ruby/gems/2.5.0/gems/zeitwerk-2.4.0/lib/zeitwerk/kernel.rb:34:in `require'
        19: from /usr/local/lib64/ruby/gems/2.5.0/gems/bootsnap-1.4.7/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:31:in `require'
        18: from /usr/local/lib64/ruby/gems/2.5.0/gems/bootsnap-1.4.7/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `require_with_bootsnap_lfi'
        17: from /usr/local/lib64/ruby/gems/2.5.0/gems/bootsnap-1.4.7/lib/bootsnap/load_path_cache/loaded_features_index.rb:92:in `register'
        16: from /usr/local/lib64/ruby/gems/2.5.0/gems/bootsnap-1.4.7/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:23:in `block in require_with_bootsnap_lfi'
        15: from /usr/local/lib64/ruby/gems/2.5.0/gems/bootsnap-1.4.7/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:23:in `require'
        14: from /usr/local/lib64/ruby/gems/2.5.0/gems/railties-6.0.3.2/lib/rails/commands/console/console_command.rb:4:in `<top (required)>'
        13: from /usr/local/lib64/ruby/gems/2.5.0/gems/zeitwerk-2.4.0/lib/zeitwerk/kernel.rb:34:in `require'
        12: from /usr/local/lib64/ruby/gems/2.5.0/gems/bootsnap-1.4.7/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:31:in `require'
        11: from /usr/local/lib64/ruby/gems/2.5.0/gems/bootsnap-1.4.7/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `require_with_bootsnap_lfi'
        10: from /usr/local/lib64/ruby/gems/2.5.0/gems/bootsnap-1.4.7/lib/bootsnap/load_path_cache/loaded_features_index.rb:92:in `register'
         9: from /usr/local/lib64/ruby/gems/2.5.0/gems/bootsnap-1.4.7/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:23:in `block in require_with_bootsnap_lfi'
         8: from /usr/local/lib64/ruby/gems/2.5.0/gems/bootsnap-1.4.7/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:23:in `require'
         7: from /usr/local/lib64/ruby/2.5.0/irb/completion.rb:10:in `<top (required)>'
         6: from /usr/local/lib64/ruby/gems/2.5.0/gems/zeitwerk-2.4.0/lib/zeitwerk/kernel.rb:34:in `require'
         5: from /usr/local/lib64/ruby/gems/2.5.0/gems/bootsnap-1.4.7/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:27:in `require'
         4: from /usr/local/lib64/ruby/gems/2.5.0/gems/bootsnap-1.4.7/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:41:in `rescue in require'
         3: from /usr/local/lib64/ruby/gems/2.5.0/gems/bootsnap-1.4.7/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `require_with_bootsnap_lfi'
         2: from /usr/local/lib64/ruby/gems/2.5.0/gems/bootsnap-1.4.7/lib/bootsnap/load_path_cache/loaded_features_index.rb:89:in `register'
         1: from /usr/local/lib64/ruby/gems/2.5.0/gems/bootsnap-1.4.7/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:23:in `block in require_with_bootsnap_lfi'
/usr/local/lib64/ruby/gems/2.5.0/gems/bootsnap-1.4.7/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:23:in `require': cannot load such file -- readline (LoadError)

I tried to delete tmp folder and run rails s again and update bootsnap gem but I keep getting the same error.

1 Answers1

0

I added rb-readline gem and ran bundle install the error was fixed. Thanks to @rmlockerd