Skip to content

Instantly share code, notes, and snippets.

View hone's full-sized avatar

Terence Lee hone

View GitHub Profile
@hone
hone / gist:1228009
Created September 20, 2011 00:36
Bundle Install Flow Path
bundle install
CLI#install
Bundler.root
SharedHelpers#default_gemfile
Bundler.definition
Bundler.default_gemfile
Bundler.default_lockfile
Definition.build
DSL.evaluate
Definition.new
@hone
hone / database.yml.erb
Created September 9, 2011 19:44
heroku cedar erb database.yml
<%
require 'cgi'
require 'uri'
begin
uri = URI.parse(ENV["DATABASE_URL"])
rescue URI::InvalidURIError
raise "Invalid DATABASE_URL"
end
Rails31App::Application.configure do
# Settings specified here will take precedence over those in config/application.rb
# Code is not reloaded between requests
config.cache_classes = true
# Full error reports are disabled and caching is turned on
config.consider_all_requests_local = false
config.action_controller.perform_caching = true
source 'http://rubygems.org'
gem 'rails', :git => 'git://github.com/rails/rails.git', :ref => '346cd04704c78a2b0c2b676dcb41f87e0ea6ea2a'
group :assets do
gem 'coffee-rails', '~> 3.1.0.rc'
end
class RegenerateRuntimeDependenciesList < ActiveRecord::Migration
def self.up
Dependency.find_each(:batch_size => 5000) do |dep|
$redis.del(Dependency.runtime_key(dep.version.full_name)) if dep.version
dep.save
end
end
def self.down
end
@hone
hone / newrelic.yml
Created June 1, 2011 19:15
New Relic config for Cedar
---
<%= ENV["RAILS_ENV"] %>:
error_collector:
capture_source: true
enabled: true
ignore_errors: ActionController::RoutingError
apdex_t: 0.5
ssl: false
monitor_mode: true
license_key: <%= ENV["NEW_RELIC_LICENSE_KEY"] %>
/home/hone/Projects/heroku_work/bundler/lib/bundler/lazy_specification.rb:66:in `method_missing': undefined method `fetch_platform' for rake (0.8.7):Bundler::LazySpecification (NoMethodError)
from /home/hone/Projects/heroku_work/bundler/lib/bundler/source.rb:237:in `download_gem_from_uri'
from /home/hone/Projects/heroku_work/bundler/lib/bundler/source.rb:76:in `fetch'
from /home/hone/Projects/heroku_work/bundler/lib/bundler/installer.rb:55:in `block in run'
from /home/hone/Projects/heroku_work/bundler/lib/bundler/spec_set.rb:12:in `block in each'
from /home/hone/Projects/heroku_work/bundler/lib/bundler/spec_set.rb:12:in `each'
from /home/hone/Projects/heroku_work/bundler/lib/bundler/spec_set.rb:12:in `each'
from /home/hone/Projects/heroku_work/bundler/lib/bundler/installer.rb:54:in `run'
from /home/hone/Projects/heroku_work/bundler/lib/bundler/installer.rb:12:in `install'
from /home/hone/Projects/heroku_work/bundler/lib/bundler/cli.rb:211
@hone
hone / things.rb
Created April 21, 2011 23:11 — forked from wuputah/things.rb
things = Thing.order("id DESC").limit(100)
while things.any?
things.each do |thing|
# stuff
end
things = Thing.order("id DESC").limit(100).where(["id < ?", things.last.id])
end
commands:
plugins:enable <gem name> # would not install, just enable in config
plugins:disable <gem name> # disables gem from config, but does not uninstall the gem
plugins:install <gem name> # install and enable the gem
plugins:uninstall <gem name> # uninstall and remove from the config
$ DEBUG=true bundle install --deployment
Some gems seem to be missing from your vendor/cache directory.
Could not find devise-1.2.rc2 in any of the sources
/home/hone/.rvm/gems/ree-1.8.7-2011.02@heroku_work/gems/bundler-1.0.10/lib/bundler/spec_set.rb:87:in `materialize'
/home/hone/.rvm/gems/ree-1.8.7-2011.02@heroku_work/gems/bundler-1.0.10/lib/bundler/spec_set.rb:81:in `map!'
/home/hone/.rvm/gems/ree-1.8.7-2011.02@heroku_work/gems/bundler-1.0.10/lib/bundler/spec_set.rb:81:in `materialize'
/home/hone/.rvm/gems/ree-1.8.7-2011.02@heroku_work/gems/bundler-1.0.10/lib/bundler/definition.rb:90:in `specs'
/home/hone/.rvm/gems/ree-1.8.7-2011.02@heroku_work/gems/bundler-1.0.10/lib/bundler/definition.rb:78:in `resolve_with_cache!'
/home/hone/.rvm/gems/ree-1.8.7-2011.02@heroku_work/gems/bundler-1.0.10/lib/bundler/installer.rb:34:in `run'
/home/hone/.rvm/gems/ree-1.8.7-2011.02@heroku_work/gems/bundler-1.0.10/lib/bundler/installer.rb:8:in `install'