Skip to content

Instantly share code, notes, and snippets.

From 9f498d662e0b1cd1ddfdb985928fb6b2a4d50dcf Mon Sep 17 00:00:00 2001
From: ender672 <tle@holymonkey.com>
Date: Thu, 11 Feb 2010 14:29:12 -0800
Subject: [PATCH] Remove a hack for bin wrappers that caused an error with unicorn
---
lib/bundler/runtime.rb | 8 --------
1 files changed, 0 insertions(+), 8 deletions(-)
diff --git a/lib/bundler/runtime.rb b/lib/bundler/runtime.rb
module Sliceable
def slice!
if @sliced
puts "The #{name} is already sliced!\n"
else
@sliced = true
puts "Done slicing the #{name}.\n"
end
end
end
tim@tim-laptop:~/Documents/grub_website$ unicorn
I, [2009-10-16T10:53:20.843724 #7796] INFO -- : listening on addr=0.0.0.0:8080 fd=3
I, [2009-10-16T10:53:20.850217 #7796] INFO -- : worker=0 spawning...
I, [2009-10-16T10:53:20.851834 #7800] INFO -- : worker=0 spawned pid=7800
I, [2009-10-16T10:53:20.852031 #7800] INFO -- : Refreshing Gem list
I, [2009-10-16T10:53:20.855752 #7796] INFO -- : master process ready
/usr/local/lib/ruby/gems/1.9.1/gems/arel-0.1.0/lib/arel/algebra/relations/relation.rb:49:in `block in <module:Operable>': undefined method `classify' for "where":String (NoMethodError)
from /usr/local/lib/ruby/gems/1.9.1/gems/arel-0.1.0/lib/arel/algebra/relations/relation.rb:46:in `each'
from /usr/local/lib/ruby/gems/1.9.1/gems/arel-0.1.0/lib/arel/algebra/relations/relation.rb:46:in `<module:Operable>'
from /usr/local/lib/ruby/gems/1.9.1/gems/arel-0.1.0/lib/arel/algebra/relations/relation.rb:30:in `<class:Relation>'
irb(main):001:0> class Object; def require(*args, &block); puts "requiring #{args[0]}"; super *args, &block; end; end
=> nil
irb(main):003:0> require 'config/environment.rb'
requiring config/environment.rb
requiring /home/tim/Documents/grub_website/config/boot
requiring rails
requiring rails/initializer
requiring pathname
requiring rails/initializable
requiring rails/application
NameError in Static pagesController#new
constant ActionView::Base::Subclasses::StaticPagesController not defined
RAILS_ROOT: /home/tim/Documents/test
Application Trace | Framework Trace | Full Trace
/home/tim/Documents/test/vendor/rails/actionpack/lib/action_view/base.rb:242:in `remove_const'
/home/tim/Documents/test/vendor/rails/actionpack/lib/action_view/base.rb:242:in `block (2 levels) in for_controller'
/home/tim/Documents/test/vendor/rails/actionpack/lib/action_view/base.rb:241:in `class_eval'
module IpStrConvert
# IPv4 Conversion Methods
def ip4_str2bin(s)
s.split('.').map{|str| str.to_i}.pack('C4')
end
def ip4_bin2str(s)
s.unpack('C4').join '.'
#include <stdio.h>
enum CHAR_CODE {
col_sep = ',', row_sep = '\n', quote_char = '"'
};
int get_char();
int put_char(int);
void finish_col();
void finish_row();
def block_to_string
stack = caller
return nil if stack.empty?
file_name, line = parse_stack_line stack.shift
return nil unless file_name
block_from_file file_name, line
end
def parse_stack_line(where)
match = where.match /^(.*):(\d+)/
@ender672
ender672 / gist:136677
Created June 26, 2009 19:16
a sha1 based key/value in the filesystem store.
require 'digest/sha1'
class Sha1File
attr_reader :path
def initialize(sha1, base)
@base = base
@path = sha1_path sha1, base
@dir = File.dirname @path
end
irb(main):001:0> a = [1, 2, 3, 4, 5]
=> [1, 2, 3, 4, 5]
irb(main):002:0> a.each_with_index{|elem, index| a[index..a.size].each{|second_elem| p "#{elem}, #{second_elem}"}}
"1, 1"
"1, 2"
"1, 3"
"1, 4"
"1, 5"
"2, 2"
"2, 3"