在生产环境中通过浏览器连接到应用程序地址

时间:2018-10-25 04:47:24

标签: ruby-on-rails ruby

启动Rails项目时,我无法通过浏览器(This site can’t be reached 0.0.0.0 refused to connect。)连接到应用程序地址,在开发环境中,一切正常。

> rails server -P /tmp/puma -e production
> => Booting Puma
> => Rails 5.0.6 application starting in production on http://0.0.0.0:3000
> => Run `rails server -h` for more startup options [DEPRECATION] requiring "RMagick" is deprecated. Use "rmagick" instead Puma starting
> in single mode...
> * Version 3.6.2 (ruby 2.3.3-p222), codename: Sleepy Sunday Serenity
> * Min threads: 5, max threads: 5
> * Environment: production
> * Listening on tcp://0.0.0.0:3000 Use Ctrl-C to stop

我的database.yml:

  adapter: postgresql
  encoding: unicode
  pool: <%= ENV.fetch("RAILS_MAX_THREADS") { 5 } %>

production:
  adapter: postgresql
  encoding: unicode
  host:     localhost
  database: magnetcoin_production
  pool:     10
  timeout:  10000
  username: magnetcoin
  password: magnetcoin
  template: template0


development:
  <<: *default
  database: magnetcoin_development

test:
  <<: *default
  data

基础:magnetcoin_test

0 个答案:

没有答案