Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Install in M1 and ruby 2.5.1 #236

Open
manukenar opened this issue Jul 5, 2021 · 7 comments
Open

Install in M1 and ruby 2.5.1 #236

manukenar opened this issue Jul 5, 2021 · 7 comments

Comments

@manukenar
Copy link

Hi,

ruby version :2.5.1
SO: Big Sur 11.3.1
Chip Apple M1

I cant use ruby-oci8, I just tried with 2.2.7, 2.2.8 and 2.2.9 and all have same error.

dlopen(/Users/mkenar/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/ruby-oci8-2.2.7/lib/oci8lib_250.bundle, 9): no suitable image found. Did find: (LoadError)
/Users/mkenar/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/ruby-oci8-2.2.7/lib/oci8lib_250.bundle: mach-o, but wrong architecture
/Users/mkenar/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/ruby-oci8-2.2.7/lib/oci8lib_250.bundle: mach-o, but wrong architecture - /Users/mkenar/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/ruby-oci8-2.2.7/lib/oci8lib_250.bundle

I used this command to install it in my mac -> arch -x86_64 gem install ruby-oci8
If I do not use arch -x86_64, the command gem install
return this:
`Error Message:
Could not compile with Oracle instant client.
You may need to set the environment variable RC_ARCHS or ARCHFLAGS as follows:

  RC_ARCHS=x86_64
  export RC_ARCHS

or
ARCHFLAGS='-arch x86_64'
export RC_ARCHS

If it does not fix the problem, delete all '-arch arm64'
in '/Users/mkenar/.rbenv/versions/2.5.1/lib/ruby/2.5.0/-darwin20/rbconfig.rb'.`

Thanks

@kubo
Copy link
Owner

kubo commented Jul 5, 2021

Could you use ruby-oci8 under arch -x86_64? For example:

$ arch -x86_64 ruby -roci8 -e "p OCI8.oracle_client_version"

@manukenar
Copy link
Author

Nop :(

mkenar@MacBook-Pro-de-mkenar ios-ui2 % arch -arm64 ruby -roci8 -e "p OCI8.oracle_client_version"

Traceback (most recent call last):
5: from /Users/mkenar/.rbenv/versions/2.5.1/lib/ruby/2.5.0/rubygems/core_ext/kernel_require.rb:39:in require' 4: from /Users/mkenar/.rbenv/versions/2.5.1/lib/ruby/2.5.0/rubygems/core_ext/kernel_require.rb:135:in rescue in require'
3: from /Users/mkenar/.rbenv/versions/2.5.1/lib/ruby/2.5.0/rubygems/core_ext/kernel_require.rb:135:in require' 2: from /Users/mkenar/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/ruby-oci8-2.2.7/lib/oci8.rb:107:in <top (required)>'
1: from /Users/mkenar/.rbenv/versions/2.5.1/lib/ruby/2.5.0/rubygems/core_ext/kernel_require.rb:59:in require' /Users/mkenar/.rbenv/versions/2.5.1/lib/ruby/2.5.0/rubygems/core_ext/kernel_require.rb:59:in require': dlopen(/Users/mkenar/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/ruby-oci8-2.2.7/lib/oci8lib_250.bundle, 9): no suitable image found. Did find: (LoadError)
/Users/mkenar/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/ruby-oci8-2.2.7/lib/oci8lib_250.bundle: mach-o, but wrong architecture
/Users/mkenar/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/ruby-oci8-2.2.7/lib/oci8lib_250.bundle: mach-o, but wrong architecture - /Users/mkenar/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/ruby-oci8-2.2.7/lib/oci8lib_250.bundle

@kubo
Copy link
Owner

kubo commented Jul 6, 2021

Could you use arch -x86_64 instead of arch -arm64?

@manukenar
Copy link
Author

arch -x86_64 ruby -roci8 -e "p OCI8.oracle_client_version"

Traceback (most recent call last):
5: from /Users/mkenar/.rbenv/versions/2.5.1/lib/ruby/2.5.0/rubygems/core_ext/kernel_require.rb:39:in require' 4: from /Users/mkenar/.rbenv/versions/2.5.1/lib/ruby/2.5.0/rubygems/core_ext/kernel_require.rb:135:in rescue in require'
3: from /Users/mkenar/.rbenv/versions/2.5.1/lib/ruby/2.5.0/rubygems/core_ext/kernel_require.rb:135:in require' 2: from /Users/mkenar/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/ruby-oci8-2.2.9/lib/oci8.rb:112:in <top (required)>'
1: from /Users/mkenar/.rbenv/versions/2.5.1/lib/ruby/2.5.0/rubygems/core_ext/kernel_require.rb:59:in require' /Users/mkenar/.rbenv/versions/2.5.1/lib/ruby/2.5.0/rubygems/core_ext/kernel_require.rb:59:in require': dlopen(/Users/mkenar/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/ruby-oci8-2.2.9/lib/oci8lib_250.bundle, 9): no suitable image found. Did find: (LoadError)
/Users/mkenar/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/ruby-oci8-2.2.9/lib/oci8lib_250.bundle: mach-o, but wrong architecture
/Users/mkenar/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/ruby-oci8-2.2.9/lib/oci8lib_250.bundle: mach-o, but wrong architecture - /Users/mkenar/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/ruby-oci8-2.2.9/lib/oci8lib_250.bundle

@kubo
Copy link
Owner

kubo commented Jul 6, 2021

Could you post the output of the following commands?

$ file /Users/mkenar/.rbenv/versions/2.5.1/bin/ruby
$ file /Users/mkenar/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/ruby-oci8-2.2.9/lib/oci8lib_250.bundle

If /Users/mkenar/.rbenv/versions/2.5.1/bin/ruby isn't universal binary, could you rebuild it as x86_64 or universal binary containing both x86_64 and arm64?
Oracle provides Oracle instant client for only x86_64 on macos. So both ruby and oci8lib_250.bundle must run as x86_64.

@manukenar
Copy link
Author

mkenar@MacBook-Pro-de-mkenar ~ % file /Users/mkenar/.rbenv/versions/2.5.1/bin/ruby
/Users/mkenar/.rbenv/versions/2.5.1/bin/ruby: Mach-O 64-bit executable arm64
mkenar@MacBook-Pro-de-mkenar ~ % file /Users/mkenar/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/ruby-oci8-2.2.9/lib/oci8lib_250.bundle
/Users/mkenar/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/ruby-oci8-2.2.9/lib/oci8lib_250.bundle: Mach-O 64-bit bundle x86_64
mkenar@MacBook-Pro-de-mkenar ~ %

@kubo
Copy link
Owner

kubo commented Jul 6, 2021

/Users/mkenar/.rbenv/versions/2.5.1/bin/ruby: Mach-O 64-bit executable arm64

Could you rebuild it as Mach-O 64-bit executable x86_64 or universal binary containing both x86_64 and arm64?
According to this page, x86_64 binary seems to be made by the -target x86_64-apple-macos10.12 C compiler option.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants