2 # frozen_string_literal: true
 
   7 # path to your application root.
 
   8 APP_ROOT = File.expand_path("..", __dir__)
 
  11   system(*args) || abort("\n== Command #{args} failed ==")
 
  15   # This script is a way to update your development environment automatically.
 
  16   # Add necessary update steps to this file.
 
  18   puts "== Installing dependencies =="
 
  19   system! "gem install bundler --conservative"
 
  20   system("bundle check") || system!("bundle install")
 
  22   # Install JavaScript dependencies if using Yarn
 
  25   puts "\n== Updating database =="
 
  26   system! "bin/rails db:migrate"
 
  28   puts "\n== Removing old logs and tempfiles =="
 
  29   system! "bin/rails log:clear tmp:clear"
 
  31   puts "\n== Restarting application server =="
 
  32   system! "bin/rails restart"