I'm trying initialize my local rails server but I haven't been able to,
because when I write "rails server", show me this message:
=> Booting WEBrick
=> Rails 3.0.3 application starting in development on http://0.0.0.0:3000
=> Call with -d to detach
=> Ctrl-C to shutdown server
Exiting
/home/distriker/Documentos/public_html/auth/mysql2/ruby/1.8/gems/
activesupport-3.0.3/lib/active_support/dependencies.rb:239:in
`require': wrong number of arguments (2 for 1) (ArgumentError)
from /home/distriker/Documentos/public_html/auth/mysql2/ruby/1.8/gems/
activesupport-3.0.3/lib/active_support/dependencies.rb:239:in
`require'
from /home/distriker/Documentos/public_html/auth/mysql2/ruby/1.8/gems/
activesupport-3.0.3/lib/active_support/dependencies.rb:225:in
`load_dependency'
from /home/distriker/Documentos/public_html/auth/mysql2/ruby/1.8/gems/
activesupport-3.0.3/lib/active_support/dependencies.rb:596:in
`new_constants_in'
from /home/distriker/Documentos/public_html/auth/mysql2/ruby/1.8/gems/
activesupport-3.0.3/lib/active_support/dependencies.rb:225:in
`load_dependency'
from /home/distriker/Documentos/public_html/auth/mysql2/ruby/1.8/gems/
activesupport-3.0.3/lib/active_support/dependencies.rb:239:in
`require'
from /home/distriker/Documentos/public_html/auth/config.ru:6
from /home/distriker/Documentos/public_html/auth/mysql2/ruby/1.8/gems/
rack-1.2.3/lib/rack/builder.rb:46:in `instance_eval'
from /home/distriker/Documentos/public_html/auth/mysql2/ruby/1.8/gems/
rack-1.2.3/lib/rack/builder.rb:46:in `initialize'
from /home/distriker/Documentos/public_html/auth/config.ru:1:in `new'
from /home/distriker/Documentos/public_html/auth/config.ru:1
Regards, Iván
That appears to be a bug in "/home/distriker/Documentos/public_html/auth/mysql2/ruby/1.8/gems/ activesupport-3.0.3/lib/active_support/dependencies.rb" line 239. It's calling:
require 'one/thing', 'another/thing'
It's possible that something in your config is causing it to do this.
[Off-topic]
English help :)
"I haven't can" => "I haven't been able to"
"Rewards, Iván" => "Regards, Iván"
Hopefully you don't mind.
[/Off-topic]
EDIT | I'd probably check this line first: "/home/distriker/Documentos/public_html/auth/config.ru:6"
Related
I have been using the gem audited in my rails application. At first I was using a sqlite3 database but have recently switched over to MySQL. When I attempt to access my association that the gem provides (ex: myObject.audits) I get the following error.
`ArgumentError: undefined class/module ActiveRecord::ConnectionAdapters::SQLite3String
from /home/david/.rvm/rubies/ruby-2.1.3/lib/ruby/2.1.0/psych/class_loader.rb:53:in `path2class'
from /home/david/.rvm/rubies/ruby-2.1.3/lib/ruby/2.1.0/psych/class_loader.rb:53:in `resolve'
from /home/david/.rvm/rubies/ruby-2.1.3/lib/ruby/2.1.0/psych/class_loader.rb:45:in `find'
from /home/david/.rvm/rubies/ruby-2.1.3/lib/ruby/2.1.0/psych/class_loader.rb:27:in `load'
from /home/david/.rvm/rubies/ruby-2.1.3/lib/ruby/2.1.0/psych/visitors/to_ruby.rb:360:in `resolve_class'
from /home/david/.rvm/rubies/ruby-2.1.3/lib/ruby/2.1.0/psych/visitors/to_ruby.rb:203:in `visit_Psych_Nodes_Mapping'
from /home/david/.rvm/rubies/ruby-2.1.3/lib/ruby/2.1.0/psych/visitors/visitor.rb:15:in `visit'
from /home/david/.rvm/rubies/ruby-2.1.3/lib/ruby/2.1.0/psych/visitors/visitor.rb:5:in `accept'
from /home/david/.rvm/rubies/ruby-2.1.3/lib/ruby/2.1.0/psych/visitors/to_ruby.rb:31:in `accept'
from /home/david/.rvm/rubies/ruby-2.1.3/lib/ruby/2.1.0/psych/visitors/to_ruby.rb:302:in `block in revive_hash'
from /home/david/.rvm/rubies/ruby-2.1.3/lib/ruby/2.1.0/psych/visitors/to_ruby.rb:300:in `each'
from /home/david/.rvm/rubies/ruby-2.1.3/lib/ruby/2.1.0/psych/visitors/to_ruby.rb:300:in `each_slice'
from /home/david/.rvm/rubies/ruby-2.1.3/lib/ruby/2.1.0/psych/visitors/to_ruby.rb:300:in `revive_hash'
from /home/david/.rvm/rubies/ruby-2.1.3/lib/ruby/2.1.0/psych/visitors/to_ruby.rb:161:in `visit_Psych_Nodes_Mapping'
from /home/david/.rvm/rubies/ruby-2.1.3/lib/ruby/2.1.0/psych/visitors/visitor.rb:15:in `visit'
from /home/david/.rvm/rubies/ruby-2.1.3/lib/ruby/2.1.0/psych/visitors/visitor.rb:5:in `accept'
... 63 levels...
from /home/david/.rvm/gems/ruby-2.1.3/gems/activerecord-4.2.0/lib/active_record/attribute_set.rb:31:in `fetch_value'
from /home/david/.rvm/gems/ruby-2.1.3/gems/activerecord-4.2.0/lib/active_record/attribute_methods/read.rb:93:in `_read_attribute'
from /home/david/.rvm/gems/ruby-2.1.3/gems/activerecord-4.2.0/lib/active_record/attribute_methods/read.rb:87:in `read_attribute'
from /home/david/.rvm/gems/ruby-2.1.3/gems/activerecord-4.2.0/lib/active_record/attribute_methods.rb:305:in `attribute_for_inspect'
from /home/david/.rvm/gems/ruby-2.1.3/gems/activerecord-4.2.0/lib/active_record/core.rb:443:in `block in inspect'
from /home/david/.rvm/gems/ruby-2.1.3/gems/activerecord-4.2.0/lib/active_record/core.rb:441:in `collect'
from /home/david/.rvm/gems/ruby-2.1.3/gems/activerecord-4.2.0/lib/active_record/core.rb:441:in `inspect'
from /home/david/.rvm/gems/ruby-2.1.3/gems/activerecord-4.2.0/lib/active_record/relation.rb:629:in `map!'
from /home/david/.rvm/gems/ruby-2.1.3/gems/activerecord-4.2.0/lib/active_record/relation.rb:629:in `inspect'
from /home/david/.rvm/gems/ruby-2.1.3/gems/railties-4.2.0/lib/rails/commands/console.rb:110:in `start'
from /home/david/.rvm/gems/ruby-2.1.3/gems/railties-4.2.0/lib/rails/commands/console.rb:9:in `start'
from /home/david/.rvm/gems/ruby-2.1.3/gems/railties-4.2.0/lib/rails/commands/commands_tasks.rb:68:in `console'
from /home/david/.rvm/gems/ruby-2.1.3/gems/railties-4.2.0/lib/rails/commands/commands_tasks.rb:39:in `run_command!'
from /home/david/.rvm/gems/ruby-2.1.3/gems/railties-4.2.0/lib/rails/commands.rb:17:in `<top (required)>'
from bin/rails:4:in `require'
from bin/rails:4:in `<main>'2.1.3 :004 >`
I'm not sure where to start debugging this error. Can anyone provide some direction? Thanks!
Can anybody help me to solve the following error ?When i typed rake db:create on cmd i got these errors.
Error:
rake aborted!
NoMethodError: undefined method `each' for #<String:0x1a1af20>
Tasks: TOP => db:create => db:load_config
(See full trace by running task with --trace)
When i run rake db:create --trace i got the following traces.
rake aborted!
NoMethodError: undefined method `each' for #
Tasks: TOP => db:create => db:load_config
(See full trace by running task with --trace)
** Invoke db:create (first_time)
** Invoke db:load_config (first_time)
** Execute db:load_config
rake aborted!
NoMethodError: undefined method `each' for #<String:0x1a37888>
C:/Ruby193/lib/ruby/gems/1.9.1/gems/activerecord-4.2.0/lib/active_record/connect
ion_adapters/connection_specification.rb:150:in `resolve_all'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/activerecord-4.2.0/lib/active_record/connect
ion_handling.rb:69:in `resolve'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/activerecord-4.2.0/lib/active_record/core.rb
:46:in `configurations='
C:/Ruby193/lib/ruby/gems/1.9.1/gems/activerecord-4.2.0/lib/active_record/railtie
s/databases.rake:5:in `block (2 levels) in <top (required)>'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/rake-10.4.2/lib/rake/task.rb:240:in `call'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/rake-10.4.2/lib/rake/task.rb:240:in `block i
n execute'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/rake-10.4.2/lib/rake/task.rb:235:in `each'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/rake-10.4.2/lib/rake/task.rb:235:in `execute
'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/rake-10.4.2/lib/rake/task.rb:179:in `block i
n invoke_with_call_chain'
C:/Ruby193/lib/ruby/1.9.1/monitor.rb:211:in `mon_synchronize'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/rake-10.4.2/lib/rake/task.rb:172:in `invoke_
with_call_chain'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/rake-10.4.2/lib/rake/task.rb:201:in `block i
n invoke_prerequisites'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/rake-10.4.2/lib/rake/task.rb:199:in `each'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/rake-10.4.2/lib/rake/task.rb:199:in `invoke_
prerequisites'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/rake-10.4.2/lib/rake/task.rb:178:in `block i
n invoke_with_call_chain'
C:/Ruby193/lib/ruby/1.9.1/monitor.rb:211:in `mon_synchronize'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/rake-10.4.2/lib/rake/task.rb:172:in `invoke_
with_call_chain'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/rake-10.4.2/lib/rake/task.rb:165:in `invoke'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/rake-10.4.2/lib/rake/application.rb:150:in `
invoke_task'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/rake-10.4.2/lib/rake/application.rb:106:in `
block (2 levels) in top_level'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/rake-10.4.2/lib/rake/application.rb:106:in `
each'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/rake-10.4.2/lib/rake/application.rb:106:in `
block in top_level'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/rake-10.4.2/lib/rake/application.rb:115:in `
run_with_threads'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/rake-10.4.2/lib/rake/application.rb:100:in `
top_level'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/rake-10.4.2/lib/rake/application.rb:78:in `b
lock in run'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/rake-10.4.2/lib/rake/application.rb:176:in `
standard_exception_handling'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/rake-10.4.2/lib/rake/application.rb:75:in `r
un'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/rake-10.4.2/bin/rake:33:in `<top (required)>
'
C:/Ruby193/bin/rake:23:in `load'
C:/Ruby193/bin/rake:23:in `<main>'
Tasks: TOP => db:create => db:load_config
My database.yml file is described below.
default:&default
adapter:mysql2
encoding:utf8
pool:5
username:root
password:pass
host:localhost
development:<<:*default
database:sqlbook_development
# Warning: The database defined as "test" will be erased and
# re-generated from your development database when you run "rake".
# Do not set this db to the same as development or production.
test:<<:*default
database:sqlbook_test
# As with config/secrets.yml, you never want to store sensitive information,
# like your database password, in your source code. If your source code is
# ever seen by anyone, they now have access to your database.
#
# Instead, provide the password as a unix environment variable when you boot
# the app. Read http://guides.rubyonrails.org/configuring.html#configuring-a-database
# for a full rundown on how to provide these environment variables in a
# production deployment.
#
# On Heroku and other platform providers, you may have a full connection URL
# available as an environment variable. For example:
#
# DATABASE_URL="mysql2://myuser:mypass#localhost/somedatabase"
#
# You can use this database configuration with:
#
# production:
# url: <%= ENV['DATABASE_URL'] %>
#
production:<<:*default
database:sqlbook_production
username:sqlbook
password:pass
I am using rails version 4.2.0 and ruby 1.9.3.Please help me to resolve this error.Thanks in advance..
Newbie question....
Trying to start a project in rails. I have different spreadsheets in csv format I'd like to import into the MySQL database to be able to manipulate the data.
After looking around on stackoverflow, Google, etc. I wrote a rake task requiring fastercsv to do the job. I keep getting errors so hopefully you can help.
...
Ok so I changed the code to use 'csv' vs 'fastercsv'...still getting errors. See below
New Code for Rake File (take 3):
require 'csv'
desc "Import gac from csv file"
task :import => [:environment] do
file = "gac.csv"
CSV.foreach(file, :headers => true) do |row|
Institution.create({
:institution_name => row[0],
:website => row[1],
:email => row[2],
:category_1 => row[3],
:category_2 => row[4],
:category_3 => row[5],
:category_4 => row[6],
:category_5 => row[7],
:category_6 => row[8],
:category_7 => row[9],
:category_8 => row[10],
:category_9 => row[11],
:category_10 => row[12],
:category_11 => row[13],
:institution_description => row[14]
})
end
end
Error Codes:
Daves-MacBook-Pro:vendor dave$ rake import --trace
** Invoke import (first_time)
** Invoke environment (first_time)
** Execute environment
** Execute import
rake aborted!
invalid byte sequence in UTF-8
/Users/dave/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/csv.rb:1855:in `sub!'
/Users/dave/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/csv.rb:1855:in `block in shift'
/Users/dave/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/csv.rb:1849:in `loop'
/Users/dave/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/csv.rb:1849:in `shift'
/Users/dave/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/csv.rb:1791:in `each'
/Users/dave/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/csv.rb:1208:in `block in foreach'
/Users/dave/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/csv.rb:1354:in `open'
/Users/dave/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/csv.rb:1207:in `foreach'
/Users/dave/rails_projects/vendor/lib/tasks/import.rake:8:in `block in <top (required)>'
/Users/dave/.rvm/gems/ruby-1.9.3-p0/gems/rake-0.9.2.2/lib/rake/task.rb:205:in `call'
/Users/dave/.rvm/gems/ruby-1.9.3-p0/gems/rake-0.9.2.2/lib/rake/task.rb:205:in `block in execute'
/Users/dave/.rvm/gems/ruby-1.9.3-p0/gems/rake-0.9.2.2/lib/rake/task.rb:200:in `each'
/Users/dave/.rvm/gems/ruby-1.9.3-p0/gems/rake-0.9.2.2/lib/rake/task.rb:200:in `execute'
/Users/dave/.rvm/gems/ruby-1.9.3-p0/gems/rake-0.9.2.2/lib/rake/task.rb:158:in `block in invoke_with_call_chain'
/Users/dave/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/monitor.rb:211:in `mon_synchronize'
/Users/dave/.rvm/gems/ruby-1.9.3-p0/gems/rake-0.9.2.2/lib/rake/task.rb:151:in `invoke_with_call_chain'
/Users/dave/.rvm/gems/ruby-1.9.3-p0/gems/rake-0.9.2.2/lib/rake/task.rb:144:in `invoke'
/Users/dave/.rvm/gems/ruby-1.9.3-p0/gems/rake-0.9.2.2/lib/rake/application.rb:116:in `invoke_task'
/Users/dave/.rvm/gems/ruby-1.9.3-p0/gems/rake-0.9.2.2/lib/rake/application.rb:94:in `block (2 levels) in top_level'
/Users/dave/.rvm/gems/ruby-1.9.3-p0/gems/rake-0.9.2.2/lib/rake/application.rb:94:in `each'
/Users/dave/.rvm/gems/ruby-1.9.3-p0/gems/rake-0.9.2.2/lib/rake/application.rb:94:in `block in top_level'
/Users/dave/.rvm/gems/ruby-1.9.3-p0/gems/rake-0.9.2.2/lib/rake/application.rb:133:in `standard_exception_handling'
/Users/dave/.rvm/gems/ruby-1.9.3-p0/gems/rake-0.9.2.2/lib/rake/application.rb:88:in `top_level'
/Users/dave/.rvm/gems/ruby-1.9.3-p0/gems/rake-0.9.2.2/lib/rake/application.rb:66:in `block in run'
/Users/dave/.rvm/gems/ruby-1.9.3-p0/gems/rake-0.9.2.2/lib/rake/application.rb:133:in `standard_exception_handling'
/Users/dave/.rvm/gems/ruby-1.9.3-p0/gems/rake-0.9.2.2/lib/rake/application.rb:63:in `run'
/Users/dave/.rvm/gems/ruby-1.9.3-p0/gems/rake-0.9.2.2/bin/rake:33:in `<top (required)>'
/Users/dave/.rvm/gems/ruby-1.9.3-p0/bin/rake:19:in `load'
/Users/dave/.rvm/gems/ruby-1.9.3-p0/bin/rake:19:in `<main>'
Tasks: TOP => import
lib/tasks/import.rake
require 'csv'
desc "Import gac from csv file"
task :import => [:environment] do
file = "vender/gac.csv"
CSV.foreach(file, :headers => true) do |row|
Putthemodelnamehere.create ({
:columnnamewhatever => row[1],
:columnname => row[2],
:columnname => row[4]
})
end
end
Then just run rake import or bundle exec rake import. Hope this helps (this isn't using fastercsv but this is the solution I'd recommend.)
Make sure that you have the Institution model class defined in app/models and/or make sure that you have run the db migration(s) (rake db:migrate) to create the institutions table - assuming you used a generator (or scaffold) to create the model.
The errors you are getting are probably because there is something in your csv that is not properly encoded for UTF-8.
One way of dealing with that would be to force the encoding. You could do the following:
For each association you have above, do this instead:
:category_1 => row[3].encode("UTF-8", replace: ' '),
Hopefully that will work for you.
I am having multiple problems with jruby and activerecord-3.1.0.rc5.
For example, after i have ran my migrations, I create a simple Role object from the rails console and all is good :
jruby-1.6.3 :006 > r = Role.new(:name => "Standard")
=> #<Role id: nil, name: "Standard", created_at: nil, updated_at: nil>
I then want to display all Roles so I enter
jruby-1.6.3 :007 > Role.all
I get the following stack trace:
argumentError: wrong number of arguments (3 for 2)
from /Users/paulcowan/.rvm/gems/jruby-1.6.3/gems/activerecord-3.1.0.rc5/lib/active_record/base.rb:470:in `find_by_sql'
from /Users/paulcowan/.rvm/gems/jruby-1.6.3/gems/activerecord-3.1.0.rc5/lib/active_record/relation.rb:111:in `to_a'
from /Users/paulcowan/.rvm/gems/jruby-1.6.3/gems/activerecord-3.1.0.rc5/lib/active_record/relation/finder_methods.rb:155:in `all'
from org/jruby/RubyBasicObject.java:1684:in `__send__'
from /Users/paulcowan/.rvm/gems/jruby-1.6.3/gems/activerecord-3.1.0.rc5/lib/active_record/base.rb:437:in `all'
from (irb):7:in `evaluate'
from org/jruby/RubyKernel.java:1093:in `eval'
from org/jruby/RubyKernel.java:1419:in `loop'
from org/jruby/RubyKernel.java:1205:in `catch'
from org/jruby/RubyKernel.java:1205:in `catch'
from /Users/paulcowan/.rvm/gems/jruby-1.6.3/gems/railties-3.1.0.rc5/lib/rails/commands/console.rb:45:in `start'
from /Users/paulcowan/.rvm/gems/jruby-1.6.3/gems/railties-3.1.0.rc5/lib/rails/commands/console.rb:8:in `start'
from /Users/paulcowan/.rvm/gems/jruby-1.6.3/gems/railties-3.1.0.rc5/lib/rails/commands.rb:40:in `(root)'
from org/jruby/RubyKernel.java:1047:in `require'
from script/rails:6:in `(root)'
I get this error of:
ArgumentError: wrong number of arguments (3 for 2)
Quite a lot with Rails 3.1r5. The whole thing looks fubar. Has anyone else ran into these problems?
I mentioned something very similar here:
ActiverREcord seems wrecked.
Here is what I am using for my jruby data access:
gem 'activerecord-jdbc-adapter'
gem 'activerecord-jdbcsqlite3-adapter'
gem 'jdbc-sqlite3', :require => false
Anybody else running into these problems?
I am able to create able to run my migrations from JRuby 1.6.3 and Rails 3.1rc5 and in a console session create a simple Role object like this:
jruby-1.6.3 :001 > role = Role.new(:name => "Admin")
(1.0ms) SELECT name
FROM sqlite_master
WHERE type = 'table' AND NOT name = 'sqlite_sequence'
=> #<Role id: nil, name: "Admin", created_at: nil, updated_at: nil>
All is good but when I run
Role.destroy_all
I get the following stack trace:
jruby-1.6.3 :003 > Role.destroy_all
ArgumentError: wrong number of arguments (3 for 2)
from /Users/paulcowan/.rvm/gems/jruby-1.6.3/gems/activerecord-3.1.0.rc5/lib/active_record/base.rb:470:in `find_by_sql'
from /Users/paulcowan/.rvm/gems/jruby-1.6.3/gems/activerecord-3.1.0.rc5/lib/active_record/relation.rb:111:in `to_a'
from /Users/paulcowan/.rvm/gems/jruby-1.6.3/gems/activerecord-3.1.0.rc5/lib/active_record/relation.rb:289:in `destroy_all'
from org/jruby/RubyBasicObject.java:1684:in `__send__'
from /Users/paulcowan/.rvm/gems/jruby-1.6.3/gems/activerecord-3.1.0.rc5/lib/active_record/base.rb:438:in `destroy_all'
from (irb):3:in `evaluate'
from org/jruby/RubyKernel.java:1093:in `eval'
from org/jruby/RubyKernel.java:1419:in `loop'
from org/jruby/RubyKernel.java:1205:in `catch'
from org/jruby/RubyKernel.java:1205:in `catch'
from /Users/paulcowan/.rvm/gems/jruby-1.6.3/gems/railties-3.1.0.rc5/lib/rails/commands/console.rb:45:in `start'
from /Users/paulcowan/.rvm/gems/jruby-1.6.3/gems/railties-3.1.0.rc5/lib/rails/commands/console.rb:8:in `start'
from /Users/paulcowan/.rvm/gems/jruby-1.6.3/gems/railties-3.1.0.rc5/lib/rails/commands.rb:40:in `(root)'
from org/jruby/RubyKernel.java:1047:in `require'
from script/rails:6:in `(root)'
It would seem all is not right between activerecord-3.1.0.rc5 and jruby.
Anybody any help on this?
There has been some progress on the activerecord-jdbc-adapter front and you can now get your setup working now by using the master branch of activerecord-jdbc-adapter. Just add the following to your Gemfile:
gem 'activerecord-jdbc-adapter', :git => 'https://github.com/nicksieger/activerecord-jdbc-adapter.git
I'd only recommend doing this if you cannot wait for the final activerecord-jdbc-adapter gem and certainly not in production.
You are correct. All is not right yet with activerecord-jdbc-adapter and Rails 3.1. I'm working on it and hope to have it ready by the time Rails 3.1 goes final.
Don't you have to specify conditions for it destroy_all?
e.g.
http://apidock.com/rails/ActiveRecord/Base/destroy_all/class