Ruby on Rails Friday, January 30, 2015

This very simple script was running in 4.1.6

require '.\config\config.rb'
require '.\models\transazioni.rb'

Transazioni.where(isprocessed: 'N').each do |tr|
puts tr.id_transazione + ' ' + tr.transdate.to_s + ' ' + tr.idmaximo.to_s + ' ' + tr.codsap
end

exit


database.yml:

# DATA SOURCE
datasource:  
  adapter: oracle_enhanced  
  url: jdbc:oracle:thin:@x.x.x.x:1521:xxxx
  username: xxx
  password: xxx



config.rb:

require 'rubygems'
require 'active_record'
require 'yaml'
require 'logger'
require 'C:/jrails4/jruby/lib/ojdbc6.jar'

@config_db = YAML::load(File.open("config/database.yml"))
$src_db = @config_db["datasource"]


Now with 4.2.0 I got this error:

C:/jrails4_update/jruby/lib/ruby/gems/shared/gems/activesupport-4.2.0/lib/active_support/dependencies.rb:587 warning: already initialized constant Reference
C:/jrails4_update/jruby/lib/ruby/gems/shared/gems/activesupport-4.2.0/lib/active_support/values/time_zone.rb:37 warning: already initialized constant MAPPING
C:/jrails4_update/jruby/lib/ruby/gems/shared/gems/activesupport-4.2.0/lib/active_support/values/time_zone.rb:186 warning: already initialized constant UTC_OFFSET_WITH_COLON
C:/jrails4_update/jruby/lib/ruby/gems/shared/gems/activesupport-4.2.0/lib/active_support/values/time_zone.rb:187 warning: already initialized constant UTC_OFFSET_WITHOUT_COLON
C:/jrails4_update/jruby/lib/ruby/gems/shared/gems/activerecord-4.2.0/lib/active_record/relation/delegation.rb:40 warning: already initialized constant BLACKLISTED_ARRAY_METHODS
ActiveSupport::Concern::MultipleIncludedBlocks: Cannot define multiple 'included' blocks for a Concern
               included at C:/jrails4_update/jruby/lib/ruby/gems/shared/gems/activesupport-4.2.0/lib/active_support/concern.rb:126
  ClassSpecificRelation at C:/jrails4_update/jruby/lib/ruby/gems/shared/gems/activerecord-4.2.0/lib/active_record/relation/delegation.rb:54
             Delegation at C:/jrails4_update/jruby/lib/ruby/gems/shared/gems/activerecord-4.2.0/lib/active_record/relation/delegation.rb:51
           ActiveRecord at C:/jrails4_update/jruby/lib/ruby/gems/shared/gems/activerecord-4.2.0/lib/active_record/relation/delegation.rb:6
                 (root) at C:/jrails4_update/jruby/lib/ruby/gems/shared/gems/activerecord-4.2.0/lib/active_record/relation/delegation.rb:5
                require at org/jruby/RubyKernel.java:1071
                require at C:/jrails4_update/jruby/lib/ruby/shared/rubygems/core_ext/kernel_require.rb:69
                require at C:/jrails4_update/jruby/lib/ruby/gems/shared/gems/activesupport-4.2.0/lib/active_support/dependencies.rb:274
        load_dependency at C:/jrails4_update/jruby/lib/ruby/gems/shared/gems/activesupport-4.2.0/lib/active_support/dependencies.rb:240
                require at C:/jrails4_update/jruby/lib/ruby/gems/shared/gems/activesupport-4.2.0/lib/active_support/dependencies.rb:274
                 (root) at C:/jrails4_update/jruby/lib/ruby/gems/shared/gems/activerecord-4.2.0/lib/active_record/base.rb:1
                 (root) at C:/jrails4_update/jruby/lib/ruby/gems/shared/gems/activerecord-4.2.0/lib/active_record/base.rb:23
                require at org/jruby/RubyKernel.java:1071
                require at C:/jrails4_update/jruby/lib/ruby/shared/rubygems/core_ext/kernel_require.rb:121
                 (root) at transcont.rb:4

Do I have to modify something or it's a bug?

Tnx
Fabio

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/d8546e07-aa04-45f2-9858-e6798c4ade12%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment