rsim / oracle-enhanced

Oracle enhaced adapter for ActiveRecord
MIT License
545 stars 307 forks source link

make ruby-oci8 a dependency #2238

Closed akostadinov closed 2 years ago

akostadinov commented 2 years ago

Make ruby-oci8 gem a standard dependency. Otherwise rails fails to properly generate a new project. Rails project is not very keen on changing the generator to support adding additional gems also it doesn't seem reasonable to require of them so. See rails/rails#44108

Steps to reproduce

rails new rails-ora-02014 --database=oracle

expected result

Things to work fine.

actual result

Bundle complete! 15 Gemfile dependencies, 75 gems now installed.
Use `bundle info [gemname]` to see where a bundled gem is installed.
         run  bundle binstubs bundler
       rails  importmap:install
rails aborted!
LoadError: ERROR: 'cannot load such file -- oci8'. ActiveRecord oracle_enhanced adapter could not load ruby-oci8 library. You may need install ruby-oci8 gem.
/home/avalon/ws/repos/rails-ora-02014/Rakefile:6:in `<main>'
bin/rails:4:in `<main>'

Caused by:
LoadError: cannot load such file -- oci8
/home/avalon/ws/repos/rails-ora-02014/Rakefile:6:in `<main>'
bin/rails:4:in `<main>'
(See full trace by running task with --trace)
       rails  turbo:install stimulus:install
rails aborted!
LoadError: ERROR: 'cannot load such file -- oci8'. ActiveRecord oracle_enhanced adapter could not load ruby-oci8 library. You may need install ruby-oci8 gem.
/home/avalon/ws/repos/rails-ora-02014/Rakefile:6:in `<main>'
bin/rails:4:in `<main>'

Caused by:
LoadError: cannot load such file -- oci8
/home/avalon/ws/repos/rails-ora-02014/Rakefile:6:in `<main>'
bin/rails:4:in `<main>'
(See full trace by running task with --trace)

System configuration

Oracle Enhanced Adapter version 7.0.0

Rails version: Rails 7.0.1

Ruby version: ruby 2.7.3p183 (2021-04-05 revision 6847ee089d) [x86_64-linux]

Oracle version: 19.3.0

mohits commented 2 years ago

Will that not cause a problem for JRuby-based installations?

akostadinov commented 2 years ago

Can be :platforms => :ruby or :platforms => :mri I guess.

mohits commented 2 years ago

Yes, well, of course! :)