Skip to content

Instantly share code, notes, and snippets.

@Demuxx
Created July 18, 2014 07:07
Show Gist options
  • Save Demuxx/168a865969ade4d4f02b to your computer and use it in GitHub Desktop.
Save Demuxx/168a865969ade4d4f02b to your computer and use it in GitHub Desktop.
Cron job for ruby on rails scripts
#!/usr/bin/env bash
# codex_update.sh
# load rvm ruby
source /Users/thegodfather/.rvm/environments/ruby-2.1.2
cd /Users/thegodfather/code/codex
bundle install
ruby ./bin/codex_update.rb
###############################
#!/Users/thegodfather/.rvm/rubies/ruby-2.1.2/bin/ruby
# codex_update.rb
APP_PATH = File.expand_path('../../config/application', __FILE__)
require File.expand_path('../../config/boot', __FILE__)
require APP_PATH
# set Rails.env here if desired
Rails.application.require_environment!
# <your code here>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment