Skip to content

Instantly share code, notes, and snippets.

@bhauff
bhauff / gist:987586
Created May 23, 2011 20:57
JRuby 1.6.1/1.6.2 and Rails 2.3.5 script/console
C:\data\brandonh\Dev\rails\ofc>jruby script\console
Loading development environment (Rails 2.3.5)
Errno::ENOENT: No such file or directory - cannot execute
exec at org/jruby/RubyKernel.java:1747
(root) at C:/jruby-1.6.1/lib/ruby/gems/1.8/gems/rails-2.3.5/lib/commands/console.rb:45
require at org/jruby/RubyKernel.java:1038
(root) at script\console:3
C:\data\brandonh\Dev>jruby -v
jruby 1.6.0 (ruby 1.8.7 patchlevel 330) (2011-03-15 f3b6154) (Java HotSpot(TM) Client VM 1.6.0_21) [Windows XP-x86-java]
C:\data\brandonh\Dev>jruby -S irb
irb(main):001:0> require 'rubygems'
=> false
irb(main):002:0> require 'pdfkit'
=> true
irb(main):003:0>
C:\data\brandonh\Dev>jruby -v
jruby 1.6.0 (ruby 1.8.7 patchlevel 330) (2011-03-15 f3b6154) (Java HotSpot(TM) Client VM 1.6.0_21) [Windows XP-x86-java]
C:\data\brandonh\Dev>jruby -S irb
irb(main):001:0> require 'rubygems'
=> false
irb(main):002:0> require 'pdfkit'
=> true
irb(main):003:0> html = '<html><head><title>Hello World!</title></head><p>Hello World!</p></html>'
@bhauff
bhauff / schema_from_models.rb
Created March 14, 2009 21:30
Schema Dumper for Defined Models Only
# Create the database schema from the declared models
module ActiveRecord
class SchemaDumper
private
def models
Dir.chdir("app/models") do
Dir["**/*.rb"].map! {|m| m.gsub(/\.rb$/, '').camelize.constantize.table_name}
end