Skip to content

Instantly share code, notes, and snippets.

View hone's full-sized avatar

Terence Lee hone

View GitHub Profile
class HerokuEnvironment
def create_proc
require 'rubygems'
require 'activerecord'
Proc.new {}
end
end
begin
$ irb
>> require 'config/environment'
config.gem: Unpacked gem mechanize-0.9.3 in vendor/gems has no specification file. Run 'rake gems:refresh_specs' to fix this.
config.gem: Unpacked gem bmabey-email_spec-0.2.0 in vendor/gems has no specification file. Run 'rake gems:refresh_specs' to fix this.
config.gem: Unpacked gem json_pure-1.1.7 in vendor/gems has no specification file. Run 'rake gems:refresh_specs' to fix this.
config.gem: Unpacked gem thoughtbot-factory_girl-1.2.2 in vendor/gems has no specification file. Run 'rake gems:refresh_specs' to fix this.
config.gem: Unpacked gem ar-extensions-0.9.2 in vendor/gems has no specification file. Run 'rake gems:refresh_specs' to fix this.
config.gem: Unpacked gem blackbook-1.0.17 in vendor/gems has no specification file. Run 'rake gems:refresh_specs' to fix this.
NoMethodError: undefined method `full_host_name' for #<IRB::Context:0x2893198>
from /home/hone/Projects/oib/boxboss/config/initializers/action_mailer_configs.rb:7
# ... in def console_session
binding =
if File.exist?('config.ru')
RackEnvironment.new.create_binding
else
RailsEnvironment.new.create_binding
end
module Heroku
class RackEnvironment
>> eval('ActiveRecord')
NameError: (eval):1:in `irb_binding': uninitialized constant ActiveRecord
from (irb):1
from (irb):1
>> b = Kernel.binding
=> #<Binding:0x1bb6128>
>> require 'activerecord'
=> true
>> eval('ActiveRecord', b)
=> ActiveRecord
$ irb
>> b = binding
=> #<Binding:0x2467740>
>> eval("self.class.constants.size", b)
=> 119
>> require 'activerecord'
=> true
>> eval("self.class.constants.size", b)
=> 147
module Heroku
class RackEnvironment
def create_binding
# handle any loading errors
begin
load 'config.ru'
rescue
$std.err.puts $!
end
$ ../heroku/bin/heroku console
Ruby console for boxboss-production.heroku.com
config.gem: Unpacked gem mechanize-0.9.3 in vendor/gems has no specification file. Run 'rake gems:refresh_specs' to fix this.
config.gem: Unpacked gem bmabey-email_spec-0.2.0 in vendor/gems has no specification file. Run 'rake gems:refresh_specs' to fix this.
config.gem: Unpacked gem json_pure-1.1.7 in vendor/gems has no specification file. Run 'rake gems:refresh_specs' to fix this.
config.gem: Unpacked gem thoughtbot-factory_girl-1.2.2 in vendor/gems has no specification file. Run 'rake gems:refresh_specs' to fix this.
config.gem: Unpacked gem ar-extensions-0.9.2 in vendor/gems has no specification file. Run 'rake gems:refresh_specs' to fix this.
config.gem: Unpacked gem blackbook-1.0.17 in vendor/gems has no specification file. Run 'rake gems:refresh_specs' to fix this.
=> Mixing in Lockdown version: 1.2.0
=> Requiring Lockdown rules engine: /home/hone/Projects/oib/boxboss/lib/lockdown/init.rb
>> invite_queue.invites.accepted.sum(:reserved_seat_count)
=> "0"
@hone
hone / gist:242351
Created November 25, 2009 00:05 — forked from anonymous/gist:242325
require 'optparse'
require 'scanner/scanner'
module SC
class SimpleCompilerError < RuntimeError
end
class CommandOptionError < RuntimeError
end
@hone
hone / gist:242352
Created November 25, 2009 00:05 — forked from anonymous/gist:242325
require 'optparse'
require 'scanner/scanner'
module SC
class SimpleCompilerError < RuntimeError
end
class CommandOptionError < RuntimeError
end