Skip to content

Instantly share code, notes, and snippets.

root@domU-12-31-38-00-4C-31:~# cap -T
/usr/lib/ruby/gems/1.8/gems/capistrano-2.5.5/lib/capistrano/configuration/variables.rb:122:in `method_missing': undefined method `depend' for #<Capistrano::Configuration:0x7f443d3b6a90> (NoMethodError)
from ./deploy.rb:72:in `load'
from /usr/lib/ruby/gems/1.8/gems/capistrano-2.5.5/lib/capistrano/configuration/loading.rb:172:in `load_from_file'
from /usr/lib/ruby/gems/1.8/gems/capistrano-2.5.5/lib/capistrano/configuration/loading.rb:89:in `load'
from /usr/lib/ruby/gems/1.8/gems/capistrano-2.5.5/lib/capistrano/configuration/loading.rb:86:in `load'
from /usr/lib/ruby/gems/1.8/gems/capistrano-2.5.5/lib/capistrano/configuration/loading.rb:86:in `each'
from /usr/lib/ruby/gems/1.8/gems/capistrano-2.5.5/lib/capistrano/configuration/loading.rb:86:in `load'
from Capfile:1:in `load'
from /usr/lib/ruby/gems/1.8/gems/capistrano-2.5.5/lib/capistrano/configuration/loading.rb:172:in `load_from_file'
set :application, "appname"
set :repository, "[email protected]:/store/git/appname/.git"
set :deploy_to, "/var/www/rails/#{application}"
# set the default rails_env here, and override it in the tasks
# when necessary
set :rails_env, "development"
# If you aren't deploying to /u/apps/#{application} on the target
# servers (which is the default), you can specify the actual location
load 'deploy' if respond_to?(:namespace) # cap2 differentiator
load 'config/deploy'
#! /bin/sh -e
# this script insures that on boot we have the latest version of the application deployed to this instance
# this must be run after the ec2-init script which sets the hostname. ec2-init is currently S90
if [ -e /var/spool/ec2/meta-data/public-hostname ]; then
touch /root/aa_my_hostname.$$
MY_HOSTNAME=`cat /var/spool/ec2/meta-data/public-hostname`
else
touch /root/aa_no_my_hostname.$$
exit 1
# line 83 of config/initializers/rollbook.rb is
# require 'validatable'
# which is a gem that is installed and the last line in the config/initializers/rollbook.rb
root@domU-12-31-38-00-1D-01:/var/www/rails/rollbook/current# ./script/backgroundrb -e production stop
/usr/local/lib/ruby/site_ruby/1.8/rubygems.rb:269:in `activate': undefined method `map' for nil:NilClass (NoMethodError)
from /usr/local/lib/ruby/site_ruby/1.8/rubygems.rb:295:in `activate'
from /usr/local/lib/ruby/site_ruby/1.8/rubygems.rb:294:in `each'
from /usr/local/lib/ruby/site_ruby/1.8/rubygems.rb:294:in `activate'
from /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:35:in `require'
# setup db and ami staging instances all set up w/stale volumes
-- complete
# test staging instances
1) Log in as a few different clients
2) Launch courses in those clients
3) Make sure reports run as those clients
4) Manually trigger a few integrations (?)
5) Log into the admin account
6) Update some enrollments in the admin account
>> activity_fields.zip(ar.first)
TypeError: can't convert Hash into Array
from (irb):45:in `zip'
from (irb):45
from :0
>> activity_fields.zip(ar.first.to_a)
=> [["curriculum_activity_id", ["enrollment_id", "2509140"]], ["name", ["curriculum_id", "6836"]], ["parent_id", ["name", "AML for Banks: The Office of Foreign Assets Control (OFAC)"]], ["lft", ["curriculum_activity_id", "1246"]], ["rgt", ["completed_on", nil]], ["curriculum_id", ["attempts_max", "0"]], ["course_id", ["completions_min", "0"]], ["enrollment_curriculum_activity_id", ["lft", "1"]], ["enrollment_id", ["enrollment_curriculum_activity_id", "1607986"]], ["course_enrollment_id", ["control_mode", "flow"]], ["started_on", ["parent_id", nil]], ["completed_on", ["attempts", "1"]], ["status", ["score", "0"]], ["score", ["status", "in-progress"]], ["attempts", ["started_on", nil]], ["control_mode", ["course_enrollment_id", "2577211"]], ["completions_min", ["course_id", "19"]], ["attempts_max", ["rgt", "2"]]]
class StartUpWorker < BackgrounDRb::MetaWorker
set_worker_name :start_up_worker
QUEUE_WORKER_LIMIT = 2
# this method is called on backgroundrb startup by default.
# it releases any jobs run by this server that didn't complete back to the
# job pool so any server may run them and then starts up the right amount of
# queue_processing_worker's
#
#TODO -- check that queue contains recurring tasks such as auto-enrollment
def list_sessions
@category_id = params[:category_id]
@course_id = params[:course_id] || ""
@end_date = params[:end_date] ||= ""
# get the student group assets
conditions = ["course_sessions.is_active = ? and course_sessions.in_catalog = ? and courses.in_catalog = ?"]
vars = [true, true, true]
options = {}
student_entries = GroupCourseSession.find(:all,
# rails controller action renders text like this
render :text => "alert('#{messages}');"
# in response to a request that calls this js function onclick.
function saveAsReport() {
if (!currently_saving) {
var name = prompt('Please enter a name for this new report.', $('report_name').value);
if (name != null) {
$('report_name').value = name;
currently_saving = true;