【问题标题】:Will ruby on rails project start automatically when thin startruby on rails 项目会在精简启动时自动启动吗
【发布时间】:2014-08-04 08:04:03
【问题描述】:

作为问题状态。

我正在尝试在机器重启时启动 ruby​​ on rails。

我觉得我已经成功地自动开始瘦了。

但我的 ROR 页面仍然无法正常工作。

ie:当我打开 localhost:3000 时,这个页面无法显示。

精简启动时ror项目会自动启动吗? 如果没有,我需要做什么设置?

我用的是ubuntu,ror项目在/home/usr/test下

【问题讨论】:

  • 你必须在/home/usr/test目录下启动瘦服务器。
  • @SachinSingh 我不能那样做。我只能开始使用'rails s',当我开始瘦时使用'thin start',它给了我很多错误信息,首先是“你已经激活机架 1.5.2,但您的 Gemfile 需要机架 1.4.5。使用 bundle exec 可以解决这个问题。(Gem::LoadError)" 然后跟随许多位置
  • 尝试通过命令bundle exec thin start瘦身。
  • @SachinSingh 它有效!非常感谢

标签: ruby-on-rails thin


【解决方案1】:

您需要告诉 Thin 您希望与 Thin 一起自动运行的应用程序。

sudo thin config -C /etc/thin/testapp.yml -c /home/usr/test  --servers 3 -e production

您可以交叉检查设置:

cat /etc/thin/testapp.yml

它应该显示如下内容:

--- 
pid: tmp/pids/thin.pid
address: 0.0.0.0
timeout: 30
port: 3000
log: log/thin.log
max_conns: 1024
require: []

environment: production
max_persistent_conns: 512
servers: 3
daemonize: true
chdir: /home/demo/public_html/testapp

来源:Rackspace 的Knowledge Center

【讨论】:

    【解决方案2】:

    试试这个:

    您必须在目录/home/usr/test 中启动瘦服务器。

    尝试通过命令bundle exec thin start 运行瘦身。

    【讨论】:

    • 谢谢,但我的问题是如何设置薄以使其启动 ror
    猜你喜欢
    • 2017-09-02
    • 1970-01-01
    • 1970-01-01
    • 2017-01-23
    • 2015-10-21
    • 1970-01-01
    • 1970-01-01
    • 2016-04-28
    • 1970-01-01
    相关资源
    最近更新 更多