Installation on MacOS: Library not loaded: @rpath/libgz-sim7.7.dylib

After I installed gazebo on macos Ventura, I run gz sim -s. I got the following error:

Error while loading the library [/opt/homebrew/Cellar/gz-sim7/7.4.0/lib/gz-sim-7/plugins/libgz-sim-physics-system.dylib]: dlopen(/opt/homebrew/Cellar/gz-sim7/7.4.0/lib/gz-sim-7/plugins/libgz-sim-physics-system.dylib, 0x0085): Library not loaded: @rpath/libgz-sim7.7.dylib

Referenced from: <9DEF2606-09A2-33A9-83F8-1834C2A75BC9> /opt/homebrew/Cellar/gz-sim7/7.4.0/lib/gz-sim-7/plugins/libgz-sim7-physics-system.7.4.0.dylib

Reason: tried: ‘/opt/homebrew/Cellar/gz-sim7/7.4.0/lib/gz-sim-7/plugins/…/lib/libgz-sim7.7.dylib’ (no such file), ‘/opt/homebrew/Cellar/gz-sim7/7.4.0/lib/gz-sim-7/plugins/…/lib/libgz-sim7.7.dylib’ (no such file), ‘/opt/homebrew/Cellar/gz-plugin2/2.0.1/lib/…/lib/libgz-sim7.7.dylib’ (no such file), ‘/System/Volumes/Preboot/Cryptexes/OS@rpath/libgz-sim7.7.dylib’ (no such file), ‘/opt/homebrew/Cellar/gz-sim7/7.4.0/lib/gz-sim-7/plugins/…/lib/libgz-sim7.7.dylib’ (no such file), ‘/opt/homebrew/Cellar/gz-sim7/7.4.0/lib/gz-sim-7/plugins/…/lib/libgz-sim7.7.dylib’ (no such file), ‘/opt/homebrew/Cellar/gz-plugin2/2.0.1/lib/…/lib/libgz-sim7.7.dylib’ (no such file), ‘/usr/local/lib/libgz-sim7.7.dylib’ (no such file), ‘/usr/lib/libgz-sim7.7.dylib’ (no such file, not in dyld cache)

[Err] [SystemLoader.cc:140] Failed to load system plugin: (Reason: No plugins detected in library)
- Requested plugin name: [gz::sim::systems::Physics]
- Requested library name: [gz-sim-physics-system]
- Resolved library path: [/opt/homebrew/Cellar/gz-sim7/7.4.0/lib/gz-sim-7/plugins/libgz-sim-physics-system.dylib]

I followed the troubleshooting part: Gazebo.
I reinstalled ruby and upgraded brew. It still did not being solved.

1 Like

I solved this problem by adding the right ruby to my path.
in my case

/usr/local/Cellar/ruby/3.2.2/bin

do ls /usr/local/Cellar/ruby/ to see which version you have
Hope this helps.