Skip to content

Instantly share code, notes, and snippets.

@netguru
netguru / Failed to start searchd daemon.
Created November 2, 2010 15:24
Trouble with starting sphinx in rails application
user@host:~/app/current$ rake ts:start
(in /home/webhr/app/current)
Failed to start searchd daemon. Check /home/user/app/current/log/searchd.log.
user@host:~/app/current$ searchd --pidfile --config config/sphinx/production.conf
Sphinx 0.9.9-release (r2117)
Copyright (c) 2001-2009, Andrew Aksyonoff
using config file 'config/sphinx/production.conf'...
FATAL: failed to create pid file 'tmp/pids/searchd.production.pid': No such file or directory
class String
def truncate_full_words limit = 64, completion = "..."
self.length > limit ? "#{self[0..(self.rindex(' ', limit) || limit)-1]}#{competion}" : self
end
def truncate_full_words! limit = 64, completion = "..."
self.replace(self.truncate_full_words limit, completion)
end
end
class Liquid::Strainer
def is_haml?; false; end
def controller
@controller ||= @context.registers[:controller]
end
delegate :request, :to => :controller
delegate :params, :to => :request
end
<% link_to(@profile) do %>
<strong><%= @profile.name %></strong> -- <span>Check it out!!</span>
<% end %>
render :partial => ‘other_people’, :collection => @people, :as => :person
map.resource :posts, :collection => { :search => [:get, :post] }
map.session 'session', :requirements => { :method => [:get, :post, :delete] }
map.resources :products, :only => :show do |product|
product.resources :images, :except => :destroy
end
traceroute to berkeley.edu (169.229.131.81), 64 hops max, 40 byte packets
1 192.168.19.1 (192.168.19.1) 2.778 ms 1.954 ms 2.014 ms
2 poz-ru2.neo.tpnet.pl (213.25.2.40) 12.160 ms 12.524 ms 10.276 ms
3 z.poz-ru2.do.poz-r2.tpnet.pl (213.25.5.69) 10.667 ms 9.317 ms 10.238 ms
4 * ge-2-0-0.war-r4.tpnet.pl (194.204.175.226) 17.712 ms *
5 po8-0.nykcr2.NewYork.opentransit.net (193.251.251.69) 284.310 ms 258.067 ms 254.277 ms
6 po11-0.nykcr3.NewYork.opentransit.net (193.251.242.210) 124.150 ms 123.720 ms 125.864 ms
7 pos0-5-4-0.nyktr1.NewYork.opentransit.net (193.251.243.182) 130.984 ms 131.535 ms 130.944 ms
8 ge-2-0-0-0.ashtr1.Ashburn.opentransit.net (193.251.243.1) 177.752 ms 136.081 ms 136.095 ms
9 ge-0-1-0-0.atlcr3.Atlanta.opentransit.net (193.251.243.178) 143.268 ms so-0-2-0-0.atlcr3.Atlanta.opentransit.net (193.251.241.158) 142.348 ms 141.502 ms
extend ActiveSupport::Memoizable
def do_some_really_hardcore_calculations(massacrefactor = 1)
(2 + 2) * massacrefactor
end
memoize :do_some_really_hardcore_calculations
extend ActiveSupport::Memoizable
def do_some_hardcore_calculations
2 + 2
end
memoize :do_some_hardcore_calculations