unicorn

On Heroku, Cedar, with Unicorn: Getting ActiveRecord::StatementInvalid: PGError: SSL SYSCALL error: EOF detected

家住魔仙堡 提交于 2019-11-29 03:59:21
Heroku support says this has to do with their version of libssl on shared databases, but we've encountered it on a project that's on a dedicated database, too. Basically this error happens every so often (closer to just after a deploy) on every project we've moved to the new Cedar stack with Unicorn configured to 3 workers: Error Message: ActiveRecord::StatementInvalid: PGError: SSL SYSCALL error: EOF detected : SELECT a.attname, format_type(a.atttypid, a.atttypmod), d.adsrc, a.attnotnull FROM pg_attribute a LEFT JOIN pg_attrdef d ON a.attrelid = d.adrelid AND a.attnum = d.adnum WHERE a.at

how to restart unicorn manually

跟風遠走 提交于 2019-11-29 02:26:36
问题 I'm not confident that unicorn is restarting properly when I run cap deploy as certain changes are not showing in the app, therefore I wanted to restart unicorn manually on my remote server. I have navigated into etc/init.d and see a listing for unicorn_myapp but it's not a directory (i.e. I can't cd into it). Based on the code below from my deploy.rb file, is there something I can do from here to restart unicorn? I tried to do run unicorn_myapp restart but it said run isn't a command

How can I use unicorn as “rails s”?

房东的猫 提交于 2019-11-28 18:32:33
A new Rails project's Gemfile shows: # Use unicorn as the app server gem 'unicorn' rails s --help shows: Usage: rails server [mongrel, thin, etc] [options] Yet, doing: rails s unicorn I get: /Users/patrick/.rvm/gems/ruby-1.9.3-head@keynote/gems/rack-1.4.5/lib/rack/handler.rb:63:in `require': cannot load such file -- rack/handler/unicorn (LoadError) from /Users/patrick/.rvm/gems/ruby-1.9.3-head@keynote/gems/rack-1.4.5/lib/rack/handler.rb:63:in `try_require' from /Users/patrick/.rvm/gems/ruby-1.9.3-head@keynote/gems/rack-1.4.5/lib/rack/handler.rb:16:in `get' from /Users/patrick/.rvm/gems/ruby-1

Restart Unicorn issue (capistrano)

对着背影说爱祢 提交于 2019-11-28 18:03:43
I've got following settings in deploy.rb to restart my server: namespace :deploy do task :restart do run "if [ -f #{unicorn_pid} ] && [ -e /proc/$(cat #{unicorn_pid}) ]; then kill -USR2 \`cat #{unicorn_pid}\`; else cd #{deploy_to}/current && bundle exec unicorn -c #{unicorn_conf} - E #{rails_env} -D; fi" end end but it doesn't work. I mean that command executes (it asks me the password and gives no errors), but all changes in config files are still ignored (i.e. number of worker processes or database settings). Maybe this is because of the way unicorn restarts. Not every worker is restarted

bundler incorrectly trying to install “development” and “test” group gems in production

允我心安 提交于 2019-11-28 17:13:33
问题 I have a small web app, which uses a bunch of gems. Some of them are only used for test and development environments. Now, when I try to start unicorn on the production server using the following command, it fails. unicorn_rails -E production -D -c config/unicorn.rb The error I see in the log files is: Refreshing Gem list Could not find gem 'spork (>= 0.9.0.rc2, runtime)' in any of the gem sources listed in your Gemfile. Try running `bundle install`. I've pasted my gemfile below: source 'http

Nginx cannot find unix socket file with Unicorn (no such file or directory)

风流意气都作罢 提交于 2019-11-28 16:31:03
I am deploying a Rails 4 app to a Fedora 19 x64 server using Nginx and Unicorn. The problem is that I get an error when visiting the address: "We're sorry, but something went wrong." My Nginx error log ( /var/log/nginx/error.log ) shows: 2014/03/08 03:50:12 [warn] 23934#0: conflicting server name "localhost" on 0.0.0.0:80, ignored 2014/03/08 03:50:12 [warn] 23936#0: conflicting server name "localhost" on 0.0.0.0:80, ignored 2014/03/08 03:50:14 [crit] 23939#0: *1 connect() to unix:/tmp/unicorn.[app name].sock failed (2: No such file or directory) while connecting to upstream, client: [client IP

How to preserve request url with nginx proxy_pass

社会主义新天地 提交于 2019-11-28 15:30:50
I was trying to use Thin app server and had one issue. When nginx proxies the request to Thin (or Unicorn) using proxy_pass http://my_app_upstream; the application receives the modified URL sent by nginx ( http://my_app_upstream ). What I want is to pass the original URL and the original request from client with no modification as the app relies heavily on it. The nginx' doc says: If it is necessary to transmit URI in the unprocessed form then directive proxy_pass should be used without URI part. But I don't understand how exactly to configure that as the related sample is actually using URI:

Why does Unicorn need to be deployed together with Nginx?

你。 提交于 2019-11-28 13:13:41
问题 I would like to know the difference between Nginx and Unicorn. As far as I understand, Nginx is a web server while Unicorn is a Ruby HTTP server. Since both Nginx and Unicorn can handle HTTP requests, what is the need to use the combination of Nginx and Unicorn for RoR applications? 回答1: Nginx Unicorn Refer to unicorn on github for more information. 回答2: Nginx is a pure web server that's intended for serving up static content and/or redirecting the request to another socket to handle the

Re-source .bashrc when restarting unicorn?

荒凉一梦 提交于 2019-11-28 06:25:36
问题 I have some ENV variables that are sourced for the deploy user. (Similar to what Heroku recommends, but without using Heroku.) My rails app depends on these for certain functions, for example, in application.rb: config.action_mailer.default_url_options = { host: ENV['MY_HOST'] } This is necessary because we have several staging hosts. Each host has MY_HOST defined to its correct hostname in .bashrc like so: export MY_HOST="staging3.example.com" This allows us to only use one rails staging

Thin vs Unicorn on Heroku

萝らか妹 提交于 2019-11-28 05:17:40
Just wanted to get people's opinions on using Unicorn vs Thin as a rails server. Most of the articles/benchmarks I found online seem very incomplete, so it would nice to have a centralized place to discuss it. Unicron is a multi-processes server, while thin is an event based/non-blocking server. Event-based servers are great... if your code is asynchronous/non-blocking - vanilla rails is blocking. So unless you use non-blocking rails libraries, I really don't see the advantage of using Thin. Even worse, in a non-blocking server, if your i/o loop is blocking you're going to block the entire