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

Macbook M1 JRuby 9.4.2.0 Could not open library 'fixposix' 'libfixposix.dylib' #7793

Closed
reydi opened this issue May 17, 2023 · 2 comments · Fixed by #7802
Closed

Macbook M1 JRuby 9.4.2.0 Could not open library 'fixposix' 'libfixposix.dylib' #7793

reydi opened this issue May 17, 2023 · 2 comments · Fixed by #7802
Assignees
Milestone

Comments

@reydi
Copy link

reydi commented May 17, 2023

Problem

  • After upgrading from jruby-9.3.3.0 to jruby-9.4.x.x, I don't seem to be able to run my Rails 7.0.4.3 app as usual
  • Here's the error, seems that ffi cannot find fixposix and libfixposix.dylib, which was added in JRuby-9.4.0.0

reydi_Reydi-M1___Projects_happy5_Performance-API

Could not open library 'fixposix' : dlopen(fixposix, 0x0005): tried: 'fixposix' (no such file),
  '/System/Volumes/Preboot/Cryptexes/OSfixposix' (no such file), 
  '/opt/homebrew/Cellar/openjdk/20.0.1/libexec/openjdk.jdk/Contents/Home/bin/server/fixposix' (no such file), 
  '/opt/homebrew/Cellar/openjdk/20.0.1/libexec/openjdk.jdk/Contents/Home/bin/./fixposix' (no such file), 
  '/opt/homebrew/Cellar/openjdk/20.0.1/libexec/openjdk.jdk/Contents/Home/bin/../lib/fixposix' (no such file), 
  '/usr/lib/fixposix' (no such file, not in dyld cache), 
  'fixposix' (no such file)
Could not open library 'libfixposix.dylib' : dlopen(libfixposix.dylib, 0x0005): tried: 'libfixposix.dylib' (no such file), 
  '/System/Volumes/Preboot/Cryptexes/OSlibfixposix.dylib' (no such file), 
  '/opt/homebrew/Cellar/openjdk/20.0.1/libexec/openjdk.jdk/Contents/Home/bin/server/libfixposix.dylib' (no such file), 
  '/opt/homebrew/Cellar/openjdk/20.0.1/libexec/openjdk.jdk/Contents/Home/bin/./libfixposix.dylib' (no such file), 
  '/opt/homebrew/Cellar/openjdk/20.0.1/libexec/openjdk.jdk/Contents/Home/bin/../lib/libfixposix.dylib' (no such file), 
  '/usr/lib/libfixposix.dylib' (no such file, not in dyld cache), 
  'libfixposix.dylib' (no such file), 
  • I've looked everywhere in the rbenv gem file of subspawn, homebrew/openjdk, but seems that installing new JRuby doesn't seem to automatically build the fixposix binary file to be available for the ffi to open the library required by JRuby 9.4.x.x.

  • So I've tried to build it my self using byteit101/subspawn, and it was successfully built
    reydi_Reydi-M1___Projects_happy5_Performance-API

  • Then I go back to my rails project, try to run rspec again just to verify. But now I'm stuck here.
    reydi_Reydi-M1___Projects_happy5_Performance-API

Machine

Apple Macbook Air M1 2020, MacOS Ventura 3.3.1 (a) (22E772610a) (May 1, 2023; 14 days ago)

$ uname -a
Darwin Reydi-M1.local 22.4.0 Darwin Kernel Version 22.4.0: Mon Mar  6 21:00:41 PST 2023; root:xnu-8796.101.5~3/RELEASE_ARM64_T8103 arm64

Installed JRuby via RBenv, seems to be no issue

$ rbenv install jruby-9.4.2.0
To follow progress, use 'tail -f /var/folders/m8/z1jd_cnn6031x3g84vp2hgxw0000gn/T/ruby-build.20230516151022.41309.log' or pass --verbose
Downloading jruby-dist-9.4.2.0-bin.tar.gz...
-> https://dqw8nmjcqpjn7.cloudfront.net/c2b065c5546d398343f86ddea68892bb4a4b4345e6c8875e964a97377733c3f1
Installing jruby-9.4.2.0...
Installed jruby-9.4.2.0 to /Users/reydi/.rbenv/versions/jruby-9.4.2.0

Local Env Vars (~/.zshrc), added latest brew install openjdk (20.0.1) to $JAVA_HOME

export RUBY_CONFIGURE_OPTS="--with-openssl-dir=$(brew --prefix openssl@1.1)"

export PATH="/bin:/usr/bin:/usr/sbin:/usr/local/bin:${PATH}"
export PATH="/Applications/Sublime Text.app/Contents/SharedSupport/bin:${PATH}"
export PATH="${HOME}/.rbenv/bin:${PATH}"
export PATH="/opt/homebrew/bin:${PATH}"

export DYLD_FALLBACK_LIBRARY_PATH=/usr/lib

if which rbenv > /dev/null; then eval "$(rbenv init -)"; fi

export JAVA_HOME="/opt/homebrew/opt/openjdk"
export JAVA_OPTS="--add-opens java.base/sun.nio.ch=ALL-UNNAMED --add-opens java.base/java.io=ALL-UNNAMED"

Question

I'm wondering if there's something I miss to configure that I have to go through all of this step..

  • I've been running jruby-9.3.3.0 okay for the past couple of months with my Rails codebase.
  • Works ok on Rails 3.0.6
    Cursor_and_reydi_Reydi-M1___Projects_happy5_Performance-API
@enebo enebo added this to the JRuby 9.4.3.0 milestone May 17, 2023
@byteit101 byteit101 self-assigned this May 18, 2023
@byteit101
Copy link
Member

Also reported upstream as byteit101/subspawn#2

@byteit101
Copy link
Member

Fixed as binary 0.5.1.1 upstream, creating pom.rb update

byteit101 added a commit that referenced this issue May 22, 2023
M1 binaries weren't actually arm
headius added a commit that referenced this issue May 22, 2023
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

Successfully merging a pull request may close this issue.

3 participants