This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ cap staging deploy |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# unicorn_rails -c config/unicorn.rb -E production -D | |
worker_processes 4 | |
user "synbioz", "users" | |
working_directory "/var/www/fake/current" | |
listen "/var/www/fake/shared/sockets/unicorn.sock", :backlog => 1024 | |
pid "/var/www/fake/shared/pids/unicorn.pid" | |
# nuke workers after 30 seconds instead of 60 seconds (the default) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
server { | |
listen 80; | |
server_name fake.server; | |
access_log /var/log/nginx/fake.access.log; | |
error_log /var/log/nginx/fake.error.log; | |
# direct to maintenance if this file exists | |
if (-f $document_root/system/maintenance.html) { | |
rewrite ^(.*)$ /system/maintenance.html last; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ cap staging maintenance:start |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
upstream fake { | |
server unix:/www/fake/shared/sockets/unicorn.sock; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
dyld: lazy symbol binding failed: Symbol not found: _mysql_get_client_info | |
Referenced from: /Users/fuse/Dropbox/code/ladw/vendor/bundle/ruby/1.9.1/gems/mysql2-0.3.11/lib/mysql2/mysql2.bundle | |
Expected in: flat namespace | |
dyld: Symbol not found: _mysql_get_client_info | |
Referenced from: /Users/fuse/Dropbox/code/ladw/vendor/bundle/ruby/1.9.1/gems/mysql2-0.3.11/lib/mysql2/mysql2.bundle | |
Expected in: flat namespace |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Last 10 log lines: | |
DLDFLAGS = -Wl,-undefined,dynamic_lookup -Wl,-multiply_defined,suppress -Wl,-flat_namespace | |
SOLIBS = | |
compiling main.c | |
In file included from /usr/include/string.h:190, | |
from ./include/ruby/ruby.h:48, | |
from ./include/ruby.h:32, | |
from main.c:13: | |
/usr/include/secure/_string.h: In function ‘__inline_stpncpy_chk’: | |
/usr/include/secure/_string.h:118: error: implicit declaration of function ‘__builtin___stpncpy_chk’ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
i = "foo" | |
for i in 1..5 do | |
puts i | |
j = "bar" | |
end | |
i # => 5 | |
j # => "bar" | |
i = "foo" | |
(1..5).each do |i| |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[1] pry(main)> str = "Candy bar" | |
=> "Candy bar" | |
[2] pry(main)> /(?<word>\w+)/ =~ str | |
=> 0 | |
[3] pry(main)> word | |
=> "Candy" | |
[4] pry(main)> str =~ /(?<w>\w+)/ | |
=> 0 | |
[5] pry(main)> w | |
NameError: undefined local variable or method `w' for main:Object |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'benchmark' | |
n = 5000000 | |
class A | |
def initialize(attribute) | |
@attribute = attribute | |
end |