I tried to start a simple rails app today to refresh my knowledge and ran into a very strange issue...
- Created app (rails new app-name).
- Created controller with index action (rails g controller site index).
- Set the root route to site#index.
- Start rails server.
The server tries to render the index view for site, but aborts abruptly with the following error:
dyld: lazy symbol binding failed: Symbol not found: _ffi_prep_closure_loc
Referenced from: /Users/Marco/.rbenv/versions/2.6.1/lib/ruby/gems/2.6.0/gems/ffi-1.13.1/lib/ffi_c.bundle
Expected in: /usr/lib/libffi.dylib
dyld: Symbol not found: _ffi_prep_closure_loc
Referenced from: /Users/Marco/.rbenv/versions/2.6.1/lib/ruby/gems/2.6.0/gems/ffi-1.13.1/lib/ffi_c.bundle
Expected in: /usr/lib/libffi.dylib
I tried (unsuccessfully):
- Upgrading my ruby version, then my rails version to latest.
- Reinstalling all my gems.
- Deleting the path to ffi_c.bundle and reinstalling ffi.
What is strange is that if I manually create the controller and the view, everything works fine!
I saw a suggestion on a somewhat related issue to try to change the C compiler on my machine to the default, but I don't understand why that would be necessary and I'd like to get a deeper understanding about what's going on.
ls -al /usr/lib/libffi.dylib
– Eminencebundle update rb-inotify
– Finery