简体   繁体   English

在生产模式下使用Helicon Zoo连接到数据库

[英]Connect to database using Helicon Zoo in production mode

I am using Ruby on Rails with Helicon Zoo on Windows Server 2008 R2. 我在Windows Server 2008 R2上的Helicon Zoo中使用了Ruby on Rails。 This webapp connects to a Windows SQL Server 2008 database that is on a different server in the same domain. 该Web应用程序连接到同一域中不同服务器上的Windows SQL Server 2008数据库。

When I try to connect to our SQL Server in production mode (web.config is set to production) I am getting this error in the web browser: 当我尝试以生产模式连接到我们的SQL Server(web.config设置为生产)时,我在Web浏览器中收到此错误:

"We're sorry, but something went wrong."

When I set the mode to development and connect everything works just fine. 当我将模式设置为开发并连接时,一切正常。

The settings for my development and production databases are setup exactly the same in database.yml. 我的开发和生产数据库的设置在database.yml中完全相同。 They are going to the same database on the same server with the same user and password. 他们将使用相同的用户名和密码访问同一服务器上的同一数据库。 (I have it set this way to test since it didn't work on our production sql server) (我设置了这种测试方式,因为它在我们的生产SQL服务器上不起作用)

Is there anything else I need to do to setup production mode for Rails when using Helicon Zoo? 使用Helicon Zoo时,我还需要做些其他事情来设置Rails的生产模式吗?

Here is the full error from ZooError.log: 这是ZooError.log的完整错误:

[9/25/2012 08:39:33]    MakeFirstRequest - Exception 
[9/25/2012 08:39:33]    NamedPipeConnection::Read error!
[9/25/2012 08:39:44]    ZooApplication I/O Error:
JobFastCgi:[/] _requestId:1, BACKEND_READ_COMPLETE, POST_MODE_PARTIAL

[9/25/2012 08:41:28]    Status: 500 Internal Server Error

Content-Type: text/html; charset=utf-8

Content-Length: 643

X-Request-Id: a86305bf7e5530a0852e85b8ba4876c2

X-Runtime: 0.281257

Date: Tue, 25 Sep 2012 13:41:28 GMT

X-Rack-Cache: miss



<!DOCTYPE html>
<html>
<head>
  <title>We're sorry, but something went wrong (500)</title>
  <style type="text/css">
    body { background-color: #fff; color: #666; text-align: center; font-family: arial, sans-serif; }
    div.dialog {
      width: 25em;
      padding: 0 4em;
      margin: 4em auto 0 auto;
      border: 1px solid #ccc;
      border-right-color: #999;
      border-bottom-color: #999;
    }
    h1 { font-size: 100%; color: #f00; line-height: 1.5em; }
  </style>
</head>

<body>
  <!-- This file lives in public/500.html -->
  <div class="dialog">
    <h1>We're sorry, but something went wrong.</h1>
  </div>
</body>
</html>

[9/25/2012 08:41:28]    FCGI_END_REQUEST

The problem wasn't with Helicon Zoo. 问题不在于Helicon Zoo。

When I re-examined the log/production.log file I noticed that I was getting an error like this: 当我重新检查log / production.log文件时,我发现我收到了这样的错误:

ActionView::Template::Error (application.css isn't precompiled):

So I did some searching on Stackoverflow and found this question: 所以我在Stackoverflow上做了一些搜索,发现了这个问题:

rails 3.1.0 ActionView::Template::Error (application.css isn't precompiled) rails 3.1.0 ActionView :: Template :: Error(未预编译application.css)

Following the advise of Chris Muench, I changed config.assets.compile which is located at config/environments/production.rb to true. 遵循Chris Muench的建议,我将位于config / environments / production.rb的config.assets.compile更改为true。

After this change everything worked great. 进行此更改后,一切工作正常。

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

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