Hi,
I’m using JRuby 1.6.3 and I’ve installed Rals 3.1rc6 (which required
Arel 2.2.1) and created a new app with a simple migration file.
When I run rake db:migrate it creates my table and then throws the
following error:
rake aborted!
An error has occurred, this and all later migrations canceled:
(TypeError) can’t convert Arel::InsertManager into String
arjdbc/jdbc/RubyJdbcConnection.java:317:in execute_update' C:/Program Files/jruby-1.6.3/lib/ruby/gems/1.8/gems/activerecord-jdbc- adapter-1.1.3/lib/arjdbc/sqlite3/adapter.rb:149:in
insert_sql’
C:/Program Files/jruby-1.6.3/lib/ruby/gems/1.8/gems/activerecord-jdbc-
adapter-1.1.3/lib/arjdbc/jdbc/adapter.rb:195:in jdbc_insert' C:/Program Files/jruby-1.6.3/lib/ruby/gems/1.8/gems/ activerecord-3.1.0.rc6/lib/active_record/migration.rb:727:in
record_version_state_after
_migrating’
C:/Program Files/jruby-1.6.3/lib/ruby/gems/1.8/gems/
activerecord-3.1.0.rc6/lib/active_record/migration.rb:688:in migrate' org/jruby/RubyProc.java:268:in
call’
org/jruby/RubyProc.java:228:in call' C:/Program Files/jruby-1.6.3/lib/ruby/gems/1.8/gems/ activerecord-3.1.0.rc6/lib/active_record/migration.rb:742:in
ddl_transaction’
C:/Program Files/jruby-1.6.3/lib/ruby/gems/1.8/gems/
activerecord-3.1.0.rc6/lib/active_record/connection_adapters/abstract/
database_statement
s.rb:192:in transaction' C:/Program Files/jruby-1.6.3/lib/ruby/gems/1.8/gems/ activerecord-3.1.0.rc6/lib/active_record/transactions.rb:208:in
transaction’
C:/Program Files/jruby-1.6.3/lib/ruby/gems/1.8/gems/
activerecord-3.1.0.rc6/lib/active_record/migration.rb:742:in
ddl_transaction' C:/Program Files/jruby-1.6.3/lib/ruby/gems/1.8/gems/ activerecord-3.1.0.rc6/lib/active_record/migration.rb:686:in
migrate’
org/jruby/RubyArray.java:1603:in each' C:/Program Files/jruby-1.6.3/lib/ruby/gems/1.8/gems/ activerecord-3.1.0.rc6/lib/active_record/migration.rb:671:in
migrate’
C:/Program Files/jruby-1.6.3/lib/ruby/gems/1.8/gems/
activerecord-3.1.0.rc6/lib/active_record/migration.rb:549:in up' C:/Program Files/jruby-1.6.3/lib/ruby/gems/1.8/gems/ activerecord-3.1.0.rc6/lib/active_record/migration.rb:530:in
migrate’
C:/Program Files/jruby-1.6.3/lib/ruby/gems/1.8/gems/
activerecord-3.1.0.rc6/lib/active_record/railties/databases.rake:
161:in (root)' org/jruby/RubyProc.java:268:in
call’
org/jruby/RubyProc.java:228:in call' C:/Program Files/jruby-1.6.3/lib/ruby/gems/1.8/gems/rake-0.9.2/lib/ rake/task.rb:205:in
execute’
org/jruby/RubyArray.java:1603:in each' C:/Program Files/jruby-1.6.3/lib/ruby/gems/1.8/gems/rake-0.9.2/lib/ rake/task.rb:200:in
execute’
C:/Program Files/jruby-1.6.3/lib/ruby/gems/1.8/gems/rake-0.9.2/lib/
rake/task.rb:158:in invoke_with_call_chain' C:/Program Files/jruby-1.6.3/lib/ruby/1.8/monitor.rb:191:in
mon_synchronize’
C:/Program Files/jruby-1.6.3/lib/ruby/gems/1.8/gems/rake-0.9.2/lib/
rake/task.rb:151:in invoke_with_call_chain' C:/Program Files/jruby-1.6.3/lib/ruby/gems/1.8/gems/rake-0.9.2/lib/ rake/task.rb:144:in
invoke’
C:/Program Files/jruby-1.6.3/lib/ruby/gems/1.8/gems/rake-0.9.2/lib/
rake/application.rb:112:in invoke_task' C:/Program Files/jruby-1.6.3/lib/ruby/gems/1.8/gems/rake-0.9.2/lib/ rake/application.rb:90:in
top_level’
org/jruby/RubyArray.java:1603:in each' C:/Program Files/jruby-1.6.3/lib/ruby/gems/1.8/gems/rake-0.9.2/lib/ rake/application.rb:90:in
top_level’
C:/Program Files/jruby-1.6.3/lib/ruby/gems/1.8/gems/rake-0.9.2/lib/
rake/application.rb:129:in standard_exception_handling' C:/Program Files/jruby-1.6.3/lib/ruby/gems/1.8/gems/rake-0.9.2/lib/ rake/application.rb:84:in
top_level’
C:/Program Files/jruby-1.6.3/lib/ruby/gems/1.8/gems/rake-0.9.2/lib/
rake/application.rb:62:in run' C:/Program Files/jruby-1.6.3/lib/ruby/gems/1.8/gems/rake-0.9.2/lib/ rake/application.rb:129:in
standard_exception_handling’
C:/Program Files/jruby-1.6.3/lib/ruby/gems/1.8/gems/rake-0.9.2/lib/
rake/application.rb:59:in run' C:/Program Files/jruby-1.6.3/lib/ruby/gems/1.8/gems/rake-0.9.2/bin/ rake:32:in
(root)’
org/jruby/RubyKernel.java:1063:in load' C:/Program Files/jruby-1.6.3/bin/rake:19:in
(root)’
Tasks: TOP => db:migrate
I’m using sqlite3 but the same problem ocurrs if I use mysql.
Then I switched back to Rails 3.1.rc5 with Arel 2.1.4 and it works.
So it seems there is a bug in either Rails 3.1.rc6 or Arel 2.2.1.
Guilherme