This file contains hidden or 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
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 |
This file contains hidden or 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
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 |
This file contains hidden or 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
$ 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' |
This file contains hidden or 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 'bundler/setup' | |
require 'sinatra' | |
get '/' do | |
"Sinatra Bro" | |
end | |
get '/sleep' do | |
sleep 30 | |
'Timeout' |
This file contains hidden or 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
$ gem install carmen --no-ri --no-rdoc | |
Fetching: carmen-0.2.6.gem (100%) | |
ERROR: Error installing carmen: | |
carmen requires carmen (>= 0, runtime) |
This file contains hidden or 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
File.open(File.dirname(__FILE__), 'r') do |file| | |
puts file.external_encoding | |
end |
This file contains hidden or 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
project_type = :rails | |
project_path = Compass::AppIntegration::Rails.root | |
environment = Compass::AppIntegration::Rails.env | |
http_path = "/" | |
css_dir = "tmp/stylesheets" | |
sass_dir = "app/views/stylesheets" |
This file contains hidden or 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
module Rack | |
class LogplexException | |
def initialize(app) | |
@app = app | |
end | |
def call(env) | |
begin | |
body = @app.call(env) |
This file contains hidden or 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
unless File.exists?("rake-0.8.7.gem") | |
puts 'downloading rake gem...' | |
require 'open-uri' | |
File.open('rake-0.8.7.gem','w'){|f| f.write open("http://production.cf.rubygems.org/gems/rake-0.8.7.gem").read } | |
end | |
require 'zlib' | |
require 'rubygems/format' | |
class Zlib::GzipReader |
This file contains hidden or 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
$ time ruby die.rb | |
[Wed Dec 29 22:04:56 -0600 2010, 1] | |
die.rb:15:in `initialize': not in gzip format (Zlib::GzipFile::Error) | |
from die.rb:15:in `new_orig' | |
from die.rb:15:in `new' | |
from /home/hone/.rvm/rubies/ruby-1.8.7-p302/lib/ruby/site_ruby/1.8/rubygems/package/tar_input.rb:49:in `initialize' | |
from /home/hone/.rvm/rubies/ruby-1.8.7-p302/lib/ruby/site_ruby/1.8/rubygems/package/tar_reader.rb:64:in `each' | |
from /home/hone/.rvm/rubies/ruby-1.8.7-p302/lib/ruby/site_ruby/1.8/rubygems/package/tar_reader.rb:55:in `loop' | |
from /home/hone/.rvm/rubies/ruby-1.8.7-p302/lib/ruby/site_ruby/1.8/rubygems/package/tar_reader.rb:55:in `each' | |
from /home/hone/.rvm/rubies/ruby-1.8.7-p302/lib/ruby/site_ruby/1.8/rubygems/package/tar_input.rb:32:in `initialize' |