5 # path to your application root.
 
   6 APP_ROOT = File.expand_path("..", __dir__)
 
   9   system(*args) || abort("\n== Command #{args} failed ==")
 
  13   # This script is a way to update your development environment automatically.
 
  14   # Add necessary update steps to this file.
 
  16   puts "== Installing dependencies =="
 
  17   system! "gem install bundler --conservative"
 
  18   system("bundle check") || system!("bundle install")
 
  20   # Install JavaScript dependencies if using Yarn
 
  23   puts "\n== Updating database =="
 
  24   system! "bin/rails db:migrate"
 
  26   puts "\n== Removing old logs and tempfiles =="
 
  27   system! "bin/rails log:clear tmp:clear"
 
  29   puts "\n== Restarting application server =="
 
  30   system! "bin/rails restart"