Rails 开发日志

发布于 2024-10-15 19:17:18 字数 999 浏览 7 评论 0原文

我正在阅读 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

我的黑色迷你裙 2024-10-22 19:17:18

Tail 不是 Ruby 命令。您应该直接在终端中运行它:

$ tail -f logs/development.log
#=> output
#=> ctrl+c
$ rails c --sandbox

Tail is not a Ruby command. You should run it directly in terminal:

$ tail -f logs/development.log
#=> output
#=> ctrl+c
$ rails c --sandbox
七分※倦醒 2024-10-22 19:17:18

您位于 irb 控制台内。从 irb 控制台退出并在 shell 中尝试

You are inside the irb console. exit from irb console and try it in your shell

卖梦商人 2024-10-22 19:17:18

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文