簡體   English   中英

rack 應用程序與 rails 應用程序有什么區別?

[英]What's the difference between rack app vs. rails app?

我將我的 rails 2.3.8 應用程序上傳到 DreamHost 並收到有關機架版本不兼容的錯誤。 我發出了支持票,服務人員建議我刪除 config.ru。

這解決了問題。 但我想知道這會產生什么影響。

Rails 應用程序沒有 config.ru 可以嗎?

Rack 應用程序是 web 應用程序,使用Rack項目在 Ruby 中編寫。 一個非常簡單的 Hello World config.ru示例如下所示:

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 要求時。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM