简体   繁体   English

如何让听 gem 与 Ruby 3.0.0p0 一起使用

[英]How to make listen gem work with Ruby 3.0.0p0

I installed Ruby 3.0.0p0 on my Macbook pro (2020 M1) and rails 6.1.3.我在我的 Macbook pro (2020 M1) 和 rails 6.1.3 上安装了 Ruby 3.0.0p0。 However, whenever attempting to start up the rails server on my machine, I get the following error:但是,每当尝试在我的机器上启动 rails 服务器时,我都会收到以下错误:

listen-3.2.1 requires ruby version >= 2.2.7, ~> 2.2, which is incompatible with the current version, ruby 3.0.0p0

Really need to get this up and running.真的需要启动并运行它。 Please help!请帮忙!

Thanks to this blog post: https://www.chadduffey.com/2021/03/Jekyll-Poop.html感谢这篇博文: https://www.chadduffey.com/2021/03/Jekyll-Poop.html

I was able to solve this issue by running:我能够通过运行来解决这个问题:

bundle update

and then to solve the subsequent error (when running the Jekyll server):然后解决后续的错误(运行 Jekyll 服务器时):

bundle add webrick

You can upgrade the version of listen gem.您可以升级listen gem的版本。 There are newer versions available: https://rubygems.org/gems/listen/versions/3.1.5有更新的版本可用: https://rubygems.org/gems/listen/versions/3.1.5

So if there is a version specified in the gem file, remove it and run bundle upgrade listen or just run bundle upgrade listen因此,如果 gem 文件中指定了版本,请将其删除并运行bundle upgrade listen或只运行bundle upgrade listen

You might need to play around a bit with different version, in case bundler doesn't find a version that matches with all other dependiencies of your app.您可能需要尝试使用不同的版本,以防 bundler 找不到与您应用程序的所有其他依赖项匹配的版本。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM