问题
i got a prompt "Switch to inspect mode." when i do
rails c
it shows
Loading development environment (Rails 6.0.3.4)
Switch to inspect mode.
and I can't do anything only type "exit" to exit this console but I'd like to check last post in my website by typing
@post = Post.last
when i type irb it shows me the same.
ruby 2.7.2p137 (2020-10-01 revision 5445e04352) [x64-mingw32] git-bash I don't know what to do, I've tried to find a solution but futilely. Am I supposed to install linux to learn how to program in ruby on rails? XDD
edit: when i Type: @post = Post.last
it shows
Post Load (0.4ms) SELECT "posts".* FROM "posts" ORDER BY "posts"."id" DESC LIMIT ? [["LIMIT", 1]]
Errno::EBADF (Bad file descriptor)
from C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/irb-1.2.7/lib/irb/input-method.rb:42:in `winsize'
from C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/irb-1.2.7/lib/irb/input-method.rb:42:in `winsize'
from C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/irb-1.2.7/lib/irb.rb:753:in `output_value'
from C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/irb-1.2.7/lib/irb.rb:545:in `block (2 levels) in eval_input'
from C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/irb-1.2.7/lib/irb.rb:704:in `signal_status'
from C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/irb-1.2.7/lib/irb.rb:538:in `block in eval_input'
from C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/irb-1.2.7/lib/irb/ruby-lex.rb:166:in `block (2 levels) in each_top_level_statement'
from C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/irb-1.2.7/lib/irb/ruby-lex.rb:151:in `loop'
from C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/irb-1.2.7/lib/irb/ruby-lex.rb:151:in `block in each_top_level_statement'
from C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/irb-1.2.7/lib/irb/ruby-lex.rb:150:in `catch'
from C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/irb-1.2.7/lib/irb/ruby-lex.rb:150:in `each_top_level_statement'
from C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/irb-1.2.7/lib/irb.rb:537:in `eval_input'
from C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/irb-1.2.7/lib/irb.rb:472:in `block in run'
from C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/irb-1.2.7/lib/irb.rb:471:in `catch'
from C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/irb-1.2.7/lib/irb.rb:471:in `run'
from C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/irb-1.2.7/lib/irb.rb:400:in `start'
Maybe IRB bug!
来源:https://stackoverflow.com/questions/64638056/switch-to-inspect-mode-windows-10