Skip to content

Instantly share code, notes, and snippets.

/web/blackbird (master)$ rvm jruby exec rackup config.ru
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/rubygems.rb:827:in `report_activate_error': Could not find RubyGem rack (>= 0) (Gem::LoadError)
from /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/rubygems.rb:261:in `activate'
from /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/rubygems.rb:68:in `gem'
from /usr/bin/rackup:18
/web/blackbird (master)$ rvm current
jruby-1.6.3
/web/blackbird (master)$ gem install rack
Warning: JRuby home "/Users/tatlas/.rvm/rubies/jruby-1.6.2" does not exist, using /var/folders/rx/rx4LWfIRGeGhnQFdIKPb3pzFZsc/-Tmp-/
LoadError: no such file to load -- rubygems
/web/blackbird (master)$ rvm --trace jruby exec rackup config.ru
+ [[ -n '' ]]
+ export 'PS4=+ ${BASH_SOURCE##${rvm_path:-}} : ${FUNCNAME[0]:+${FUNCNAME[0]}()} ${LINENO} > '
+ PS4='+ ${BASH_SOURCE##${rvm_path:-}} : ${FUNCNAME[0]:+${FUNCNAME[0]}()} ${LINENO} > '
+ /scripts/cli : __rvm_parse_args() 709 > [[ -z '' ]]
+ /scripts/cli : __rvm_parse_args() 709 > [[ -n '' ]]
+ /scripts/cli : __rvm_parse_args() 711 > [[ 0 -eq 1 ]]
+ /scripts/cli : __rvm_parse_args() 711 > [[ -n '' ]]
+ /scripts/cli : __rvm_parse_args() 18 > [[ -n jruby ]]
+ /scripts/cli : __rvm_parse_args() 20 > rvm_token=jruby
@tal
tal / GG.rb
Created August 8, 2011 20:01
Cityswift GG file
service :cityswift do
requires :stack, :city_service
start 'ant && bin/dev.sh'
group :city
dir '/web/cityswift'
proc_match 'com.gilt.swift.svc.SwiftServer' # need to change this
$ type $(which ruby) ; file $(which ruby)
ruby: not found
aliased not found
to not found
_run-with-bundler is a shell function
ruby is an alias for _run-with-bundler ruby
ruby:: cannot open `ruby:' (No such file or directory)
aliased: cannot open `aliased' (No such file or directory)
to: cannot open `to' (No such file or directory)
_run-with-bundler: cannot open `_run-with-bundler' (No such file or directory)
@tal
tal / fu.rb
Created September 21, 2011 20:13
Ruby Fu
class Foo
def t
puts "Foo"
end
end
module T
def t
puts "T"
super
module Skype
extend self
GROUPS = {
:city => '#bennygilt/$f5558ce446c1793f',
:city_announcements => '#swimming_bird/$877f4e5a36f23a8d'
}
def invoke cmd, name
oas = ['osascript']
oas << %q{-e 'tell application "Skype"'}
* executing `stage:restart_stage_rails'
* executing "sudo /etc/init.d/httpd restart"
servers: ["localhost"]
[localhost] executing command
** [out :: localhost] Stopping httpd: [FAILED]
** [out :: localhost]
** [out :: localhost] Starting httpd:
** [out :: localhost] [Wed Oct 05 22:21:35 2011] [warn] NameVirtualHost *:80 has no VirtualHosts
** [out :: localhost] (98)Address already in use: make_sock: could not bind to address [::]:7004
** [out :: localhost] (98)Address already in use: make_sock: could not bind to address 0.0.0.0:7004
#!/usr/bin/env coffee
optparse = require('./optparse')
console.log module
fi = require('findit')
path = require('path')
util = require('util')
cp = require('child_process')
DEFAULT_PATH = './public/javascripts'
BANNER = "Usage: woody [options] path/to/javascripts\n\nIf called without options, `woody` will default to #{DEFAULT_PATH}"
@tal
tal / woody.rb
Created November 10, 2011 18:32
#! /usr/bin/env ruby
require 'fileutils'
require 'pathname'
def system(*args)
puts(" ++ #{args.join(' ')}")
Kernel.system(*args)
end
def notify(msg,level=2)
function PageParams() {}
GC.pageParams = new PageParams();
_.each(window.location.search.replace(/^\?/,'').split('&'), function(paramSet) {
var array = paramSet.split('=');
GC.pageParams[array[0]] = array[1];
});