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

前端 未结 2 2095
离开以前
离开以前 2021-02-20 05:24

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

相关标签:
2条回答
  • 2021-02-20 06:00

    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+ 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.

    0 讨论(0)
  • 2021-02-20 06:15

    you should check those two RailsCasts:

    • http://railscasts.com/episodes/151-rack-middleware
    • http://railscasts.com/episodes/150-rails-metal

    • and perhaps: http://railscasts.com/episodes/222-rack-in-rails-3

    0 讨论(0)
提交回复
热议问题