2

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

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
4

1 回答 1

0

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

主机 = staticmatic.configuration.preview_server_host || “”

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

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

但请遵循这个为什么不起作用和解决方案

于 2010-12-16T13:33:54.960 回答