Created
November 28, 2013 09:42
-
-
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
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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