Heroku、Thin 以及介于两者之间的一切

发布于 2024-12-23 01:00:09 字数 543 浏览 5 评论 0原文

查看日志,我的 cedar 应用程序当前运行 webrick。显然,这不是生产应用程序的最佳选择。

正如网上所指出的,我应该使用瘦网络服务器。

但我仍然想在我的开发机器(Windows)上使用 webrick 的简单性。

正如 Heroku cedar stack、thin 和 eventmachine 的评论中所述,该版本可以在windows上安装eventmachine(我还需要对该gem的一些解释)是1.0.0.beta4,而heroku不喜欢这样..

  1. 我如何仅安装thin(和我猜的eventmachine)在heroku上并保留webrick来满足我所有的本地主机需求?

  2. 什么是 eventmachine,为什么我需要它?

  3. 有没有办法明确告诉heroku忽略我想要的内容并使用thin?

Looking at the logs, my cedar app currently runs webrick. Obviously, this is not the best choice for production app.

As noted all over the web, I should use Thin webserver.

But I would still like to use the simplicty of webrick on my development machine (windows).

As noted in the comments on Heroku cedar stack, thin and eventmachine the version that can be installed on windows for eventmachine (I also need some explanation on that gem) is 1.0.0.beta4 and heroku doesn't like that..

  1. How do I install thin (and eventmachine I guess) only on heroku and keep webrick for all my localhost needs?

  2. What is eventmachine and why do I need it?

  3. Is there a way to explicitly tell heroku to ignore what I want and use thin?

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

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

发布评论

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

评论(2

原谅我要高飞 2024-12-30 01:00:09

在您的 Gemfile 中,创建或更改 product 组以包含 thin

group :production do
  gem 'thin'  
end

然后,在您的 Procfile一个名为 Procfile 的文件放置在应用程序的根目录中),告诉 Heroku 您想要使用 thin,像这样:

web: bundle exec thin start -p $PORT

这将允许你继续在本地开发环境中使用 Webrick,同时在 Heroku 上的生产中运行 thin

In your Gemfile, create or change the production group to include thin:

group :production do
  gem 'thin'  
end

Then, in your Procfile (a file named Procfile placed in the root of your app), tell Heroku you want to use thin, like so:

web: bundle exec thin start -p $PORT

That will allow you to keep using Webrick in your local development environment while running thin in production on Heroku.

好听的两个字的网名 2024-12-30 01:00:09

为了跳过在本地计算机上安装 thin gem,请像这样调用捆绑器:

bundle install --without production

In order to skip installation of thin gem on your local machine, call bundler like this:

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