the error comes from the load_driver method near line 621 of the sqlite3/database.rb file.
def load_driver( driver )
case driver
when Class
# do nothing--use what was given
when Symbol, String
require "sqlite3/driver/#{driver.to_s.downcase}/driver"
driver = SQLite3::Driver.const_get( driver )::Driver
else
[ "Native", "DL" ].each do |d|
begin
require "sqlite3/driver/#{d.downcase}/driver"
driver = SQLite3::Driver.const_get( d )::Driver
break
rescue SyntaxError
raise
rescue ScriptError, Exception, NameError
end
end
raise "no driver for sqlite3 found" unless driver
end
@driver = driver.new
end
private :load_driver
Macruby enters the method with driver set to NSNull, and the driver fails to load. In ruby (1.9.0) the driver loads via the Native driver.
irb19 session:
>> db = SQLite3::Database.new("/Users/Tim/Desktop/newdb")
=> #<SQLite3::Database:0x5cba48 @driver=#<SQLite3::Driver::Native::Driver:0x5c4784 @callback_data={}, @authorizer={}, @busy_handler={}, @trace={}>, @statement_factory=SQLite3::Statement, @handle=#<SWIG::TYPE_p_sqlite3:0x5c470c>, @closed=false, @results_as_hash=false, @type_translation=false, @translator=nil, @transaction_active=false>
Can anyone offer an idea about how they might try to patch this to work with macruby? I know an alternative would be CoreData--but it is too cumbersome for me.
Thanks,
Tim