Rails CouchDB App无法在Production中使用

时间:2011-02-24 02:44:16

标签: ruby-on-rails couchdb

我在生产服务器上部署了我的应用并收到以下错误:

(你的config / couchdb.yml文件有问题。检查并确保它存在且语法正确。)

couchdb.yml文件如下:

base: &base
 database_prefix: 
 database_suffix: _<%%= RAILS_ENV %>

development:
  host: localhost
  port: 5984
  <<: *base

test:
  host: localhost
  port: 5984
  <<: *base

  production:
      host: localhost
      port: 5984
      <<: *base

并在boot.rb中

require 'rubygems'

# Set up gems listed in the Gemfile.
ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__)

require 'bundler/setup' if File.exists?(ENV['BUNDLE_GEMFILE'])
require 'simply_stored/couch'
CouchPotato::Config.database_name = "http://localhost:5984/thedatabase"

数据库已经创建并在本地运行;问题出在生产服务器上,安装了所有宝石;不知道为什么我错过了我应该为生产指定不同的东西..已经尝试过主机为127.0.0.1。没有运气

在couchdb_initializer.rb上抛出错误;代码是通用的(已经由gem生成)。

我可以使用rails服务器运行应用程序并使用3000端口打开;但是当我使用ngingx +乘客通过http://

时,我得到了第一个错误

2 个答案:

答案 0 :(得分:1)

您的作品couchdb.yml实际上是否包含“all:”?如果是这样,尝试将其设置为“production:”,看起来代码没有任何特殊逻辑来确定couchdb.yml文件中的“all”环境应该真正适用于所有环境时是专门寻找“生产”。

答案 1 :(得分:1)

文件上的标识错误。

  production:
      host: localhost
      port: 5984
      <<: *base