One more error with rails 3.1

Run rake db:migrate:

rake aborted!
An error has occurred, this and all later migrations canceled:

private method split' called for #<Arel::InsertManager:0x687ae145> /home/mauro/jruby-1.6.4/lib/ruby/gems/1.8/gems/activerecord-jdbc-adapter-1.1.3/lib/arjdbc/postgresql/adapter.rb:250:inpg_insert’
/home/mauro/jruby-1.6.4/lib/ruby/gems/1.8/gems/activerecord-3.1.0/lib/active_record/migration.rb:727:in
record_version_state_after_migrating' /home/mauro/jruby-1.6.4/lib/ruby/gems/1.8/gems/activerecord-3.1.0/lib/active_record/migration.rb:688:inmigrate’
org/jruby/RubyProc.java:274:in call' org/jruby/RubyProc.java:229:incall’
/home/mauro/jruby-1.6.4/lib/ruby/gems/1.8/gems/activerecord-3.1.0/lib/active_record/migration.rb:742:in
ddl_transaction' /home/mauro/jruby-1.6.4/lib/ruby/gems/1.8/gems/activerecord-3.1.0/lib/active_record/connection_adapters/abstract/database_statements.rb:192:intransaction’
/home/mauro/jruby-1.6.4/lib/ruby/gems/1.8/gems/activerecord-3.1.0/lib/active_record/transactions.rb:208:in
transaction' /home/mauro/jruby-1.6.4/lib/ruby/gems/1.8/gems/activerecord-3.1.0/lib/active_record/migration.rb:742:inddl_transaction’
/home/mauro/jruby-1.6.4/lib/ruby/gems/1.8/gems/activerecord-3.1.0/lib/active_record/migration.rb:686:in
migrate' org/jruby/RubyArray.java:1603:ineach’
/home/mauro/jruby-1.6.4/lib/ruby/gems/1.8/gems/activerecord-3.1.0/lib/active_record/migration.rb:671:in
migrate' /home/mauro/jruby-1.6.4/lib/ruby/gems/1.8/gems/activerecord-3.1.0/lib/active_record/migration.rb:549:inup’
/home/mauro/jruby-1.6.4/lib/ruby/gems/1.8/gems/activerecord-3.1.0/lib/active_record/migration.rb:530:in
migrate' /home/mauro/jruby-1.6.4/lib/ruby/gems/1.8/gems/activerecord-3.1.0/lib/active_record/railties/databases.rake:161:in(root)’
org/jruby/RubyProc.java:274:in call' org/jruby/RubyProc.java:229:incall’
/home/mauro/jruby-1.6.4/lib/ruby/gems/1.8/gems/rake-0.9.2/lib/rake/task.rb:205:in
execute' org/jruby/RubyArray.java:1603:ineach’
/home/mauro/jruby-1.6.4/lib/ruby/gems/1.8/gems/rake-0.9.2/lib/rake/task.rb:200:in
execute' /home/mauro/jruby-1.6.4/lib/ruby/gems/1.8/gems/rake-0.9.2/lib/rake/task.rb:158:ininvoke_with_call_chain’
/home/mauro/jruby/lib/ruby/1.8/monitor.rb:191:in mon_synchronize' /home/mauro/jruby-1.6.4/lib/ruby/gems/1.8/gems/rake-0.9.2/lib/rake/task.rb:151:ininvoke_with_call_chain’
/home/mauro/jruby-1.6.4/lib/ruby/gems/1.8/gems/rake-0.9.2/lib/rake/task.rb:144:in
invoke' /home/mauro/jruby-1.6.4/lib/ruby/gems/1.8/gems/rake-0.9.2/lib/rake/application.rb:112:ininvoke_task’
/home/mauro/jruby-1.6.4/lib/ruby/gems/1.8/gems/rake-0.9.2/lib/rake/application.rb:90:in
top_level' org/jruby/RubyArray.java:1603:ineach’
/home/mauro/jruby-1.6.4/lib/ruby/gems/1.8/gems/rake-0.9.2/lib/rake/application.rb:90:in
top_level' /home/mauro/jruby-1.6.4/lib/ruby/gems/1.8/gems/rake-0.9.2/lib/rake/application.rb:129:instandard_exception_handling’
/home/mauro/jruby-1.6.4/lib/ruby/gems/1.8/gems/rake-0.9.2/lib/rake/application.rb:84:in
top_level' /home/mauro/jruby-1.6.4/lib/ruby/gems/1.8/gems/rake-0.9.2/lib/rake/application.rb:62:inrun’
/home/mauro/jruby-1.6.4/lib/ruby/gems/1.8/gems/rake-0.9.2/lib/rake/application.rb:129:in
standard_exception_handling' /home/mauro/jruby-1.6.4/lib/ruby/gems/1.8/gems/rake-0.9.2/lib/rake/application.rb:59:inrun’
/home/mauro/jruby-1.6.4/lib/ruby/gems/1.8/gems/rake-0.9.2/bin/rake:32:in
(root)' org/jruby/RubyKernel.java:1063:inload’
/home/mauro/jruby/bin/rake:19:in `(root)’
Tasks: TOP => db:migrate

If the migrations don’t work I can’t work :frowning:

On 2 September 2011 13:47, Mauro [email protected] wrote:

`record_version_state_after_migrating’

