运行'中间人'时这个错误是什么意思?

Ant*_*tiz -2 middleman

我遇到了这个中间人并尝试运行它,bundle exec middleman server但在终端中取回...

The source :rubygems is deprecated because HTTP requests are insecure. Please change your source to 'https://rubygems.org' if possible, or 'http://rubygems.org' if not.

== The Middleman is loading
== Port 4567 is unavailable. Either close the instance of Middleman already running on 4567 or start this Middleman on a new port with: --port=4568
Run Code Online (Sandbox Code Playgroud)

提前致谢!

Ant*_*tiz 9

我在中间人论坛找到了答案...如果你这样做:

lsof -i: <Port number>在这里输入您的港口#; 在我的情况下4567"

以上,将输出一个PID#,然后输入如下所示

kill -9 <PID here>

您将能够重新启动服务器.


小智 5

一个错误与您的Gemfile中的源声明有关。

它可能说

source :rubygems

在顶部。将此行更改为

source "https://rubygems.org"

或者http://rubygems.org如果您没有安装OpenSSL,请使用。

第二个错误的手段,那就是已经有别的东西在端口4567,这是默认的中间人端口上运行。也许您正在运行另一个中间人安装。确保关闭该端口或使用一个显式端口(当然也必须是空闲的)启动中间人,例如:

bundle exec middleman --port 5000

如果找不到正在运行的中间人实例,请尝试搜索可能正在使用port的ruby进程ps ax | grep ruby。这将为您提供进程ID,然后您可以使用它杀死进程:kill <id>。希望有帮助!