问题标签 [webrick]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票
3 回答
412 浏览

ruby-on-rails - 如何在 NetBeans for Ror 中查找 webrick 错误?

我从 Ruby on Rails 开始我的冒险,作为 IDE,我选择了 Netbeans。它捆绑了服务器 Webrick,并且运行良好。但是在我的第一个应用程序进行了一些更改后,它给了我内部错误 500 - 但控制台中没有显示任何内容。较旧的操作会产生相同的结果。

我怎样才能找到问题所在?我在 Ubuntu 系统上工作。

0 投票
5 回答
1434 浏览

php - 是否有类似于 webrick 或 mongrel 的实时 apache/php 控制台,带有 ruby​​ on rails?

是否有类似于 webrick 或 mongrel 的实时 apache/php 控制台,带有 ruby​​ on rails?

我希望能够监控我的服务器在做什么。

编辑:

但我不想grep日志

谢谢!

0 投票
2 回答
2186 浏览

ruby - 从 webrick 流式传输 html?

有没有人尝试过从 webrick 流式传输 html/文本/内容?我尝试将 IO 分配给响应正文,但 webrick 正在等待流首先关闭。

0 投票
2 回答
219 浏览

ruby-on-rails - 有时您可能需要重新启动 Webrick 才能看到您的更改,这是否正确?

我听 Kevin Skoglund (lynda.com) 说,在开发过程中养成经常重启 Webrick 的习惯是一种很好的做法。尽管通常您不需要重新启动 Webrick 即可查看您的更改,但他暗示在某些特定时间可能需要这样做?有谁知道这些情况可能是什么?这让人怀疑 Webrick 是否有点不稳定。

0 投票
2 回答
457 浏览

javascript - webrick服务器/ ie6在开发模式下截断javascript文件

我正在使用 webrick 在开发模式下运行我的 rails 应用程序。该页面包含 4-5 个 javascript 文件,这些文件也由同一个 webrick 实例提供服务。

当我在 ie6 上加载页面时,似乎 javascript 文件在前几行之后被截断 - 谁能解释一下?例如,如果页面包含此脚本标签:

当页面在 ie6 中加​​载时,它会引发 javascript 语法错误,并且 Visual Web Developer (VWD) 允许我打开加载的 jquery.js 文件,它只显示前 30 行,然后就停止了。

从运行 ie6 的同一台机器上,我尝试使用 curl 加载相同的 jquery.js 文件:

因此,通过 curl 访问页面时,我没有从服务器返回任何内容。与 wget 相同。

但是,如果我加载页面,甚至是 firefox 或 chrome 中的单个 javascript 文件,它加载完整的东西就好了。所以 webrick 和 ie6 之间存在一些奇怪的交互,与 curl/wget 相同。我尝试的另一项测试:

这有效,返回了完整的文件内容。我不知道为什么它不能在 ie6/curl/wget 中加载。有什么建议么?

0 投票
1 回答
1007 浏览

ruby - 拒绝非本地主机尝试访问 Webrick

我正在尝试阻止所有非本地主机尝试访问 Webrick 进程。这是我当前的代码

这容易破解吗?我的想法是主机名很难欺骗网络服务器本身。

0 投票
12 回答
24008 浏览

ruby-on-rails - Webrick 的响应速度很慢。如何加快速度?

我有一个在我的服务器上运行的 Rails 应用程序。当我转到远程桌面并尝试加载应用程序时,服务器需要 3-4 分钟才能响应一个简单的 HTML 页面。但是,当我在服务器上本地加载页面时,页面会在一秒钟内显示出来。我尝试从远程桌面 ping 服务器,并且 ping 在合理的时间内成功完成。

这一切似乎都是在我安装了 Oracle 的基本客户端和 SQLPLUS 之后开始的。我应该怀疑甲骨文吗?有没有人经历过类似的事情?

0 投票
1 回答
2027 浏览

ruby - Ruby Webrick HTTP 身份验证

如何使用这样的子类在此页面中执行相同的身份验证内容:

0 投票
1 回答
984 浏览

ruby - Ruby code on NFS mount, using another file on same mount causes problems

I'm working on an embedded system whoose details are explained at the end of this post. Tools are ruby on linux.

I put my ruby code on a remote NAS device on network and mount it to the embedded system I'm working on using NFS v3. My project scenario is like this: there is an all-in-one auto starter which 1.mounts the nfs share, 2. starts the webrick ruby code on mounted dir, 3. starts some other biz-logic related ruby code again on mounted dir, 4. starts a ruby code on local file system which does some basic logging and stuff... I put each step in a loop that will retry when a start operation fails (start operations are made by system 'ruby XXXX' or popen3 calls). Here's what happens when I run this starter: step1 goes ok, step 2 fails, step 3 fails, step 4 goes ok, then step2 and 3 are retried and both starts ok too allways at second trial(I want to add that started codes are independent so; it doesnt matter which one starts first and changing the start order didnt make any difference).

I have inspected this problem and found out it also happens when I start things manually from shell and filtered it down to this: My webrick code loads .rb files that are at the same directory as itself and has some FileHandlers using the subdirs in NFS mount and my biz-logic also loads .rb files from nfs mount. And this, I believe, is the source of my problem (I have tried to load those files using both absolute paths like '/mnt/myMount/myLib.rb' and File.Join which both didnt make any difference).

Also, the webrick filehandlers too act pretty strange in this scenario, they always fail at first request of a file and then succeeds at the second request, no matter the file size.

To sum up, as the title says, when a Ruby code on NFS mount uses another file on same mount, ruby gives an EIO (Input Output Error). I was able to reproduce this problem using simple .rb files (that just print itselves filename) loading each other as explained in the above scenario on my environment (though I havent tried this on a regular PC). How can I solve this, is it about the paths given to load/require methods or what?

My working envrionment: The device I'm working with is an intelligent RFID reader, with an embedded linux arm based computer on-board. The only api/language manufacturer allows and provides (w/o getting out of license terms) is ruby, and they give no-support for installing extra-stuff and they have customized the kernel in device to make installing/compiling anything as hard as possible. I can use extra ruby stuff if they're just .rb lib files that is I can easily just include them in my code, but anything that requires compiling is a no-no. Also, this system does not have gem.

0 投票
8 回答
64098 浏览

ruby-on-rails - 为什么 Ruby on Rails 使用 http://0.0.0.0:3000 而不是 http://localhost:3000?

我对Ruby on Rails非常陌生,所以当我尝试遵循官方的“入门”ruby on rails 教程时,我有点失望,因为它很快就出错了。基本上它说:

…导航到 http://localhost:3000。您应该看到 Rails 的默认信息页面。

但是当我按照说明进行操作时,我得到了

在尝试了这两个地址之后,我知道它们指向同一个东西,但是有人可以向我解释为什么 Ruby on Rails 使用http://0.0.0.0:3000而不是http://localhost:3000

有没有办法让 WEBrick 服务器始终使用 localhost?