设置 RubyMine2 来运行和调试 Sinatra 应用程序

发布于 2024-10-02 22:10:31 字数 47 浏览 0 评论 0原文

谁能提供在 Rubymine 中运行和调试 sinatra 应用程序的设置说明?

Can anyone provide setup instructions for running and debugging a sinatra app in Rubymine?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

倥絔 2024-10-09 22:10:31

不确定您是否在 JetBrains 论坛上找到了答案,但如果没有,以下是 RubyMine 3.2.4 中对我有用的方法。

我的 config.ru 看起来像:

require './app'
run Sinatra::Application

在一个简单的 app.rb 文件中,在下面的“Hello World”行上放置一个断点:

get '/' do
  "Hello World"
end

只需右键单击 app.rb 或 config.ru 文件,然后选择“调试“app” ' 从上下文菜单中。加载页面时应该遇到断点。

希望这有帮助。

Not sure if you found your answer on the JetBrains forum, but if not, here's what works for me in RubyMine 3.2.4.

My config.ru looks like:

require './app'
run Sinatra::Application

In a simple app.rb file, put a break point on the "Hello World" line below:

get '/' do
  "Hello World"
end

Just right-click on the app.rb or config.ru file, and select 'Debug "app"' from the context menu. You should hit your break point when you load the page.

Hope this helps.

纵山崖 2024-10-09 22:10:31

使用当前的 RubyMine (5.4),您可以通过创建 Rack Run/Debug 配置并在其中指定 config.rb 文件的路径来运行它。

With the current RubyMine (5.4) you can run it by creating a Rack Run/Debug configuration and specifying path to your config.rb file in there.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文