Skip to content

Instantly share code, notes, and snippets.

View eclubb's full-sized avatar

Earle Clubb eclubb

  • Valcom, Inc.
  • Roanoke, VA
View GitHub Profile
$ rake native gem --trace
(in /home/ehc/projects/do/do_sqlite3)
/usr/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake/gempackagetask.rb:13:Warning: Gem::manage_gems is deprecated and will be removed on or after March 2009.
which: no dot in (/usr/kerberos/bin:/usr/lib/ccache:/usr/local/bin:/bin:/usr/bin:/home/ehc/bin:/sbin:/usr/sbin)
rake-compiler must be configured first to enable cross-compilation
** Invoke native (first_time)
** Invoke native:i386-linux (first_time)
** Invoke native:do_sqlite3:i386-linux (first_time)
** Invoke tmp/i386-linux/do_sqlite3_ext/do_sqlite3_ext.so (first_time)
** Invoke tmp/i386-linux/do_sqlite3_ext/Makefile (first_time)
$ sudo gem uninstall do_sqlite3
Successfully uninstalled do_sqlite3-0.9.10.1
$ sudo gem install -l pkg/do_sqlite3-0.9.10.1-x86-linux.gem --no-rdoc --no-ri
Successfully installed do_sqlite3-0.9.10.1-x86-linux
1 gem installed
$ sudo gem uninstall do_sqlite3
Successfully uninstalled do_sqlite3-0.9.10.1-x86-linux
A ArgumentError occurred in users#forgot:
A sender (Return-Path, Sender or From) required to send a message
mail (2.2.12) lib/mail/network/delivery_methods/smtp.rb:97:in `deliver!'
mail (2.2.12) lib/mail/message.rb:1964:in `do_delivery'
mail (2.2.12) lib/mail/message.rb:228:in `deliver'
actionmailer (3.0.3) lib/action_mailer/base.rb:401:in `deliver_mail'
activesupport (3.0.3) lib/active_support/notifications.rb:52:in `instrument'
activesupport (3.0.3) lib/active_support/notifications/instrumenter.rb:21:in `instrument'
module DataMapper
module Reflection
def self.included(model)
model.extend ClassMethods
end
module ClassMethods
def reflect_on_association(association)
relationship = relationships[association]
MacroReflection.new(relationship, relationship.name, {})
-# Note that in this scenario, there is only one comment.
= simple_form_for @post do |post_form|
...
= post_form.simple_fields_for :comments do |comment_form|
comment_form.input :name
comment_form.input :email
A NoMethodError occurred in pages#update:
undefined method `cache_path' for #<ActiveSupport::Cache::MemoryStore:0x9afc1bc>
/home/orchard_hills_church-staging/apps/orchard_hills_church/shared/bundle/ruby/1.8/bundler/gems/refinerycms-7bd49ac79ab4/pages/app/models/page.rb:241:in `expire_page_caching'
-------------------------------
Backtrace:
-------------------------------
@eclubb
eclubb / category.rb
Created April 8, 2011 21:42
HABTM with deferred save error
class Category < ActiveRecord::Base
has_and_belongs_to_many_with_deferred_save :posts
end
earle@king ~/projects/websites $ refinerycms/bin/refinerycms dummy
Running: /home/earle/.rvm/rubies/ree-1.8.7-2011.03/bin/ruby -S rails new "/home/earle/projects/websites/dummy" --database sqlite3 --skip-test-unit --skip-prototype
create
create README
create Rakefile
create config.ru
create .gitignore
create Gemfile
create app
create app/controllers/application_controller.rb
rails generate migration add_image_id_to_blog_posts image_id:integer
rake db:migrate
Override the blog category model and add:
belongs_to :image
Override the blog category form and add an image picker to it:
<div class='field'>
<%= f.label :image -%>
<%= render :partial => "/shared/admin/image_picker", :locals => {
@eclubb
eclubb / sqlite2pg.sh
Created March 30, 2012 17:20
Script to import SQLite3 database into PostgreSQL
#!/bin/sh
# This script will migrate schema and data from a SQLite3 database to PostgreSQL.
# Schema translation based on http://stackoverflow.com/a/4581921/1303625.
# Some column types are not handled (e.g blobs).
SQLITE_DB_PATH=$1
PG_DB_NAME=$2
PG_USER_NAME=$3