机架应用程序与导轨应用程序之间有什么区别? [英] What's the difference between rack app vs. rails app?

查看:32
本文介绍了机架应用程序与导轨应用程序之间有什么区别?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我将我的 rails 2.3.8 应用程序上传到 DreamHost 并收到关于机架版本不兼容的错误.我发出了支持票,服务人员建议我删除 config.ru.

I uploaded my rails 2.3.8 app to DreamHost and got an error about rack version incompatibility. I issued a support ticket and the service guy recommended that I delete config.ru.

这就解决了问题.但我想知道这会产生什么影响.

That solved the problem. But I wonder what that would affect.

Rails 应用没有 config.ru 可以吗?

Is it ok that a rails app goes without config.ru?

推荐答案

Rack 应用程序是用 Ruby 编写的 Web 应用程序,它使用 机架 项目.一个非常简单的 Hello World config.ru 示例如下:

A Rack app is a web app written in Ruby that uses the Rack project. A really simple Hello World config.ru example is like so:

class HelloWorld
  def call(env)
    [200, {'Content-Type' => 'text/plain'}, ['Hello World!']]
  end
end

run HelloWorld.new

Rails 2.3+ 使用 Rack 作为其 HTTP 处理的基础,但一些托管服务提供商可能会专门处理 Rails,并且可能不支持将 Rails 作为 Rack 应用程序运行.DreamHost for Rails 2.3.8 似乎就是这种情况,至少您已经指定了 gem 要求.

Rails 2.3+ uses Rack as the basis for its HTTP handling, but some hosting providers might handle Rails specially and may not support running Rails as a Rack app. That seems to be the case with DreamHost for Rails 2.3.8, at least as you've specified your gem requirements.

这篇关于机架应用程序与导轨应用程序之间有什么区别?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