Comments (3)
@masterkain im not sure where is this supposed to go
from capistrano-unicorn.
-N
is a special option that can go as the last parameter, if set, during unicorn/rainbows startup: it tells to not load any default middleware in the stack. It can be used to manually load Rack::ContentLength and Rack::Chunked instead of relying on the correct -E option.
The -E option corresponds to RACK_ENV, but the effective values are 'deployment', 'none' and 'development'.
# RACK ENVIRONMENT
Accepted values of RACK_ENV and the middleware they automatically load
(outside of RACKUP_FILE) are exactly as those in rackup(1):
* development - loads Rack::CommonLogger, Rack::ShowExceptions, and
Rack::Lint middleware
* deployment - loads Rack::CommonLogger middleware
* none - loads no middleware at all, relying
entirely on RACKUP_FILE
All unrecognized values for RACK_ENV are assumed to be
"none". Production deployments are strongly encouraged to use
"deployment" or "none" for maximum performance.
Note the Rack::ContentLength and Rack::Chunked middlewares are also
loaded by "deployment" and "development", but no other values of
RACK_ENV. If needed, they must be individually specified in the
RACKUP_FILE, some frameworks do not require them.
-N, \--no-default-middleware
: Disables loading middleware implied by RACK_ENV. This bypasses the
configuration documented in the RACK ENVIRONMENT section, but still
allows RACK_ENV to be used for application/framework-specific purposes.
So in production if someone wants the two content middleware loaded, it has to specify an app_env as 'deployment', but this will also tell rails that the environment is 'deployment', while it is really production, staging, etc.
AFAIK the -N switch eliminates default middlewares without interfering with RACK_ENV.
from capistrano-unicorn.
@masterkain is right. This issue is essentially a very well disguised duplicate of #46. I have just been looking into #46, and independently found that capistrano-unicorn
incorrectly assumes that values like staging
and production
are valid choices for the app_env
variable, since it defaults app_env
to whatever rails_env
is. This is totally wrong, and will result in Rack::CommonLogger
not ever being loaded for Rails staging and production environment (unless the user happens to realise this and manually set app_env
to deployment
).
I will produce a pull request to fix this mess. :) It will rename app_env
to rack_env
for maximum clarity, and bump the version to 0.2.0. It will also choose a sensible default according to rails_env
, based on the recommendations from the unicorn docs quoted above.
from capistrano-unicorn.
Related Issues (20)
- mixed env of passenger servers and unicorn server fails to run `unicorn:reload' is only run for servers matching {:roles=>:unicorn, :except=>{:no_release=>true}}, but no servers matched HOT 3
- sudo: bundle: command not found, Compatible with RVM? HOT 2
- License missing from gemspec HOT 4
- Remind the developer to use absolute path if Unicorn sockets is been used.
- Detecting failed restart HOT 1
- Disable set -x debugging option HOT 1
- Cannot figure out multistage environment, unicorn_rails and -E flag
- Easy Questions
- README and NEWS files seem to be ahead of actual release HOT 1
- Not compatible with capistrano 3 HOT 1
- capistrano-unicorn with capistrano 3.x HOT 17
- problem while deploying with capistrano-unicorn HOT 6
- config.eager_load is set to nil HOT 7
- v0.2.0 failed to restart unicon due to incorrect pid file path HOT 15
- assets:precomplie bug in v0.1.10 - Namespaces#to_s HOT 1
- avoiding duplicate unicorns starting with Upstart / Init
- --- HOT 2
- Must Restart twice to see the latest codes deployed
- NoMethodError: undefined method `instance' for Capistrano::Configuration:Class HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from capistrano-unicorn.