/home/mauro/jruby-1.6.4/lib/ruby/gems/1.8/gems/activerecord-3.1.0/lib/active_record/migration.rb:742:in

/home/mauro/jruby-1.6.4/lib/ruby/gems/1.8/gems/activerecord-3.1.0/lib/active_record/railties/databases.rake:161:in

/home/mauro/jruby/lib/ruby/1.8/monitor.rb:191:in mon_synchronize' top_level’
/home/mauro/jruby-1.6.4/lib/ruby/gems/1.8/gems/rake-0.9.2/bin/rake:32:in
(root)' org/jruby/RubyKernel.java:1063:in load’
/home/mauro/jruby/bin/rake:19:in `(root)’
Tasks: TOP => db:migrate

If the migrations don’t work I can’t work :frowning:

I only have this problem?

Does this work with jruby-1.6.3?

Does this work with ruby 1.9.2?

On 2 September 2011 22:08, Jeffrey L. [email protected] wrote:

Does this work with jruby-1.6.3?

No.

Does this work with ruby 1.9.2?

I don’t use ruby MRI.

Hi Mauro,

I’ve the same problem too:

rvm -v
rvm 1.8.0 by Wayne E. Seguin ([email protected])
[https://rvm.beginrescueend.com/]

java -version
java version “1.6.0_26”
Java™ SE Runtime Environment (build 1.6.0_26-b03)
Java HotSpot™ Server VM (build 20.1-b02, mixed mode)

uname -a
Linux tex-HP-G62-Notebook-PC 2.6.38-11-generic-pae #49-Ubuntu SMP Mon
Aug 29 21:07:33 UTC 2011 i686 i686 i386 GNU/Linux

rvm install jruby-1.6.4
rvm jruby-1.6.4
gem install rails
rails new rails310
cd rails310
rails g scaffold user name:string email:string password:string
active:boolean
rake db:migrate --trace

** Invoke db:migrate (first_time)
** Invoke environment (first_time)
** Execute environment
** Invoke db:load_config (first_time)
** Invoke rails_env (first_time)
** Execute rails_env
** Execute db:load_config
** Execute db:migrate
== CreateUsers: migrating

– create_table(:users)
→ 0.0050s
→ 0 rows
== CreateUsers: migrated (0.0050s)

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' /home/tex/.rvm/gems/jruby-1.6.4/gems/activerecord-jdbc-adapter-1.1.3/lib/arjdbc/sqlite3/adapter.rb:149:in insert_sql’
/home/tex/.rvm/gems/jruby-1.6.4/gems/activerecord-jdbc-adapter-1.1.3/lib/arjdbc/jdbc/adapter.rb:195:in
jdbc_insert' /home/tex/.rvm/gems/jruby-1.6.4/gems/activerecord-3.1.0/lib/active_record/migration.rb:727:in record_version_state_after_migrating’
/home/tex/.rvm/gems/jruby-1.6.4/gems/activerecord-3.1.0/lib/active_record/migration.rb:688:in
migrate' org/jruby/RubyProc.java:274:in call’
org/jruby/RubyProc.java:229:in call' /home/tex/.rvm/gems/jruby-1.6.4/gems/activerecord-3.1.0/lib/active_record/migration.rb:742:in ddl_transaction’
/home/tex/.rvm/gems/jruby-1.6.4/gems/activerecord-3.1.0/lib/active_record/connection_adapters/abstract/database_statements.rb:192:in
transaction' /home/tex/.rvm/gems/jruby-1.6.4/gems/activerecord-3.1.0/lib/active_record/transactions.rb:208:in transaction’
/home/tex/.rvm/gems/jruby-1.6.4/gems/activerecord-3.1.0/lib/active_record/migration.rb:742:in
ddl_transaction' /home/tex/.rvm/gems/jruby-1.6.4/gems/activerecord-3.1.0/lib/active_record/migration.rb:686:in migrate’
org/jruby/RubyArray.java:1603:in each' /home/tex/.rvm/gems/jruby-1.6.4/gems/activerecord-3.1.0/lib/active_record/migration.rb:671:in migrate’
/home/tex/.rvm/gems/jruby-1.6.4/gems/activerecord-3.1.0/lib/active_record/migration.rb:549:in
up' /home/tex/.rvm/gems/jruby-1.6.4/gems/activerecord-3.1.0/lib/active_record/migration.rb:530:in migrate’
/home/tex/.rvm/gems/jruby-1.6.4/gems/activerecord-3.1.0/lib/active_record/railties/databases.rake:161:in
(root)' org/jruby/RubyProc.java:274:in call’
org/jruby/RubyProc.java:229:in call' /home/tex/.rvm/gems/jruby-1.6.4@global/gems/rake-0.9.2/lib/rake/task.rb:205:in execute’
org/jruby/RubyArray.java:1603:in each' /home/tex/.rvm/gems/jruby-1.6.4@global/gems/rake-0.9.2/lib/rake/task.rb:200:in execute’
/home/tex/.rvm/gems/jruby-1.6.4@global/gems/rake-0.9.2/lib/rake/task.rb:158:in
invoke_with_call_chain' /home/tex/.rvm/rubies/jruby-1.6.4/lib/ruby/1.8/monitor.rb:191:in mon_synchronize’
/home/tex/.rvm/gems/jruby-1.6.4@global/gems/rake-0.9.2/lib/rake/task.rb:151:in
invoke_with_call_chain' /home/tex/.rvm/gems/jruby-1.6.4@global/gems/rake-0.9.2/lib/rake/task.rb:144:in invoke’
/home/tex/.rvm/gems/jruby-1.6.4@global/gems/rake-0.9.2/lib/rake/application.rb:112:in
invoke_task' /home/tex/.rvm/gems/jruby-1.6.4@global/gems/rake-0.9.2/lib/rake/application.rb:90:in top_level’
org/jruby/RubyArray.java:1603:in each' /home/tex/.rvm/gems/jruby-1.6.4@global/gems/rake-0.9.2/lib/rake/application.rb:90:in top_level’
/home/tex/.rvm/gems/jruby-1.6.4@global/gems/rake-0.9.2/lib/rake/application.rb:129:in
standard_exception_handling' /home/tex/.rvm/gems/jruby-1.6.4@global/gems/rake-0.9.2/lib/rake/application.rb:84:in top_level’
/home/tex/.rvm/gems/jruby-1.6.4@global/gems/rake-0.9.2/lib/rake/application.rb:62:in
run' /home/tex/.rvm/gems/jruby-1.6.4@global/gems/rake-0.9.2/lib/rake/application.rb:129:in standard_exception_handling’
/home/tex/.rvm/gems/jruby-1.6.4@global/gems/rake-0.9.2/lib/rake/application.rb:59:in
run' /home/tex/.rvm/gems/jruby-1.6.4@global/gems/rake-0.9.2/bin/rake:32:in (root)’
org/jruby/RubyKernel.java:1063:in load' /home/tex/.rvm/gems/jruby-1.6.4@global/bin/rake:19:in (root)’
Tasks: TOP => db:migrate

With MRI ruby-1.9.2-p290 the same list of commands works like a charm…

Il 02/09/2011 22:08, Jeffrey L. ha scritto:

On 3 September 2011 14:49, Gianluca T. (Tex)
[email protected] wrote:

Hi Mauro,

I’ve the same problem too:

So you confirm that the problem is related to jruby.

On 3 September 2011 18:47, Mauro [email protected] wrote:

On 3 September 2011 14:49, Gianluca T. (Tex) [email protected] wrote:

Hi Mauro,

I’ve the same problem too:

So you confirm that the problem is related to jruby.

perhaps the problem is in the db adapter gem.

Or it could be an issue with rails 3.1. It’s difficult to tell without a
comparison to MRI.

Sent from my iPhone

I’ve got it !!!

The problem is that launching rake db:migrate you are running jruby in
1.8 mode !

Running jruby in 1.9 mode the problem has gone !

Solution:

export JRUBY_OPTS=–1.9

Now launching rake db:migrate seems that it works without any problem !

Hope this helps…

Il 03/09/2011 18:55, Mauro ha scritto:

Sorry Mauro, the problem is still here…

I’ve followed this steps:

  1. Create the project with jruby (1.9 mode)
  2. rails g scaffold user name:string
  3. rake db:create (EXCEPTION !)
  4. Switch to ruby MRI (1.9 mode)
  5. rake db:create (with MRI the db has been created and the migration
    has been successfully executed)
  6. Switch to jruby (1.9 mode)
  7. rails g scaffold other_model name:string
  8. rake db:migrate (now it works under jruby, seems that the problem is
    only on first migration, maybe into db creation ?)

Hope this helps…

Il 03/09/2011 23:16, Gianluca T. (Tex) ha scritto:

On 3 September 2011 23:16, Gianluca T. (Tex)
[email protected] wrote:

Now launching rake db:migrate seems that it works without any problem !

Even with 1.9 I’ve the same problem with db:migrate…

I do see a similar issue

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' /home/kristian/install/jruby-1.6.2/lib/ruby/gems/1.8/gems/activerecord-jdbc-adapter-1.1.3/lib/arjdbc/sqlite3/adapter.rb:149:in insert_sql’
. . .

how did you create the application:

$ rails new myapp

or

$ rails new myapp -m http://jruby.org/rails3.rb

both Gemfile are jruby only, i.e. misses platforms declarations for
the jruby gems.

  • Kristian

On 5 September 2011 18:56, kristian [email protected] wrote:

how did you create the application:

$ rails new myapp

or

$ rails new myapp -m http://jruby.org/rails3.rb

I create a new app like this.
Seems that activerecord-jdbc-adapter is not compatible with rails 3.1
:frowning:

On 4 September 2011 12:37, Mauro [email protected] wrote:

export JRUBY_OPTS=–1.9

Now launching rake db:migrate seems that it works without any problem !

Even with 1.9 I’ve the same problem with db:migrate…

it sounds strange to me that no others here have this problem…

On Mon, Sep 5, 2011 at 5:00 PM, Mauro [email protected] wrote:

Try the branch master of activerecord-jdbc-adapter from github, it works for me.

Sorry for the delays in getting AR-JDBC up to Rails 3.1…the 3.1
release came suddenly and we had not enough time to finish
modifications. We should get it out soon.

As for the 1.9 problem, I’ve added a couple features to 1.6.x (1.6.5)
and master (1.7) to help:

  • You can build JRuby to default to 1.9 mode by passing
    -Djruby.default.ruby.version=1.9 to ant. I’m not sure if there’s a way
    to make rvm do this for you.
  • You can also use a .jrubyrc to set the Ruby version to run as with a
    line like “jruby.compat.version=1.9”

Hopefully those will solve all issues relating to JRuby defaulting
back to 1.8 mode.

  • Charlie

On 5 September 2011 18:56, kristian [email protected] wrote:

I do see a similar issue

rake aborted!
An error has occurred, this and all later migrations canceled:

Try the branch master of activerecord-jdbc-adapter from github, it works
for me.

On Tue, Sep 6, 2011 at 10:56 AM, Mauro [email protected] wrote:

But, without compiling, we can use directly the branch master at
github, isn’t it?
I’m doing so.

Yup, I don’t see why not.

  • Charlie

On 6 September 2011 16:13, Charles Oliver N. [email protected]
wrote:

  • You can build JRuby to default to 1.9 mode by passing
    -Djruby.default.ruby.version=1.9 to ant. I’m not sure if there’s a way
    to make rvm do this for you.
  • You can also use a .jrubyrc to set the Ruby version to run as with a
    line like “jruby.compat.version=1.9”

But, without compiling, we can use directly the branch master at
github, isn’t it?
I’m doing so.