Skip to content

Instantly share code, notes, and snippets.

@lcuevastodoit
Forked from glava/Rakefile
Created August 8, 2020 12:34
Show Gist options
  • Save lcuevastodoit/903a1774d436b83a790979ecb8bd5278 to your computer and use it in GitHub Desktop.
Save lcuevastodoit/903a1774d436b83a790979ecb8bd5278 to your computer and use it in GitHub Desktop.
Stop, Start, Restart Rake tasks for Rails
desc 'Stop rails server'
task :stop do
 File.new("tmp/pids/server.pid").tap { |f| Process.kill 9, f.read.to_i }.delete
end
desc 'Starts rails server'
task :start do
Process.exec("rails s puma -d")
end
desc "Restarts rails server"
task :restart do
Rake::Task[:stop].invoke
Rake::Task[:start].invoke
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment