Skip to content

Instantly share code, notes, and snippets.

@vitaliel
Created November 28, 2013 09:42
Show Gist options
  • Save vitaliel/7689470 to your computer and use it in GitHub Desktop.
Save vitaliel/7689470 to your computer and use it in GitHub Desktop.
run rails with thin and tail -f for development.log that outputs rails logs to the console
require 'thread'
log='log/development.log'
system "truncate --size 0 #{log}"
Thread.new do
system('bundle exec thin start')
end
args = %W{tail -f #{log}} + [:err => [:child, :out]]
IO.popen(args) do |io|
while line = io.gets
puts line
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment