Undefined method class_eval for ActiveRecord::ConnectionAdapters::JdbcAdapter

Hi,

I am trying to port an application from c-Ruby to JRuby. I have an
Oracle database backend and have added the JDBC driver jars to the lib
dir of JRuby. Also, I have set the required connection parameters in
database.yml.

Webrick is starting fine, but for any request, I get the following
error:

RedirectionController: missing default helper path redirection_helper
undefined method class_eval' for #<ActiveRecord::ConnectionAdapters::JdbcAdapter:0x1fffa73>^M /home/vdhussa/jruby-1.4.0/lib/ruby/gems/1.8/gems/activerecord-jdbc-adapter-0.9.2/lib/jdbc_adapter/jdbc_oracle.rb:29:inextended’^M
/home/vdhussa/jruby-1.4.0/lib/ruby/gems/1.8/gems/activerecord-jdbc-adapter-0.9.2/lib/active_record/connection_adapters/jdbc_adapter.rb:456:in
initialize'^M /home/vdhussa/jruby-1.4.0/lib/ruby/gems/1.8/gems/activerecord-jdbc-adapter-0.9.2/lib/active_record/connection_adapters/jdbc_adapter.rb:49:innew’^M
/home/vdhussa/jruby-1.4.0/lib/ruby/gems/1.8/gems/activerecord-jdbc-adapter-0.9.2/lib/active_record/connection_adapters/jdbc_adapter.rb:49:in
jdbc_connection'^M /home/vdhussa/jruby-1.4.0/lib/ruby/gems/1.8/gems/activerecord-1.15.6/lib/active_record/connection_adapters/abstract/connection_specification.rb:262:inconnection=’^M
/home/vdhussa/jruby-1.4.0/lib/ruby/gems/1.8/gems/activerecord-1.15.6/lib/active_record/query_cache.rb:54:in
connection='^M /home/vdhussa/jruby-1.4.0/lib/ruby/gems/1.8/gems/activerecord-1.15.6/lib/active_record/connection_adapters/abstract/connection_specification.rb:230:inretrieve_connection’^M
/home/vdhussa/jruby-1.4.0/lib/ruby/gems/1.8/gems/activerecord-1.15.6/lib/active_record/connection_adapters/abstract/connection_specification.rb:78:in
connection'^M /home/vdhussa/jruby-1.4.0/lib/ruby/gems/1.8/gems/activerecord-1.15.6/lib/active_record/base.rb:763:incolumns’^M
/home/vdhussa/Work/workspaces/jv3.0/devtools/dewey-3.0/dewey/vendor/plugins/simple_localization/lib/features/localized_column_human_name.rb:61:in
columns'^M /home/vdhussa/jruby-1.4.0/lib/ruby/gems/1.8/gems/activerecord-1.15.6/lib/active_record/base.rb:776:incolumn_names’^M
/home/vdhussa/jruby-1.4.0/lib/ruby/gems/1.8/gems/activerecord-1.15.6/lib/active_record/base.rb:789:in
column_methods_hash'^M /home/vdhussa/jruby-1.4.0/lib/ruby/gems/1.8/gems/activerecord-1.15.6/lib/active_record/base.rb:1757:inrespond_to?’^M
/home/vdhussa/Work/workspaces/jv3.0/devtools/dewey-3.0/dewey/vendor/plugins/attribute_i18n/lib/attribute_i18n.rb:58:in
respond_to_with_i18n_attribute_check?'^M /home/vdhussa/jruby-1.4.0/lib/ruby/1.8/pstore.rb:349:indump’^M
/home/vdhussa/jruby-1.4.0/lib/ruby/1.8/pstore.rb:349:in dump'^M /home/vdhussa/jruby-1.4.0/lib/ruby/1.8/pstore.rb:330:intransaction’^M
/home/vdhussa/jruby-1.4.0/lib/ruby/gems/1.8/gems/actionpack-1.13.6/lib/action_controller/cgi_ext/pstore_performance_fix.rb:26:in
initialize'^M /home/vdhussa/jruby-1.4.0/lib/ruby/1.8/cgi/session.rb:280:innew’^M
/home/vdhussa/jruby-1.4.0/lib/ruby/1.8/cgi/session.rb:280:in
initialize'^M /home/vdhussa/jruby-1.4.0/lib/ruby/gems/1.8/gems/actionpack-1.13.6/lib/action_controller/cgi_process.rb:136:innew’^M
/home/vdhussa/jruby-1.4.0/lib/ruby/gems/1.8/gems/actionpack-1.13.6/lib/action_controller/cgi_process.rb:136:in
session'^M /home/vdhussa/jruby-1.4.0/lib/ruby/gems/1.8/gems/actionpack-1.13.6/lib/action_controller/cgi_process.rb:168:instale_session_check!’^M

Any pointers and solutions would be helpful.

Thanks and regards
Varun

Hi,

I’ve been trying to get this running but am not successful. I have tried
with the oracle jdbc adapter as well as the old ActiveRecord_JDBC
package. I am running Rails v1.2.6. My current platform uses Ruby 1.8.7.

Looking forward to your help.

Thanks and regards

Varun

From: Dhussa, Varun [mailto:[email protected]]
Sent: Wednesday, November 18, 2009 1:50 PM
To: [email protected]
Subject: [jruby-user] undefined method class_eval for
ActiveRecord::ConnectionAdapters::JdbcAdapter

Hi,

I am trying to port an application from c-Ruby to JRuby. I have an
Oracle database backend and have added the JDBC driver jars to the lib
dir of JRuby. Also, I have set the required connection parameters in
database.yml.

Webrick is starting fine, but for any request, I get the following
error:

RedirectionController: missing default helper path redirection_helper

undefined method `class_eval’ for
#ActiveRecord::ConnectionAdapters::JdbcAdapter:0x1fffa73^M

/home/vdhussa/jruby-1.4.0/lib/ruby/gems/1.8/gems/activerecord-jdbc-adapter-0.9.2/lib/jdbc_adapter/jdbc_oracle.rb:29:in
`extended’^M

/home/vdhussa/jruby-1.4.0/lib/ruby/gems/1.8/gems/activerecord-jdbc-adapter-0.9.2/lib/active_record/connection_adapters/jdbc_adapter.rb:456:in
`initialize’^M

/home/vdhussa/jruby-1.4.0/lib/ruby/gems/1.8/gems/activerecord-jdbc-adapter-0.9.2/lib/active_record/connection_adapters/jdbc_adapter.rb:49:in
`new’^M

/home/vdhussa/jruby-1.4.0/lib/ruby/gems/1.8/gems/activerecord-jdbc-adapter-0.9.2/lib/active_record/connection_adapters/jdbc_adapter.rb:49:in
`jdbc_connection’^M

/home/vdhussa/jruby-1.4.0/lib/ruby/gems/1.8/gems/activerecord-1.15.6/lib/active_record/connection_adapters/abstract/connection_specification.rb:262:in
`connection='^M

/home/vdhussa/jruby-1.4.0/lib/ruby/gems/1.8/gems/activerecord-1.15.6/lib/active_record/query_cache.rb:54:in
`connection='^M

/home/vdhussa/jruby-1.4.0/lib/ruby/gems/1.8/gems/activerecord-1.15.6/lib/active_record/connection_adapters/abstract/connection_specification.rb:230:in
`retrieve_connection’^M

/home/vdhussa/jruby-1.4.0/lib/ruby/gems/1.8/gems/activerecord-1.15.6/lib/active_record/connection_adapters/abstract/connection_specification.rb:78:in
`connection’^M

/home/vdhussa/jruby-1.4.0/lib/ruby/gems/1.8/gems/activerecord-1.15.6/lib/active_record/base.rb:763:in
`columns’^M

/home/vdhussa/Work/workspaces/jv3.0/devtools/dewey-3.0/dewey/vendor/plugins/simple_localization/lib/features/localized_column_human_name.rb:61:in
`columns’^M

/home/vdhussa/jruby-1.4.0/lib/ruby/gems/1.8/gems/activerecord-1.15.6/lib/active_record/base.rb:776:in
`column_names’^M

/home/vdhussa/jruby-1.4.0/lib/ruby/gems/1.8/gems/activerecord-1.15.6/lib/active_record/base.rb:789:in
`column_methods_hash’^M

/home/vdhussa/jruby-1.4.0/lib/ruby/gems/1.8/gems/activerecord-1.15.6/lib/active_record/base.rb:1757:in
`respond_to?'^M

/home/vdhussa/Work/workspaces/jv3.0/devtools/dewey-3.0/dewey/vendor/plugins/attribute_i18n/lib/attribute_i18n.rb:58:in
`respond_to_with_i18n_attribute_check?'^M

/home/vdhussa/jruby-1.4.0/lib/ruby/1.8/pstore.rb:349:in `dump’^M

/home/vdhussa/jruby-1.4.0/lib/ruby/1.8/pstore.rb:349:in `dump’^M

/home/vdhussa/jruby-1.4.0/lib/ruby/1.8/pstore.rb:330:in `transaction’^M

/home/vdhussa/jruby-1.4.0/lib/ruby/gems/1.8/gems/actionpack-1.13.6/lib/action_controller/cgi_ext/pstore_performance_fix.rb:26:in
`initialize’^M

/home/vdhussa/jruby-1.4.0/lib/ruby/1.8/cgi/session.rb:280:in `new’^M

/home/vdhussa/jruby-1.4.0/lib/ruby/1.8/cgi/session.rb:280:in
`initialize’^M

/home/vdhussa/jruby-1.4.0/lib/ruby/gems/1.8/gems/actionpack-1.13.6/lib/action_controller/cgi_process.rb:136:in
`new’^M

/home/vdhussa/jruby-1.4.0/lib/ruby/gems/1.8/gems/actionpack-1.13.6/lib/action_controller/cgi_process.rb:136:in
`session’^M

/home/vdhussa/jruby-1.4.0/lib/ruby/gems/1.8/gems/actionpack-1.13.6/lib/action_controller/cgi_process.rb:168:in
`stale_session_check!'^M

Any pointers and solutions would be helpful.

Thanks and regards

Varun

Hi,

I tried the same with Rails 2.3.4 and the Oracle connection worked fine.
It seems that JRuby adapter doesn’t support Rails 1.2.6 completely.

Regards

Varun

From: Dhussa, Varun [mailto:[email protected]]
Sent: Friday, November 20, 2009 12:10 PM
To: [email protected]
Subject: RE: [jruby-user] undefined method class_eval for
ActiveRecord::ConnectionAdapters::JdbcAdapter

Hi,

I’ve been trying to get this running but am not successful. I have tried
with the oracle jdbc adapter as well as the old ActiveRecord_JDBC
package. I am running Rails v1.2.6. My current platform uses Ruby 1.8.7.

Looking forward to your help.

Thanks and regards

Varun

From: Dhussa, Varun [mailto:[email protected]]
Sent: Wednesday, November 18, 2009 1:50 PM
To: [email protected]
Subject: [jruby-user] undefined method class_eval for
ActiveRecord::ConnectionAdapters::JdbcAdapter

Hi,

I am trying to port an application from c-Ruby to JRuby. I have an
Oracle database backend and have added the JDBC driver jars to the lib
dir of JRuby. Also, I have set the required connection parameters in
database.yml.

Webrick is starting fine, but for any request, I get the following
error:

RedirectionController: missing default helper path redirection_helper

undefined method `class_eval’ for
#ActiveRecord::ConnectionAdapters::JdbcAdapter:0x1fffa73^M

/home/vdhussa/jruby-1.4.0/lib/ruby/gems/1.8/gems/activerecord-jdbc-adapter-0.9.2/lib/jdbc_adapter/jdbc_oracle.rb:29:in
`extended’^M

/home/vdhussa/jruby-1.4.0/lib/ruby/gems/1.8/gems/activerecord-jdbc-adapter-0.9.2/lib/active_record/connection_adapters/jdbc_adapter.rb:456:in
`initialize’^M

/home/vdhussa/jruby-1.4.0/lib/ruby/gems/1.8/gems/activerecord-jdbc-adapter-0.9.2/lib/active_record/connection_adapters/jdbc_adapter.rb:49:in
`new’^M

/home/vdhussa/jruby-1.4.0/lib/ruby/gems/1.8/gems/activerecord-jdbc-adapter-0.9.2/lib/active_record/connection_adapters/jdbc_adapter.rb:49:in
`jdbc_connection’^M

/home/vdhussa/jruby-1.4.0/lib/ruby/gems/1.8/gems/activerecord-1.15.6/lib/active_record/connection_adapters/abstract/connection_specification.rb:262:in
`connection='^M

/home/vdhussa/jruby-1.4.0/lib/ruby/gems/1.8/gems/activerecord-1.15.6/lib/active_record/query_cache.rb:54:in
`connection='^M

/home/vdhussa/jruby-1.4.0/lib/ruby/gems/1.8/gems/activerecord-1.15.6/lib/active_record/connection_adapters/abstract/connection_specification.rb:230:in
`retrieve_connection’^M

/home/vdhussa/jruby-1.4.0/lib/ruby/gems/1.8/gems/activerecord-1.15.6/lib/active_record/connection_adapters/abstract/connection_specification.rb:78:in
`connection’^M

/home/vdhussa/jruby-1.4.0/lib/ruby/gems/1.8/gems/activerecord-1.15.6/lib/active_record/base.rb:763:in
`columns’^M

/home/vdhussa/Work/workspaces/jv3.0/devtools/dewey-3.0/dewey/vendor/plugins/simple_localization/lib/features/localized_column_human_name.rb:61:in
`columns’^M

/home/vdhussa/jruby-1.4.0/lib/ruby/gems/1.8/gems/activerecord-1.15.6/lib/active_record/base.rb:776:in
`column_names’^M

/home/vdhussa/jruby-1.4.0/lib/ruby/gems/1.8/gems/activerecord-1.15.6/lib/active_record/base.rb:789:in
`column_methods_hash’^M

/home/vdhussa/jruby-1.4.0/lib/ruby/gems/1.8/gems/activerecord-1.15.6/lib/active_record/base.rb:1757:in
`respond_to?'^M

/home/vdhussa/Work/workspaces/jv3.0/devtools/dewey-3.0/dewey/vendor/plugins/attribute_i18n/lib/attribute_i18n.rb:58:in
`respond_to_with_i18n_attribute_check?'^M

/home/vdhussa/jruby-1.4.0/lib/ruby/1.8/pstore.rb:349:in `dump’^M

/home/vdhussa/jruby-1.4.0/lib/ruby/1.8/pstore.rb:349:in `dump’^M

/home/vdhussa/jruby-1.4.0/lib/ruby/1.8/pstore.rb:330:in `transaction’^M

/home/vdhussa/jruby-1.4.0/lib/ruby/gems/1.8/gems/actionpack-1.13.6/lib/action_controller/cgi_ext/pstore_performance_fix.rb:26:in
`initialize’^M

/home/vdhussa/jruby-1.4.0/lib/ruby/1.8/cgi/session.rb:280:in `new’^M

/home/vdhussa/jruby-1.4.0/lib/ruby/1.8/cgi/session.rb:280:in
`initialize’^M

/home/vdhussa/jruby-1.4.0/lib/ruby/gems/1.8/gems/actionpack-1.13.6/lib/action_controller/cgi_process.rb:136:in
`new’^M

/home/vdhussa/jruby-1.4.0/lib/ruby/gems/1.8/gems/actionpack-1.13.6/lib/action_controller/cgi_process.rb:136:in
`session’^M

/home/vdhussa/jruby-1.4.0/lib/ruby/gems/1.8/gems/actionpack-1.13.6/lib/action_controller/cgi_process.rb:168:in
`stale_session_check!'^M

Any pointers and solutions would be helpful.

Thanks and regards

Varun

Dhussa, Varun wrote:

Regards

Varun

I install Rails 2.3.5 but still got the same error:

(in C:/taapp/jruby-1.4.0/samples/redmine-0.8.7)
** Invoke environment (first_time)
** Execute environment
** Invoke db:migrate (first_time)
** Invoke environment
** Execute db:migrate
rake aborted!
undefined method class_eval' for #<ActiveRecord::ConnectionAdapters::JdbcAdapter:0x5bece2> C:/taapp/jruby-1.4.0/lib/ruby/gems/1.8/gems/activerecord-jdbc-adapter-0.9.2/lib/jdbc_adapter/jdbc_oracle.rb:29:in extended’
C:/taapp/jruby-1.4.0/lib/ruby/gems/1.8/gems/activerecord-jdbc-adapter-0.9.2/lib/active_record/connection_adapters/jdbc_adapter.rb:456:in
initialize' C:/taapp/jruby-1.4.0/lib/ruby/gems/1.8/gems/activerecord-jdbc-adapter-0.9.2/lib/active_record/connection_adapters/jdbc_adapter.rb:49:in new’
C:/taapp/jruby-1.4.0/lib/ruby/gems/1.8/gems/activerecord-jdbc-adapter-0.9.2/lib/active_record/connection_adapters/jdbc_adapter.rb:49:in
jdbc_connection' C:/taapp/jruby-1.4.0/samples/redmine-0.8.7/vendor/rails/activerecord/lib/active_record/connection_adapters/abstract/connection_specification.rb:292:in connecti
on=’
C:/taapp/jruby-1.4.0/samples/redmine-0.8.7/vendor/rails/activerecord/lib/active_record/connection_adapters/abstract/connection_specification.rb:260:in
retrieve _connection' C:/taapp/jruby-1.4.0/samples/redmine-0.8.7/vendor/rails/activerecord/lib/active_record/connection_adapters/abstract/connection_specification.rb:78:in connectio
n’
C:/taapp/jruby-1.4.0/samples/redmine-0.8.7/vendor/rails/activerecord/lib/active_record/migration.rb:408:in
initialize' C:/taapp/jruby-1.4.0/samples/redmine-0.8.7/vendor/rails/activerecord/lib/active_record/migration.rb:373:in new’
C:/taapp/jruby-1.4.0/samples/redmine-0.8.7/vendor/rails/activerecord/lib/active_record/migration.rb:373:in
up' C:/taapp/jruby-1.4.0/samples/redmine-0.8.7/vendor/rails/activerecord/lib/active_record/migration.rb:356:in migrate’
C:/taapp/jruby-1.4.0/samples/redmine-0.8.7/vendor/rails/railties/lib/tasks/databases.rake:99
C:/taapp/jruby-1.4.0/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:636:in
call' C:/taapp/jruby-1.4.0/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:636:in execute’
C:/taapp/jruby-1.4.0/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:631:in
each' C:/taapp/jruby-1.4.0/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:631:in execute’
C:/taapp/jruby-1.4.0/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:597:in
invoke_with_call_chain' C:/taapp/jruby-1.4.0/lib/ruby/1.8/monitor.rb:242:in mon_synchronize’
C:/taapp/jruby-1.4.0/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:590:in
invoke_with_call_chain' C:/taapp/jruby-1.4.0/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:583:in invoke’
C:/taapp/jruby-1.4.0/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2051:in
invoke_task' C:/taapp/jruby-1.4.0/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2029:in top_level’
C:/taapp/jruby-1.4.0/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2029:in
each' C:/taapp/jruby-1.4.0/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2029:in top_level’
C:/taapp/jruby-1.4.0/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2068:in
standard_exception_handling' C:/taapp/jruby-1.4.0/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2023:in top_level’
C:/taapp/jruby-1.4.0/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2001:in
run' C:/taapp/jruby-1.4.0/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2068:in standard_exception_handling’
C:/taapp/jruby-1.4.0/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:1998:in
run' C:/taapp/jruby-1.4.0/lib/ruby/gems/1.8/gems/rake-0.8.7/bin/rake:31 C:/taapp/jruby-1.4.0/lib/ruby/gems/1.8/gems/rake-0.8.7/bin/rake:19:in load’
C:\taapp\jruby-1.4.0\bin\rake:19

What’s the oracle jdbc driver you use?
Or anything I missed?

View this message in context:
http://old.nabble.com/undefined-method-class_eval-for-ActiveRecord%3A%3AConnectionAdapters%3A%3AJdbcAdapter-tp26404083p26585674.html
Sent from the JRuby - User mailing list archive at Nabble.com.


To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email