Closed uxxman closed 3 years ago
@uxxman I haven't seen this exact error before, but it feels a lot like the rb-fsevent
gem was installed and natively built for a previous CPU (probably Intel on your old Mac) and then was migrated over. Does that sound possible? I've had similar problems when I upgraded OSX.
The fix in such cases is to uninstall the gem and reinstall it. As in:
gem uninstall rb-fsevent:0.10.4
gem install rb-fsevent:0.10.4
bundle install
but in this case you might just want to uninstall the entire version of Ruby from rbenv
and then reinstall it. That will force all its gems to be reinstalled and rebuilt.
@ColinDKelley thank you for the prompt response. I have tried uninstalling and reinstalling rb-fsevent but the issue remains. Even uninstalling the ruby and reinstalling it doesn't solve it
While researching I found this link https://qiita.com/kazutosato/items/6dea35e97f39d8d13e83#rails%E3%81%AE%E3%82%A4%E3%83%B3%E3%82%B9%E3%83%88%E3%83%BC%E3%83%AB
From google translate the gist is to change this
# config.file_watcher = ActiveSupport::EventedFileUpdateChecker
config.file_watcher = ActiveSupport::FileUpdateChecker
This indeed resolves the issue but are there any side-effects for this? Does this completely disables listen gem?
Oh, I see. The problem is in rb-fsevent
. It contains a Mac binary executable inside the gem(!):
https://github.com/thibaudgg/rb-fsevent/blob/master/bin/fsevent_watch
I'm very surprised that's not a native build step. Can you please file a ticket over there? It's easy to spot that it doesn't support the ARM:
$ file fsevent_watch
fsevent_watch Mach-O 64-bit executable x86_64
Re: this change:
config.file_watcher = ActiveSupport::FileUpdateChecker
I believe that setting tells Rails to not use listen
to watch for file changes. If so, that would be a work-around rather than a fix for listen
.
BTW the fsevent_watch
gem does have instructions here for rebuilding:
And it looks like there's already an issue there:
https://github.com/thibaudgg/rb-fsevent/issues/87
as well as a PR:
Thank you @ColinDKelley. I will follow the issue there 👍🏻
rb-fsevent version 0.11.0 has been released with mac M1 support, please give it a try!
@thibaudgg Excellent! Thank you for letting us know here.
@ColinDKelley I ran into the same issue and I am using the latest version of listen gem, any plans on updating the gem so it can use rb-fsevent version 0.11.0
?
@shailscript The listen gemspec is already compatible with that version. From the gemspec:
gem.add_dependency 'rb-fsevent', '~> 0.10', '>= 0.10.3'
So you can add version 0.11.0
to your Gemfile. Likely you can just do
bundle update rb-fsevent
Please respond back here to let us know how that works for you.
Yeah updating just rb-fsevent
works well, as you suggested 👍
Error Log