在这种特殊情况下,按下Ctrl+d
然后输入括号)
应该可以:
1.9.3p194 :004 > Team.find_by_name("equipo1).id
1.9.3p194 :005"> cannot get out of here"
1.9.3p194 :006?> hold on...
1.9.3p194 :007 > ^D
1.9.3p194 :007?> )
SyntaxError: (irb):6: syntax error, unexpected tIDENTIFIER, expecting ')'
hold on...
^
(irb):7: syntax error, unexpected ')'
from /Users/dgarcia/.rvm/gems/ruby-1.9.3-p194/gems/railties-3.2.6/lib/rails/commands/console.rb:47:in `start'
from /Users/dgarcia/.rvm/gems/ruby-1.9.3-p194/gems/railties-3.2.6/lib/rails/commands/console.rb:8:in `start'
from /Users/dgarcia/.rvm/gems/ruby-1.9.3-p194/gems/railties-3.2.6/lib/rails/commands.rb:41:in `<top (required)>'
from script/rails:6:in `require'
from script/rails:6:in `<main>'
1.9.3p194 :008 > puts "hooray!!"
hooray!!
=> nil
1.9.3p194 :009 >