Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/ruby-on-rails/58.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ruby on rails 将shotgun设置为使用其调试标志启动精简_Ruby On Rails_Debugging_Thin_Shotgun - Fatal编程技术网

Ruby on rails 将shotgun设置为使用其调试标志启动精简

Ruby on rails 将shotgun设置为使用其调试标志启动精简,ruby-on-rails,debugging,thin,shotgun,Ruby On Rails,Debugging,Thin,Shotgun,我试图让调试器gem与shotgun一起工作,为了使调试器能够工作,我需要瘦服务器以“调试打开”启动 如果我运行其中一个: shotgun -p 1378 -s thin -d -o 0.0.0.0 shotgun -p 1378 -s thin --debug -o 0.0.0.0 我从$DEBUG ruby变量设置为true开始,而不是在启用DEBUG标志的情况下启动精简服务器 如果我跑步: shotgun -pp 1378 -s "thin --debug" -o 0.0.0.0 我犯

我试图让调试器gem与shotgun一起工作,为了使调试器能够工作,我需要瘦服务器以“调试打开”启动

如果我运行其中一个:

shotgun -p 1378 -s thin -d -o 0.0.0.0
shotgun -p 1378 -s thin --debug -o 0.0.0.0
我从$DEBUG ruby变量设置为true开始,而不是在启用DEBUG标志的情况下启动精简服务器

如果我跑步:

shotgun -pp 1378 -s "thin --debug" -o 0.0.0.0
我犯了一个错误。当环境设置为“开发”时,是否有其他方法来运行此功能,或者告诉精简以调试器模式启动?

您的,而不是精简,这就是将
$DEBUG
设置为true的方法

Thin的命令行标志将打开,并显示此选项。您不能使用
thin
命令行选项(只要启动服务器的
shotgun
正在读取命令行),但可以使用一些普通的Ruby代码设置此变量。一种方法是使用需要精简并更改设置的:

require 'thin'
Thin::Logging.debug = true
(您可能希望将其放入
begin…rescue…block
中,并在Thin不可用的情况下拯救LoadError。)

没有此文件的输出:

$shotgun
==猎枪/薄开http://127.0.0.1:9393/
>>瘦web服务器(v1.4.1代码名Chromeo)
>>最大连接数设置为1024
>>收听127.0.0.1:9393,按CTRL+C停止
与文件一起:

$shotgun
==猎枪/薄开http://127.0.0.1:9393/
>>瘦web服务器(v1.4.1代码名Chromeo)
>>调试
>>最大连接数设置为1024
>>收听127.0.0.1:9393,按CTRL+C停止

据我所知,此设置只会影响Thin日志的详细程度,与此无关。

这已经过时,调试选项实际上是-D(是的,大写字母D),它就在源代码中。。但是对于单击延迟@MBHNYC定位准确-谢谢。我已经更新了答案,以澄清发生了什么,我认为其余的都没问题。从未使用过ruby,但一种允许您使用散弹枪的语言应该得到+1:)