kubo / ruby-oci8

Ruby-oci8 - Oracle interface for ruby
Other
169 stars 78 forks source link

Install on M1 #255

Open maxgronlund opened 8 months ago

maxgronlund commented 8 months ago

I'm installing version 2.2.12 on a M1 mac. bundle install /Users/maxgronlund/.asdf/installs/ruby/2.7.7/lib/ruby/gems/2.7.0/gems/ruby-oci8-2.2.12/ext/oci8/oraconf.rb:507

It looks like the environment files are invalid, but after a little more invistigation i found that the problem is the support for the M1 processor is the problem.

I have installed instantclient in my download folder and it works as it should

Here is a message from the terminal

    from /Users/maxgronlund/.asdf/installs/ruby/2.7.7/lib/ruby/gems/2.7.0/gems/ruby-oci8-2.2.12/ext/oci8/oraconf.rb:257:in `get'
    from extconf.rb:22:in `<main>'
  skip: /opt/oracle/instantclient_19_8/libclntsh.dylib.19.1 is for x86_64 cpu.
kubo commented 8 months ago

Could you check your ruby architecture?

file /Users/maxgronlund/.asdf/installs/ruby/2.7.7/bin/ruby

If it prints Mach-O 64-bit executable arm64, you need to install ruby for intel architecture.

See https://www.stufro.com/2023/03/24/mac-m1-oracle-instant-client.html and then use intel ruby to install ruby-oci8.

kubo commented 2 weeks ago

Oracle Instant Client for macOS arm64 is out. https://www.oracle.com/database/technologies/instant-client/macos-arm64-downloads.html

I hope it works without ruby-oci8 code change.