1

我正在尝试打开我的网页http://moneytree.space/catalogs/traders但我得到了:

在此处输入图像描述

独角兽和 nginx 正在运行。我的工作目录是 /home/zhall/zoulfia

   root@moneytree:/home/zhall/zoulfia# rails s -e production
      => Booting Unicorn
      => Rails 4.2.0 application starting in production on        

       http://localhost:3000

      => Run `rails server -h` for more startup options

      => Ctrl-C to shutdown server

当我输入:

在我的 /etc/nginx/sites-avalable/default 文件中,我得到:

在此处输入图像描述

我需要将 server_name 更改为 localhost 吗?我是所有这些配置的新手,任何帮助将不胜感激。谢谢你。也许我的服务器因为出现一些错误而关闭。我不知道在哪里追捕他们。我的日志文件是空的:(

我检查 nginx 配置:

 sudo nginx -t
 nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
 nginx: configuration file /etc/nginx/nginx.conf test is successful

当我启动 webrick 时:

Zoulfias-iMac:zoulfia zoulfiahall$ rails s -e production
=> Booting WEBrick
=> Rails 4.2.0 application starting in production on http://localhost:3000
=> Run `rails server -h` for more startup options
=> Ctrl-C to shutdown server
[2015-07-10 17:08:38] INFO  WEBrick 1.3.1
[2015-07-10 17:08:38] INFO  ruby 2.2.0 (2014-12-25) [x86_64-darwin13]
[2015-07-10 17:08:38] INFO  WEBrick::HTTPServer#start: pid=18631 port=3000

我启动我的应用程序没有问题。

当 Unicorn 服务器启动时,我得到:

 root@moneytree:/home/zhall/zoulfia# rails s -p80 -e production
 => Booting Unicorn
 => Rails 4.2.0 application starting in production on http://localhost:80
 => Run `rails server -h` for more startup options
 => Ctrl-C to shutdown server
root@moneytree:/home/zhall/zoulfia#    ------> this line should not be here!

如何设置应用程序日志记录以查看错误?

4

1 回答 1

0

我做了一件非常愚蠢的事情。我检查了我的 /home/zhall/zoulfia/config 文件,发现 unicorn.rb 文件在那里。我删除了文件并再次运行服务器。现在可以了。有些东西告诉我这不是结束……我会带着其他一些问题回来。

于 2015-07-10T20:36:04.557 回答