Task not supported by 'jdbcsqlite3'

I am running a 2.2.2 Rails app on top of Jruby 1.4. When I try to run
my unit tests, I get the following results:

Task not supported by 'jdbcsqlite3'
/home/tom/Dev/ruby/depot-jruby/vendor/rails/railties/lib/tasks/databases.rake:365
/opt/jruby-1.4.0/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:636:in 

call' /opt/jruby-1.4.0/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:636:inexecute’
/opt/jruby-1.4.0/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:631:in
each' /opt/jruby-1.4.0/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:631:inexecute’

I therefore made the following change to my
vendor/rails/railties/lib/tasks/databases.rake file:

diff --git a/vendor/rails/railties/lib/tasks/databases.rake 

b/vendor/rails/railties/lib/tasks/databases.rake
index 5cb27f1…9c3c058 100644
— a/vendor/rails/railties/lib/tasks/databases.rake
+++ b/vendor/rails/railties/lib/tasks/databases.rake
@@ -346,7 +346,7 @@ namespace :db do
ActiveRecord::Base.clear_active_connections!
drop_database(abcs[‘test’])
create_database(abcs[‘test’])
- when “sqlite”,“sqlite3”
+ when “sqlite”,“sqlite3”,“jdbcsqlite3”
dbfile = abcs[“test”][“database”] || abcs[“test”][“dbfile”]
File.delete(dbfile) if File.exist?(dbfile)
when “sqlserver”

This fixed the problem, but it really feels like a hack. Is this a bug?
Is there a better way to fix this?

Please note that I also already changed value of the the adapter
properties in my database.yml file to “jdbcsqlite3”.

Thanks in advance!

Tom Purl

To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email

On Mon, Feb 22, 2010 at 8:30 PM, Tom E Purl [email protected] wrote:

I therefore made the following change to my vendor/rails/railties/lib/tasks/databases.rake file:

  •  when "sqlite","sqlite3","jdbcsqlite3"
       dbfile = abcs["test"]["database"] || abcs["test"]["dbfile"]
       File.delete(dbfile) if File.exist?(dbfile)
      when "sqlserver"
    

This fixed the problem, but it really feels like a hack. Is this a bug? Is there a better way to fix this?

Please note that I also already changed value of the the adapter properties in my database.yml file to “jdbcsqlite3”.

Hi Tom,

If you’re running ar-jdbc 0.9.2 (or can upgrade to it), you can just
run “jruby script/generate jdbc” once, change your database adapter to
“sqlite3” in database.yml and undo your edits to databases.rake.

See
http://blog.nicksieger.com/articles/2009/10/12/fresh-0-9-2-activerecord-jdbc-adapter-release
for more information.

/Nick


To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email

Nick S. [email protected] wrote on 02/22/2010 08:35:38 PM:

Hi Tom,

If you’re running ar-jdbc 0.9.2 (or can upgrade to it), you can just
run “jruby script/generate jdbc” once, change your database adapter to
“sqlite3” in database.yml and undo your edits to databases.rake.

See http://blog.nicksieger.com/articles/2009/10/12/fresh-0-9-2-
activerecord-jdbc-adapter-release for more information.

Thanks Nick! This worked perfectly.

Tom Purl