【问题标题】:How to start redmine with a specific port from bash script?如何使用 bash 脚本中的特定端口启动 redmine?
【发布时间】:2023-03-08 07:08:01
【问题描述】:

在我的电脑上,我可以通过以下方式启动 redmine:

cd /usr/share/redmine
bundle exec rails server webrick -e production -p 3001

这将在 3001 端口启动 redmine。 如果我创建一个 bash 脚本,它总是从端口 3000 开始,就像参数被忽略一样。
我究竟做错了什么 ?

这就是我所拥有的

#!/bin/bash

#exec /usr/lib/x86_64-linux-gnu/opera/opera --no-sandbox $@
cd /usr/share/redmine

# Port from settings file will be ignored either way ... 

#bundle exec rails -p 3003 server webrick -e production
bundle exec rails server webrick -e production -p 3001

【问题讨论】:

    标签: ruby-on-rails bash shell redmine webrick


    【解决方案1】:

    快速检查并发现您的脚本对我来说非常好,更改脚本中的端口也会更改 WEBrick 正在侦听的端口。

    所以脚本没有问题。

    【讨论】:

    • 如何将它“作为脚本”运行?脚本是否可执行(chmod 755)?
    猜你喜欢
    • 2013-11-23
    • 1970-01-01
    • 2015-03-26
    • 2015-03-02
    • 2015-08-15
    • 1970-01-01
    • 2011-07-23
    • 2016-08-11
    • 1970-01-01
    相关资源
    最近更新 更多