Git Product home page Git Product logo

activerecord-jdbcas400-adapter's People

Contributors

pierrickrouxel avatar queuebit avatar rsov avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

activerecord-jdbcas400-adapter's Issues

In the latest version, 1.3.20, where is @current_library defined?

@current_library shows up as part of the adapter.rb file when referencing tables and schema... however, it used to come from a System class from versions 1.3.19 and prior. Now it is never set and System class is gone.

I am getting errors because "tables" will use the @current_library value, which is never set and is nil.... so it throws the error:
Unable to retrieve tables without current library

Is this a bug, or is @current_library set somewhere else now?

StandardError: Unable to retrieve tables without current library

Without :current_library and :schema declared in database.yml I'm getting the following error. My intent is to connect to the IBM i and access legacy tables using the '*LIBL' library list. I'm using JRuby 9.1.6.0 with Rails 4.2.7.1 and the most current version of this gem.

Shouldn't this be working? What can I do to make it work?

James,

2017-02-09 08:02:00.862 APD:INFO Rails_Config loaded :development => Booting Puma => Rails 4.2.7.1 application starting in development on http://0.0.0.0:3000 => Run rails server -h for more startup options => Ctrl-C to shutdown server 2017-02-09 08:02:03.066 APD:DEBUG AgencyProfile Load (229.0ms) SELECT agency_profiles.* FROM agency_profiles ORDER BY agency_profiles.agency_number ASC 2017-02-09 08:02:03.209 APD:DEBUG (140.0ms) VALUES CURRENT_SCHEMA Exiting StandardError: Unable to retrieve tables without current library tables at /Users/jscott/rDeveloper/APDService/vendor/bundle/jruby/2.3.0/gems/activerecord-jdbcas400-adapter-1.3.20/lib/arjdbc/as400/adapter.rb:61 prepare_tables at /Users/jscott/rDeveloper/APDService/vendor/bundle/jruby/2.3.0/gems/activerecord-4.2.7.1/lib/active_record/connection_adapters/schema_cache.rb:90 table_exists? at /Users/jscott/rDeveloper/APDService/vendor/bundle/jruby/2.3.0/gems/activerecord-4.2.7.1/lib/active_record/connection_adapters/schema_cache.rb:22 table_exists? at /Users/jscott/rDeveloper/APDService/vendor/bundle/jruby/2.3.0/gems/activerecord-4.2.7.1/lib/active_record/model_schema.rb:230 get_primary_key at /Users/jscott/rDeveloper/APDService/vendor/bundle/jruby/2.3.0/gems/activerecord-4.2.7.1/lib/active_record/attribute_methods/primary_key.rb:97 reset_primary_key at /Users/jscott/rDeveloper/APDService/vendor/bundle/jruby/2.3.0/gems/activerecord-4.2.7.1/lib/active_record/attribute_methods/primary_key.rb:85 primary_key at /Users/jscott/rDeveloper/APDService/vendor/bundle/jruby/2.3.0/gems/activerecord-4.2.7.1/lib/active_record/attribute_methods/primary_key.rb:73 attributes_builder at /Users/jscott/rDeveloper/APDService/vendor/bundle/jruby/2.3.0/gems/activerecord-4.2.7.1/lib/active_record/model_schema.rb:234 instantiate at /Users/jscott/rDeveloper/APDService/vendor/bundle/jruby/2.3.0/gems/activerecord-4.2.7.1/lib/active_record/persistence.rb:68 block in find_by_sql at /Users/jscott/rDeveloper/APDService/vendor/bundle/jruby/2.3.0/gems/activerecord-4.2.7.1/lib/active_record/querying.rb:50 block in each at /Users/jscott/rDeveloper/APDService/vendor/bundle/jruby/2.3.0/gems/activerecord-4.2.7.1/lib/active_record/result.rb:51 each at org/jruby/RubyArray.java:1734 each at /Users/jscott/rDeveloper/APDService/vendor/bundle/jruby/2.3.0/gems/activerecord-4.2.7.1/lib/active_record/result.rb:51 map at org/jruby/RubyEnumerable.java:829 block in find_by_sql at /Users/jscott/rDeveloper/APDService/vendor/bundle/jruby/2.3.0/gems/activerecord-4.2.7.1/lib/active_record/querying.rb:50 instrument at /Users/jscott/rDeveloper/APDService/vendor/bundle/jruby/2.3.0/gems/activesupport-4.2.7.1/lib/active_support/notifications/instrumenter.rb:20 find_by_sql at /Users/jscott/rDeveloper/APDService/vendor/bundle/jruby/2.3.0/gems/activerecord-4.2.7.1/lib/active_record/querying.rb:49 exec_queries at /Users/jscott/rDeveloper/APDService/vendor/bundle/jruby/2.3.0/gems/activerecord-4.2.7.1/lib/active_record/relation.rb:639 load at /Users/jscott/rDeveloper/APDService/vendor/bundle/jruby/2.3.0/gems/activerecord-4.2.7.1/lib/active_record/relation.rb:515 to_a at /Users/jscott/rDeveloper/APDService/vendor/bundle/jruby/2.3.0/gems/activerecord-4.2.7.1/lib/active_record/relation.rb:243 collect at /Users/jscott/rDeveloper/APDService/vendor/bundle/jruby/2.3.0/gems/activerecord-4.2.7.1/lib/active_record/relation/delegation.rb:46 block in (root) at /Users/jscott/rDeveloper/APDService/config/initializers/agency_catalog_preload.rb:10 execute_hook at /Users/jscott/rDeveloper/APDService/vendor/bundle/jruby/2.3.0/gems/activesupport-4.2.7.1/lib/active_support/lazy_load_hooks.rb:36 block in run_load_hooks at /Users/jscott/rDeveloper/APDService/vendor/bundle/jruby/2.3.0/gems/activesupport-4.2.7.1/lib/active_support/lazy_load_hooks.rb:45 each at org/jruby/RubyArray.java:1734 run_load_hooks at /Users/jscott/rDeveloper/APDService/vendor/bundle/jruby/2.3.0/gems/activesupport-4.2.7.1/lib/active_support/lazy_load_hooks.rb:44 block in Finisher at /Users/jscott/rDeveloper/APDService/vendor/bundle/jruby/2.3.0/gems/railties-4.2.7.1/lib/rails/application/finisher.rb:62 instance_exec at org/jruby/RubyBasicObject.java:1726 run at /Users/jscott/rDeveloper/APDService/vendor/bundle/jruby/2.3.0/gems/railties-4.2.7.1/lib/rails/initializable.rb:30 block in run_initializers at /Users/jscott/rDeveloper/APDService/vendor/bundle/jruby/2.3.0/gems/railties-4.2.7.1/lib/rails/initializable.rb:55 block in tsort_each at /Users/jscott/.rvm/rubies/jruby-9.1.6.0/lib/ruby/stdlib/tsort.rb:228 block in each_strongly_connected_component at /Users/jscott/.rvm/rubies/jruby-9.1.6.0/lib/ruby/stdlib/tsort.rb:350 each_strongly_connected_component_from at /Users/jscott/.rvm/rubies/jruby-9.1.6.0/lib/ruby/stdlib/tsort.rb:431 block in each_strongly_connected_component at /Users/jscott/.rvm/rubies/jruby-9.1.6.0/lib/ruby/stdlib/tsort.rb:349 each at org/jruby/RubyArray.java:1734 call at org/jruby/RubyMethod.java:127 each_strongly_connected_component at /Users/jscott/.rvm/rubies/jruby-9.1.6.0/lib/ruby/stdlib/tsort.rb:347 tsort_each at /Users/jscott/.rvm/rubies/jruby-9.1.6.0/lib/ruby/stdlib/tsort.rb:226 tsort_each at /Users/jscott/.rvm/rubies/jruby-9.1.6.0/lib/ruby/stdlib/tsort.rb:205 run_initializers at /Users/jscott/rDeveloper/APDService/vendor/bundle/jruby/2.3.0/gems/railties-4.2.7.1/lib/rails/initializable.rb:54 initialize! at /Users/jscott/rDeveloper/APDService/vendor/bundle/jruby/2.3.0/gems/railties-4.2.7.1/lib/rails/application.rb:352 <main> at /Users/jscott/rDeveloper/APDService/config/environment.rb:5 require at org/jruby/RubyKernel.java:959 block in (root) at /Users/jscott/rDeveloper/APDService/vendor/bundle/jruby/2.3.0/gems/activesupport-4.2.7.1/lib/active_support/dependencies.rb:1 require at /Users/jscott/rDeveloper/APDService/vendor/bundle/jruby/2.3.0/gems/activesupport-4.2.7.1/lib/active_support/dependencies.rb:274 load_dependency at /Users/jscott/rDeveloper/APDService/vendor/bundle/jruby/2.3.0/gems/activesupport-4.2.7.1/lib/active_support/dependencies.rb:240 block in require at /Users/jscott/rDeveloper/APDService/vendor/bundle/jruby/2.3.0/gems/activesupport-4.2.7.1/lib/active_support/dependencies.rb:274 instance_eval at org/jruby/RubyBasicObject.java:1689 new_from_string at /Users/jscott/rDeveloper/APDService/config.ru:3 <eval> at /Users/jscott/rDeveloper/APDService/vendor/bundle/jruby/2.3.0/gems/rack-1.6.5/lib/rack/builder.rb:55 eval at org/jruby/RubyKernel.java:998 new_from_string at /Users/jscott/rDeveloper/APDService/config.ru:1 new_from_string at /Users/jscott/rDeveloper/APDService/vendor/bundle/jruby/2.3.0/gems/rack-1.6.5/lib/rack/builder.rb:49 parse_file at /Users/jscott/rDeveloper/APDService/vendor/bundle/jruby/2.3.0/gems/rack-1.6.5/lib/rack/builder.rb:40 build_app_and_options_from_config at /Users/jscott/rDeveloper/APDService/vendor/bundle/jruby/2.3.0/gems/rack-1.6.5/lib/rack/server.rb:299 app at /Users/jscott/rDeveloper/APDService/vendor/bundle/jruby/2.3.0/gems/rack-1.6.5/lib/rack/server.rb:208 app at /Users/jscott/rDeveloper/APDService/vendor/bundle/jruby/2.3.0/gems/railties-4.2.7.1/lib/rails/commands/server.rb:61 wrapped_app at /Users/jscott/rDeveloper/APDService/vendor/bundle/jruby/2.3.0/gems/rack-1.6.5/lib/rack/server.rb:336 log_to_stdout at /Users/jscott/rDeveloper/APDService/vendor/bundle/jruby/2.3.0/gems/railties-4.2.7.1/lib/rails/commands/server.rb:139 block in start at /Users/jscott/rDeveloper/APDService/vendor/bundle/jruby/2.3.0/gems/railties-4.2.7.1/lib/rails/commands/server.rb:78 tap at org/jruby/RubyKernel.java:1748 server at /Users/jscott/rDeveloper/APDService/vendor/bundle/jruby/2.3.0/gems/railties-4.2.7.1/lib/rails/commands/commands_tasks.rb:80 server at /Users/jscott/rDeveloper/APDService/vendor/bundle/jruby/2.3.0/gems/railties-4.2.7.1/lib/rails/commands/commands_tasks.rb:75 <main> at /Users/jscott/rDeveloper/APDService/vendor/bundle/jruby/2.3.0/gems/railties-4.2.7.1/lib/rails/commands/commands_tasks.rb:39 require at org/jruby/RubyKernel.java:959 <main> at /Users/jscott/rDeveloper/APDService/vendor/bundle/jruby/2.3.0/gems/railties-4.2.7.1/lib/rails/commands.rb:17

Unable to load gem

I added the gem to my gemfile, and bundled. When I try to run rails c, I get this error

vagrant@vagrant-ubuntu-trusty-64:/vagrant$ rails c
DEPRECATION WARNING: alias_method_chain is deprecated. Please, use Module#prepend instead. From module, you can access the original method using super. (called from require at bin/rails:4)
Bundler::GemRequireError: There was an error while trying to load the gem 'activerecord-jdbcas400-adapter'.
                      block in require at /home/vagrant/.rbenv/versions/jruby-9.0.4.0/lib/ruby/gems/shared/gems/bundler-1.11.2/lib/bundler/runtime.rb:81
                                  each at org/jruby/RubyArray.java:1560
                      block in require at /home/vagrant/.rbenv/versions/jruby-9.0.4.0/lib/ruby/gems/shared/gems/bundler-1.11.2/lib/bundler/runtime.rb:72
                                  each at org/jruby/RubyArray.java:1560
                               require at /home/vagrant/.rbenv/versions/jruby-9.0.4.0/lib/ruby/gems/shared/gems/bundler-1.11.2/lib/bundler/runtime.rb:61
                               require at /home/vagrant/.rbenv/versions/jruby-9.0.4.0/lib/ruby/gems/shared/gems/bundler-1.11.2/lib/bundler.rb:99
                                 <top> at /vagrant/config/application.rb:17
                               require at org/jruby/RubyKernel.java:939
                                (root) at /home/vagrant/.rbenv/versions/jruby-9.0.4.0/lib/ruby/gems/shared/gems/railties-5.0.0.beta3/lib/rails/commands/commands_tasks.rb:1
  require_application_and_environment! at /home/vagrant/.rbenv/versions/jruby-9.0.4.0/lib/ruby/gems/shared/gems/railties-5.0.0.beta3/lib/rails/commands/commands_tasks.rb:156
                               console at /home/vagrant/.rbenv/versions/jruby-9.0.4.0/lib/ruby/gems/shared/gems/railties-5.0.0.beta3/lib/rails/commands/commands_tasks.rb:77
                          run_command! at /home/vagrant/.rbenv/versions/jruby-9.0.4.0/lib/ruby/gems/shared/gems/railties-5.0.0.beta3/lib/rails/commands/commands_tasks.rb:49
                                 <top> at /home/vagrant/.rbenv/versions/jruby-9.0.4.0/lib/ruby/gems/shared/gems/railties-5.0.0.beta3/lib/rails/command.rb:20
                               require at org/jruby/RubyKernel.java:939
                                 <top> at bin/rails:4

I'm using gem 'rails', '>= 5.0.0.beta3' and jruby -v jruby 9.0.4.0 (2.2.2) 2015-11-12 b9fb7aa OpenJDK 64-Bit Server VM 24.95-b01 on 1.7.0_95-b00 +jit [linux-amd64]

Am I missing something?

Whats the highest Rails version supported? Rails 5.2.2 is not working

wrong number of arguments (given 4, expected 1..3) is the general response for every combination of drivers I've attempted. I happy to keep digging, but it seems as lost cause, which is why I ask "What is the highest Rails version supported by active record-jdbcas400-adapter?"

ActiveRecord::ConnectionNotEstablished after connected? is true

I'm struggling with a native connection to an OS400 machine using the adapter.

If I try to use AR, I get a ConnectionNotEstablished error as soon as I try to use an (apparently) established connection. If I connect to DB2 directly using DriverManager, it works.

Please have a look at this this transcript.

Thank you very much for helping me!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.