Skip to content

Instantly share code, notes, and snippets.

View bjones's full-sized avatar

Brian Jones bjones

  • SAS
  • Raleigh, NC
View GitHub Profile
@bjones
bjones / gist:f2411b9b94ac5ff4483a
Created June 4, 2014 14:07
Vagrant error Too many open files - getcwd (Errno::EMFILE)
$ vagrant reload
==> redis2: Clearing any previously set forwarded ports...
==> redis2: Clearing any previously set network interfaces...
==> redis2: Preparing network interfaces based on configuration...
redis2: Adapter 1: nat
redis2: Adapter 2: hostonly
==> redis2: Forwarding ports...
redis2: 22 => 2222 (adapter 1)
==> redis2: Booting VM...
==> redis2: Waiting for machine to boot. This may take a few minutes...
# Package Maintainer: Increment phusion_release to match latest release available
%define phusion_release 2011.03
Summary: Ruby Enterprise Edition (Release %{phusion_release})
Name: ruby-enterprise
Vendor: Phusion.nl <info@phusion.nl>
Packager: Adam Vollrath <hosting@endpoint.com>
Version: 1.8.7
Release: 8%{dist}
License: Ruby or GPL v2
@bjones
bjones / routes.rb
Created December 13, 2010 16:21
attempt to tame the beast
Search::Application.routes.draw do
# GET /search.:format
resources :search, :only => [:index]
# GET /locations.:format
resources :locations, :only => [:index]
# GET /post.:format
resources :post, :module => 'admin', :only => [:index]
class ApplicationController &lt; ActionController::Base
rescue_from ActionController::RoutingError, :with => :route_not_found
rescue_from ActionController::UnknownAction, :with => :unknown_action
rescue_from ActionController::MethodNotAllowed, :with => :method_not_allowed
if (defined? ActiveRecord)
rescue_from ActiveRecord::RecordNotFound, :with => :record_not_found
end
def route_not_found(exception)
handle_error('no route', :status => :not_found)