运行静态预览命令会导致 webrick 错误

发布于 2024-10-08 02:30:13 字数 1357 浏览 4 评论 0原文

使用以下静态预览命令时出现以下错误

staticmatic preview my-app
Site root is: my-app
StaticMatic Preview Server
Ctrl+C to exit
[2010-12-16 11:42:24] INFO  WEBrick 1.3.1
[2010-12-16 11:42:24] INFO  ruby 1.8.7 (2010-01-10) [i486-linux]
/usr/lib/ruby/1.8/webrick/utils.rb:63:in `getaddrinfo': getaddrinfo: Name or service not known (SocketError)
    from /usr/lib/ruby/1.8/webrick/utils.rb:63:in `create_listeners'
    from /usr/lib/ruby/1.8/webrick/server.rb:75:in `listen'
    from /usr/lib/ruby/1.8/webrick/server.rb:63:in `initialize'
    from /usr/lib/ruby/1.8/webrick/httpserver.rb:24:in `initialize'
    from /usr/lib/ruby/gems/1.8/gems/rack-1.2.1/lib/rack/handler/webrick.rb:10:in `new'
    from /usr/lib/ruby/gems/1.8/gems/rack-1.2.1/lib/rack/handler/webrick.rb:10:in `run'
    from /usr/lib/ruby/gems/1.8/gems/staticmatic-0.11.1/bin/../lib/staticmatic/server.rb:62:in `start'
    from /usr/lib/ruby/gems/1.8/gems/staticmatic-0.11.1/bin/../lib/staticmatic/mixins/server.rb:5:in `preview'
    from /usr/lib/ruby/gems/1.8/gems/staticmatic-0.11.1/bin/../lib/staticmatic/base.rb:71:in `send'
    from /usr/lib/ruby/gems/1.8/gems/staticmatic-0.11.1/bin/../lib/staticmatic/base.rb:71:in `run'
    from /usr/lib/ruby/gems/1.8/gems/staticmatic-0.11.1/bin/staticmatic:16
    from /usr/bin/staticmatic:19:in `load'
    from /usr/bin/staticmatic:19

I get the following error with the following staticmatic preview command

staticmatic preview my-app
Site root is: my-app
StaticMatic Preview Server
Ctrl+C to exit
[2010-12-16 11:42:24] INFO  WEBrick 1.3.1
[2010-12-16 11:42:24] INFO  ruby 1.8.7 (2010-01-10) [i486-linux]
/usr/lib/ruby/1.8/webrick/utils.rb:63:in `getaddrinfo': getaddrinfo: Name or service not known (SocketError)
    from /usr/lib/ruby/1.8/webrick/utils.rb:63:in `create_listeners'
    from /usr/lib/ruby/1.8/webrick/server.rb:75:in `listen'
    from /usr/lib/ruby/1.8/webrick/server.rb:63:in `initialize'
    from /usr/lib/ruby/1.8/webrick/httpserver.rb:24:in `initialize'
    from /usr/lib/ruby/gems/1.8/gems/rack-1.2.1/lib/rack/handler/webrick.rb:10:in `new'
    from /usr/lib/ruby/gems/1.8/gems/rack-1.2.1/lib/rack/handler/webrick.rb:10:in `run'
    from /usr/lib/ruby/gems/1.8/gems/staticmatic-0.11.1/bin/../lib/staticmatic/server.rb:62:in `start'
    from /usr/lib/ruby/gems/1.8/gems/staticmatic-0.11.1/bin/../lib/staticmatic/mixins/server.rb:5:in `preview'
    from /usr/lib/ruby/gems/1.8/gems/staticmatic-0.11.1/bin/../lib/staticmatic/base.rb:71:in `send'
    from /usr/lib/ruby/gems/1.8/gems/staticmatic-0.11.1/bin/../lib/staticmatic/base.rb:71:in `run'
    from /usr/lib/ruby/gems/1.8/gems/staticmatic-0.11.1/bin/staticmatic:16
    from /usr/bin/staticmatic:19:in `load'
    from /usr/bin/staticmatic:19

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

琉璃繁缕 2024-10-15 02:30:13

卷起袖子调试我的第一个 ruby​​ 应用程序后,我发现了这条虚假的行:

host = staticmatic.configuration.preview_server_host || “”

作为默认值,“”没有多大意义,因此它正在跟踪设置 staticmatic.configuration.preview_server_host 的位置,

文档说“您可以将一个名为 configuration.rb 的文件放在 staticmatic 项目的 basedir/src 目录中”,

但遵循 < a href="https://github.com/staticmatic/staticmatic/pull/17" rel="nofollow">this 了解为什么不起作用以及解决方案

having rolled my sleeves up and debugged my first ruby app, i find this spurious line:

host = staticmatic.configuration.preview_server_host || ""

not much point in "" as a default, so then it was tracing where to set staticmatic.configuration.preview_server_host

the docs say "You can put a file called configuration.rb in your staticmatic project's basedir/src directory"

but follow this for why that doesnt work and the solution

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文