我正在使用Padrino ruby框架制作后端api。 而且我想知道如何在生产模式下运行项目。 现在,我使用此命令运行服务器。
padrino s
它正在开发模式下运行。 我尝试了这个。
padrino s RACK_ENV='production'
但是会造成错误。 谢谢。
在padrino中指定环境的标志是-e
。 因此,命令将是:
padrino start -e production
要么
RACK_ENV=production padrino s
请注意你的情况如何RACK_ENV='production'
大约有引号'production'
。 您应该删除它们并尝试。
从padrino文档中 ,其他可能的组合是:
# starts the app server (non-daemonized)
$ padrino start
# starts the app server (daemonized) with given port, environment and adapter
$ padrino start -d -p 3000 -e development -a thin
# Stops a daemonized app server
$ padrino stop
# Bootup the Padrino console (irb)
$ padrino console
# Run/List tasks
$ padrino rake
# Run piece of code in the context of Padrino (with given environment)
$ padrino runner 'puts Padrino.env' -e development
# Run Ruby file in the context of Padrino
$ padrino r script/my_script.rb