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

macOS SU2019 installation error #1

Open
thomthom opened this issue Dec 8, 2019 · 1 comment
Open

macOS SU2019 installation error #1

thomthom opened this issue Dec 8, 2019 · 1 comment
Labels

Comments

@thomthom
Copy link
Member

thomthom commented Dec 8, 2019

Error: #<LoadError: dlopen(/Users/thomas/Library/Application Support/SketchUp 2019/SketchUp/Gems/gems/ruby-prof-0.17.0/lib/ruby_prof.bundle, 9): Library not loaded: /Users/tthomas2/.rvm/rubies/ruby-2.5.5/lib/libruby.2.5.dylib
  Referenced from: /Users/thomas/Library/Application Support/SketchUp 2019/SketchUp/Gems/gems/ruby-prof-0.17.0/lib/ruby_prof.bundle
  Reason: image not found - /Users/thomas/Library/Application Support/SketchUp 2019/SketchUp/Gems/gems/ruby-prof-0.17.0/lib/ruby_prof.bundle>
/Applications/SketchUp 2019/SketchUp.app/Contents/Frameworks/Ruby.framework/Versions/2.5.5/lib/ruby/2.5.0/rubygems/core_ext/kernel_require.rb:59:in `require'
/Applications/SketchUp 2019/SketchUp.app/Contents/Frameworks/Ruby.framework/Versions/2.5.5/lib/ruby/2.5.0/rubygems/core_ext/kernel_require.rb:59:in `require'
/Users/thomas/Library/Application Support/SketchUp 2019/SketchUp/Gems/gems/ruby-prof-0.17.0/lib/ruby-prof.rb:8:in `rescue in <top (required)>'
/Users/thomas/Library/Application Support/SketchUp 2019/SketchUp/Gems/gems/ruby-prof-0.17.0/lib/ruby-prof.rb:4:in `<top (required)>'
/Applications/SketchUp 2019/SketchUp.app/Contents/Frameworks/Ruby.framework/Versions/2.5.5/lib/ruby/2.5.0/rubygems/core_ext/kernel_require.rb:59:in `require'
/Applications/SketchUp 2019/SketchUp.app/Contents/Frameworks/Ruby.framework/Versions/2.5.5/lib/ruby/2.5.0/rubygems/core_ext/kernel_require.rb:59:in `require'
/Users/thomas/SourceTree/speedup/src/speedup/setup.rb:41:in `setup'
/Users/thomas/SourceTree/speedup/src/speedup/bootstrap.rb:45:in `block in <module:SpeedUp>'
@thomthom thomthom added the bug label Dec 8, 2019
@thomthom
Copy link
Member Author

thomthom commented Dec 8, 2019

The the ruby_prof.bundle is referring to Ruby by absolute path of what compiled it. This needs to be changed to be relative to SketchUp.

Complications because SU fully qualify frameworks with patch versions, so Ruby upgrades from 2.5.1 to 2.5.3 to 2.5.5 have Ruby located at different locations relative to the SketchUp app. Need to use @rpath. Unfortunately it's not possible to future predict this, so the binary needs to change any time SU updates the Ruby version, even patch versions.

Macintosh HD/⁨Applications/⁨SketchUp 2019/⁨SketchUp/⁨Contents/⁨Frameworks/⁨Ruby.framework/⁨Versions/⁨2.5.5⁩
Macintosh HD⁩/⁨Applications⁩/⁨SketchUp 2019⁩/⁨SketchUp⁩/⁨Contents⁩/⁨MacOS⁩

libruby.2.5.dylib

../Frameworks/⁨Ruby.framework/⁨Versions/⁨2.5.5⁩


-otool -L ruby_prof.bundle

ruby_prof.bundle:
	/Users/tthomas2/.rvm/rubies/ruby-2.2.10/lib/libruby.2.2.0.dylib (compatibility version 2.2.0, current version 2.2.10)
	/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1226.10.1)
	/usr/lib/libobjc.A.dylib (compatibility version 1.0.0, current version 228.0.0)

ruby_prof.bundle:
	/Users/tthomas2/.rvm/rubies/ruby-2.5.5/lib/libruby.2.5.dylib (compatibility version 2.5.0, current version 2.5.5)
	/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1226.10.1)
	/usr/lib/libobjc.A.dylib (compatibility version 1.0.0, current version 228.0.0)


/Users/thomas/Library/Application Support/SketchUp 2019/SketchUp/Gems/gems/ruby-prof-0.17.0/lib

install_name_tool -change /Users/tthomas2/.rvm/rubies/ruby-2.5.5/lib/libruby.2.5.dylib "@executable_path/../Frameworks/Ruby.framework/Versions/2.5.5/libruby.2.5.dylib" ruby_prof.bundle



-otool -L ruby_prof.bundle

"@rpath/libruby.dylib" => Seems to exist for all versions? Better to use this link name?


"@rpath/libruby.2.2.dylib" => Doesn't exist for SU2017-SU2018
"@rpath/libruby.2.2.0.dylib" => Does exist for SU2017-SU2018

install_name_tool -change /Users/tthomas2/.rvm/rubies/ruby-2.2.10/lib/libruby.2.2.0.dylib "@rpath/libruby.2.2.0.dylib" ruby_prof.bundle
install_name_tool -add_rpath "@executable_path/../Frameworks/Ruby.framework/Versions/2.2/" ruby_prof.bundle


"@rpath/libruby.2.5.dylib" => Does exist, at least for SU2019.3 (was this true for previous SU2019 versions?)

install_name_tool -change /Users/tthomas2/.rvm/rubies/ruby-2.5.5/lib/libruby.2.5.dylib "@rpath/libruby.2.5.dylib" ruby_prof.bundle
install_name_tool -add_rpath "@executable_path/../Frameworks/Ruby.framework/Versions/2.5.1/" ruby_prof.bundle
install_name_tool -add_rpath "@executable_path/../Frameworks/Ruby.framework/Versions/2.5.3/" ruby_prof.bundle
install_name_tool -add_rpath "@executable_path/../Frameworks/Ruby.framework/Versions/2.5.5/" ruby_prof.bundle


-otool -l

https://matthew-brett.github.io/docosx/mac_runtime_link.html

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

No branches or pull requests

1 participant