新手问题 部署 discourse 遇到的问题

zicjin · April 25, 2014 · Last by zicjin replied at May 03, 2014 · 2562 hits

https://github.com/discourse/discourse/blob/master/docs/INSTALL-ubuntu.md 我按照这个流程部署 discourse 后访问页面得到 nginx 502,查看 thin log 得到这样的信息: /var/www/discourse/vendor/bundle/ruby/2.0.0/gems/activerecord-4.0.4/lib/active_record/connection_adapters/postgresql_adapter.rb:848:in `initialize': fe_sendauth: no password supplied (PG::Error)

学着读一下错误信息:no password supplied,说明你没有在 discourse 的配置文件里输入 psql 数据库的密码。它官方的这个写得不算很靠谱,要自己改一些东西的…

Warning: This Guide is Deprecated

这么大的标题字体楼主应该有看到才是

#1 楼 正解。需要在 config/discourse.conf 里加入数据库的配置,包括账号密码

#1 楼 @cassiuschen 谢谢,我在 discourse.conf 找到了 db_password 的配置。然后运行页面变成 500 了,看到 production_errors.log 错误日志为:

…… [RAILS_ROOT]/vendor/bundle/ruby/2.0.0/gems/thin-1.6.1/lib/thin/connection.rb:80:in catch' [RAILS_ROOT]/vendor/bundle/ruby/2.0.0/gems/thin-1.6.1/lib/thin/connection.rb:80:inpre_process' [RAILS_ROOT]/vendor/bundle/ruby/2.0.0/gems/thin-1.6.1/lib/thin/connection.rb:55:in process' [RAILS_ROOT]/vendor/bundle/ruby/2.0.0/gems/thin-1.6.1/lib/thin/connection.rb:41:inreceive_data' [RAILS_ROOT]/vendor/bundle/ruby/2.0.0/gems/eventmachine-1.0.3/lib/eventmachine.rb:187:in run_machine' [RAILS_ROOT]/vendor/bundle/ruby/2.0.0/gems/eventmachine-1.0.3/lib/eventmachine.rb:187:inrun' [RAILS_ROOT]/vendor/bundle/ruby/2.0.0/gems/thin-1.6.1/lib/thin/backends/base.rb:73:in start' [RAILS_ROOT]/vendor/bundle/ruby/2.0.0/gems/thin-1.6.1/lib/thin/server.rb:162:instart' [RAILS_ROOT]/vendor/bundle/ruby/2.0.0/gems/thin-1.6.1/lib/thin/controllers/controller.rb:87:in start' [RAILS_ROOT]/vendor/bundle/ruby/2.0.0/gems/thin-1.6.1/lib/thin/runner.rb:200:inrun_command' [RAILS_ROOT]/vendor/bundle/ruby/2.0.0/gems/thin-1.6.1/lib/thin/runner.rb:156:in run!' [RAILS_ROOT]/vendor/bundle/ruby/2.0.0/gems/thin-1.6.1/bin/thin:6:in<top (required)>' [RAILS_ROOT]/vendor/bundle/ruby/2.0.0/bin/thin:23:in load' [RAILS_ROOT]/vendor/bundle/ruby/2.0.0/bin/thin:23:in<main>' ERROR: relation "groups" does not exist LINE 5: WHERE a.attrelid = '"groups"'::regclass ^ http://localhost:3021/ PG::Error

#4 楼 @zicjin 你是通过 bluepill 还是直接启动的 thin?

#5 楼 @cassiuschen RUBY_GC_MALLOC_LIMIT=90000000 RAILS_ROOT=/var/www/discourse RAILS_ENV=production NUM_WEBS=2 bluepill --no-privileged -c ~/.bluepill load /var/www/discourse/config/discourse.pill

#6 楼 @zicjin 你的 nginx 是不是不属于 www-data?

放弃这个问题了,,因为直接部署在 ubuntu 已经不是 discourse 官方支持的做法。乖乖用 docker.io 部署了

You need to Sign in before reply, if you don't have an account, please Sign up first.