unicorn

Can't start unicorn, master failed to start, check stderr log for details

不问归期 提交于 2019-12-04 01:11:59
I dont know what’s wrong with the unicorn.rb file. my unicorn.rb config is APP_PATH = "/var/www/demo" working_directory APP_PATH stderr_path APP_PATH + "/log/unicorn.stderr.log" stdout_path APP_PATH + "/log/unicorn.stderr.log" pid APP_PATH + "/tmp/pid/unicorn.pid" running nginx successful. sudo servier nginx start sudo unicorn -c /var/www/demo/config/unicorn.rb -D The socket is the "file" that nginx and unicorn use as a channel for all communication between them. Where have you defined it? In our unicorn configs, we usually have a line like this: listen APP_PATH + "/tmp/pid/.unicorn.sock Then,

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

Start unicorn on OSX Startup

∥☆過路亽.° 提交于 2019-12-03 21:24:29
i'm currently using rvm and unicorn for server management under osx lion. i also use a gemset. so for starting my server i do following: cd /xyz/project unicorn -c /xyz/project/config/unicorn.rb -E production now i want this server starting when my computer starts up. i read something about adding a plist file to ~/Library/LaunchAgents/ and activating it with launchctl but i have no idea what to write inside this plist file for starting my server. any ideas? also i think it's difficult, because the gemset needs to get activated by cd'ing into this dir. thanks for all help. You probably want to

Unicorn triggers mongoid error during assets precompile

☆樱花仙子☆ 提交于 2019-12-03 18:01:39
问题 I have a rails app using Mongoid 3 running on Heroku. I've just updated it to use Unicorn. When I try to deploy it to Heroku I get the following error : Running: rake assets:precompile rake aborted! undefined method `match' for nil:NilClass /tmp/build_3nnbzpfmnjpns/vendor/bundle/ruby/1.9.1/gems/mongoid-3.0.21/lib/mongoid/sessions/mongo_uri.rb:49:in `initialize' The full stacktrace can be found at http://pastebin.com/8YcJHEmS But if I remove Unicorn from my Gemfile, the assets compilation

I am getting this gem install error for kgio gem when i do a bundle install

南笙酒味 提交于 2019-12-03 16:44:06
I added unicorn to my Gemfile and after that when i do a bundle install I get this error em::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension. /Users/adim86/.rvm/rubies/ruby-1.9.3-p0/bin/ruby extconf.rb checking for CLOCK_MONOTONIC in time.h... *** extconf.rb failed *** Could not create Makefile due to some reason, probably lack of necessary libraries and/or headers. Check the mkmf.log file for more details. You may need configuration options. Provided configuration options: --with-opt-dir --with-opt-include --without-opt-include=${opt-dir}/include --with-opt-lib -

Unicorn/Nginx process missing, socket open

我只是一个虾纸丫 提交于 2019-12-03 15:53:25
I am trying to deploy code using Capistrano, and it fails on deploy:start or deploy:stop because the Unicorn process is already killed. However if I try to cap deploy:start , I get a stderr claiming that Address already in use - /tmp/my_app.socket . How would this happen, and how might I get out of this mess? Still not sure how this happens, but the following solution seems to work: lsof /tmp/my_app.socket - lists the pids kill -9 pid - (replace 'pid' with one of those listed) Then cap deploy:start from the local terminal. 来源: https://stackoverflow.com/questions/10150245/unicorn-nginx-process

Unicorn + Rails + Large Uploads

家住魔仙堡 提交于 2019-12-03 12:38:00
I'm trying to allow for large uploads when running Unicorn on Heroku with Rails but I've realised that any large uploads might take longer than the timeout period for a Unicorn worker. This will mean (I've seen this happen) that the Unicorn master process will kill the worker uploading the large file and the request will timeout (with a 503 error). Without removing or massively increasing the timeout for my server is there any way to allow the uploading worker to hang while the upload completes? Or, am I completely misunderstanding and its most likely something else that is causing my uploads

How can I tell unicorn to understand Heroku's signals?

雨燕双飞 提交于 2019-12-03 12:27:11
Perhaps you've seen this... 2012-03-07T15:36:25+00:00 heroku[web.1]: Stopping process with SIGTERM 2012-03-07T15:36:36+00:00 heroku[web.1]: Stopping process with SIGKILL 2012-03-07T15:36:36+00:00 heroku[web.1]: Error R12 (Exit timeout) -> Process failed to exit within 10 seconds of SIGTERM 2012-03-07T15:36:38+00:00 heroku[web.1]: Process exited with status 137 This is a well known problem when running unicorn on heroku ... heroku uses SIGTERM for graceful shutdown unicorn uses SIGTERM for quick shutdown Can I tell heroku to send SIGQUIT ? Or can I tell unicorn to treat SIGTERM as graceful

Unicorn restart/upgrade doesn't work

放肆的年华 提交于 2019-12-03 12:21:53
问题 Following is link to my init script for unicorn. https://gist.github.com/1466775 Restart command has never worked for me. I am using upgrade to restart unicorn after each deploy. But whenever there is major changes like new gems being added, upgrade won't work. Recently, i replaced hoptoad gem with airbrake and it errors out saying 'uninitialized constant Airbrake (NameError)'. But when i stopped and started unicorn again, it worked fine. Does the problem lies in init script or its different

Rails, Mongoid & Unicorn config for Heroku

落爺英雄遲暮 提交于 2019-12-03 09:24:54
I am using Mongoid 3, with Rails 3.2.9 and Unicorn for production. Would like to setup a before_fork & after_fork for the connection to mongodb, found the following code for active record: before_fork do |server, worker| # Replace with MongoDB or whatever if defined?(ActiveRecord::Base) ActiveRecord::Base.connection.disconnect! Rails.logger.info('Disconnected from ActiveRecord') end end after_fork do |server, worker| # Replace with MongoDB or whatever if defined?(ActiveRecord::Base) ActiveRecord::Base.establish_connection Rails.logger.info('Connected to ActiveRecord') end end What is the