5

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?

Trent Scott
  • 1,958
  • 7
  • 31
  • 49

3 Answers3

8

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

$ tail -f logs/development.log
#=> output
#=> ctrl+c
$ rails c --sandbox
coreyward
  • 68,091
  • 16
  • 122
  • 142
  • How would one go about getting this to work on Windows? What is the Windows equivalent to `tail`? – tehaaron Mar 01 '11 at 08:37
  • Found my answer here: http://stackoverflow.com/questions/187587/looking-for-a-windows-equivalent-of-the-unix-tail-command – tehaaron Mar 01 '11 at 08:49
4

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

Deepak N
  • 2,501
  • 2
  • 29
  • 44
3

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.

weddingcakes
  • 637
  • 1
  • 7
  • 14
Nikita Rybak
  • 64,889
  • 22
  • 150
  • 172