'bin/rails console doesn't start
I'm new to Rails & Ruby in general. I was following this guide and got stuck on step 6.3.
my bin/rails console result in error below
/home/gaura/.local/share/gem/ruby/3.0.0/gems/bootsnap-1.11.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:15:in `require': cannot load such file -- rdoc (LoadError)
from /home/gaura/.local/share/gem/ruby/3.0.0/gems/bootsnap-1.11.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:15:in `require'
from /usr/lib/ruby/gems/3.0.0/gems/irb-1.4.1/lib/irb/input-method.rb:17:in `<main>'
from /usr/lib/ruby/gems/3.0.0/gems/irb-1.4.1/lib/irb/context.rb:14:in `require_relative'
from /usr/lib/ruby/gems/3.0.0/gems/irb-1.4.1/lib/irb/context.rb:14:in `<main>'
from /usr/lib/ruby/gems/3.0.0/gems/irb-1.4.1/lib/irb.rb:16:in `require_relative'
from /usr/lib/ruby/gems/3.0.0/gems/irb-1.4.1/lib/irb.rb:16:in `<main>'
from /home/gaura/.local/share/gem/ruby/3.0.0/gems/bootsnap-1.11.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:30:in `require'
from /home/gaura/.local/share/gem/ruby/3.0.0/gems/bootsnap-1.11.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:30:in `require'
from /home/gaura/.local/share/gem/ruby/3.0.0/gems/railties-7.0.2.3/lib/rails/commands/console/console_command.rb:3:in `<main>'
from /home/gaura/.local/share/gem/ruby/3.0.0/gems/bootsnap-1.11.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:30:in `require'
from /home/gaura/.local/share/gem/ruby/3.0.0/gems/bootsnap-1.11.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:30:in `require'
from /home/gaura/.local/share/gem/ruby/3.0.0/gems/railties-7.0.2.3/lib/rails/command/behavior.rb:44:in `block (2 levels) in lookup'
from /home/gaura/.local/share/gem/ruby/3.0.0/gems/railties-7.0.2.3/lib/rails/command/behavior.rb:40:in `each'
from /home/gaura/.local/share/gem/ruby/3.0.0/gems/railties-7.0.2.3/lib/rails/command/behavior.rb:40:in `block in lookup'
from /home/gaura/.local/share/gem/ruby/3.0.0/gems/railties-7.0.2.3/lib/rails/command/behavior.rb:39:in `each'
from /home/gaura/.local/share/gem/ruby/3.0.0/gems/railties-7.0.2.3/lib/rails/command/behavior.rb:39:in `lookup'
from /home/gaura/.local/share/gem/ruby/3.0.0/gems/railties-7.0.2.3/lib/rails/command.rb:73:in `find_by_namespace'
from /home/gaura/.local/share/gem/ruby/3.0.0/gems/railties-7.0.2.3/lib/rails/command.rb:46:in `invoke'
from /home/gaura/.local/share/gem/ruby/3.0.0/gems/railties-7.0.2.3/lib/rails/commands.rb:18:in `<main>'
from /home/gaura/.local/share/gem/ruby/3.0.0/gems/bootsnap-1.11.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:30:in `require'
from /home/gaura/.local/share/gem/ruby/3.0.0/gems/bootsnap-1.11.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:30:in `require'
from bin/rails:4:in `<main>'
what I have tried so far
- googling "can't run rails console" I see some people have similar issue but they have different error
- I tried to change
gem "bootsnap", require: falsein gemfile to begem "bootsnap"but it still output the same error
Edit
As Stefan and ViachMoz pointed out, I seem to be missing "rdoc" gem. The error still exists after I do gem install rdoc but adding gem "rdoc" to gemfile solves the error. Anyway problem solved, Thank you Stefan and ViachMoz.
Solution 1:[1]
Try this one gem install rdoc. Basically you're missing a gem.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | ViachMoz |
