what is the difference between unicorn and unicorn_rails?

偶尔善良 提交于 2019-12-03 23:23:09

问题


So...what is the difference between unicorn and unicorn_rails
When should I use one or another?


回答1:


It is officially answered in https://blog.engineyard.com/2010/everything-you-need-to-know-about-unicorn:

What is the unicorn executable? What is the unicorn_rails executable?

The unicorn executable is a Rack-only tool modeled after Rack’s “rackup” and is recommended for Rack applications. unicorn_rails was made to be an easier transition for users of pre-Rack versions of Rails. The manpage encourages Rails 3 users to use plain unicorn instead.

What’s the difference?

From the unicorn_rails manpage, some conventions of unicorn_rails are modeled after script/server found in Rails. It creates directories under “tmp” like script/server and the -E/–environment switch sets RAILS_ENV instead of RACK_ENV.

Apart from that, in my experience, some gems may need unicorn_rails in particular, like activeadmin (see this)

Also, manpage:

It is designed to help Rails 1.x and 2.y users transition to Rack, but it is NOT needed for Rails 3 applications. Rails 3 users are encouraged to use unicorn(1) instead of unicorn_rails(1). Users of Rails 1.x/2.y may also use unicorn(1) instead of unicorn_rails(1).



来源:https://stackoverflow.com/questions/12325923/what-is-the-difference-between-unicorn-and-unicorn-rails

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!