Rails 开发日志
我正在阅读 RoR 教程的第 6 章,似乎无法让命令“tail -f log/development.log”起作用。使用 Mac OS X 10.6.6、Ruby 1.9.2、Rails 3.0.3 和 RVM。我正在尝试在沙盒 Rails 控制台中运行它,这是正在发生的事情的输出:
Trenton-Scotts-MacBook-Air:sample_app TTS$ rails c --sandbox
Loading development environment in sandbox (Rails 3.0.3)
Any modifications you make will be rolled back on exit
ruby-1.9.2-p136 :001 > tail -f log/development.log
SyntaxError: (irb):1: syntax error, unexpected tIDENTIFIER, expecting keyword_do or '{' or '('
tail -f log/development.log
^
from /Users/TTS/.rvm/gems/ruby-1.9.2-p136/gems/railties-3.0.3/lib/rails/commands/console.rb:44:in `start'
from /Users/TTS/.rvm/gems/ruby-1.9.2-p136/gems/railties-3.0.3/lib/rails/commands/console.rb:8:in `start'
from /Users/TTS/.rvm/gems/ruby-1.9.2-p136/gems/railties-3.0.3/lib/rails/commands.rb:23:in `<top (required)>'
from script/rails:6:in `require'
from script/rails:6:in `<main>'
ruby-1.9.2-p136 :002 >
有什么想法吗?
I'm in Chapter 6 of the RoR Tutorial and can't seem to get the command 'tail -f log/development.log' to work. Using Mac OS X 10.6.6, Ruby 1.9.2, Rails 3.0.3 with RVM. I'm trying to run it in a sanboxed Rails console, here's the output of what's going on:
Trenton-Scotts-MacBook-Air:sample_app TTS$ rails c --sandbox
Loading development environment in sandbox (Rails 3.0.3)
Any modifications you make will be rolled back on exit
ruby-1.9.2-p136 :001 > tail -f log/development.log
SyntaxError: (irb):1: syntax error, unexpected tIDENTIFIER, expecting keyword_do or '{' or '('
tail -f log/development.log
^
from /Users/TTS/.rvm/gems/ruby-1.9.2-p136/gems/railties-3.0.3/lib/rails/commands/console.rb:44:in `start'
from /Users/TTS/.rvm/gems/ruby-1.9.2-p136/gems/railties-3.0.3/lib/rails/commands/console.rb:8:in `start'
from /Users/TTS/.rvm/gems/ruby-1.9.2-p136/gems/railties-3.0.3/lib/rails/commands.rb:23:in `<top (required)>'
from script/rails:6:in `require'
from script/rails:6:in `<main>'
ruby-1.9.2-p136 :002 >
Any thoughts?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
Tail 不是 Ruby 命令。您应该直接在终端中运行它:
Tail is not a Ruby command. You should run it directly in terminal:
您位于 irb 控制台内。从 irb 控制台退出并在 shell 中尝试
You are inside the irb console. exit from irb console and try it in your shell
tail
是一个 UNIX 命令。您需要先退出 ruby 控制台,然后在 shell 中执行它。或者您可以简单地打开另一个 shell 窗口。
tail
is a UNIX command. You need to quit ruby console first and then execute it in shell.Or you could simply open another shell window.