This file contains 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
After upgrading from Ruby 1.9.2 to 1.9.3 on a test server, the pg would not install. | |
mv ~/.rvm/usr/lib ~/.rvm/usr/lib_rvm | |
bundle config build.pg --with-pg-config=/usr/bin/pg_config.libpq-dev | |
gem install pg | |
The mv line was the breakthrough, see: | |
http://stackoverflow.com/questions/8814924/gem-install-pg-can-not-bind-to-libpq |
This file contains 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
#!/usr/bin/nice /bin/bash | |
# | |
# Your script goes here.... | |
# | |
# Now when this script is run from the command line as ./run_as_nice.sh, it will execute with lower | |
# priority to avoid causing the load average to spike as much. |
This file contains 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
update pg_database set datallowconn = TRUE where datname = 'template0'; | |
\c template0 | |
update pg_database set datistemplate = FALSE where datname = 'template1'; | |
drop database template1; | |
create database template1 with template = template0 encoding = 'UTF8'; | |
update pg_database set datistemplate = TRUE where datname = 'template1'; | |
\c template1 | |
update pg_database set datallowconn = FALSE where datname = 'template0'; |
This file contains 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
alias nokofix="gem install nokogiri -- --with-xml2-dir=/usr/local/Cellar/libxml2/2.7.8 --with-xslt-dir=/usr/local/Cellar/libxslt/1.1.26 --with-iconv-dir=/usr/local/Cellar/libiconv/1.13.1/ && bundle config build.nokogiri – –with-xml2-dir=/usr/local/Cellar/libxml2/2.7.8 –with-xslt-dir=/usr/local/Cellar/libxslt/1.1.26 –with-iconv-dir=/usr/local/Cellar/libiconv/1.13.1/" |
This file contains 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
Province/Territory Abbreviation | |
Alberta AB | |
British Columbia BC | |
Manitoba MB | |
New Brunswick NB | |
Newfoundland and Labrador NL | |
Northwest Territories NT | |
Nova Scotia NS | |
Nunavut NU | |
Ontario ON |
This file contains 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
My first attempts at running a new Rails application on JRuby is completely failing. Through the process of elimination, I have traced the source of the problem down to the asset pipeline in Rails 3.2. Though I do not know how to fix this: | |
stat.st_gid unsupported or native support failed to load | |
org/jruby/RubyFileStat.java:432:in `gid' | |
This is on October 20, 2012. Using jruby 1.6.7 and Rails 3.2.8 out of the box with the gems as published on this date. | |
Here are the steps to reproduce - again, no custom code on my part. | |
Using Mac OS X Mountain Lion, I installed the following: |
This file contains 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
# | |
# One solution for deploying assets to production servers through git while | |
# precompiling the assets on the local development system. | |
# | |
# By Frank Rietta | |
# Copyright 2012 Rietta Inc. All Rights Reserved. | |
# Licensed as open source under terms of the BSD license. | |
# | |
# The script switches to the deploy branch, syncs it down, merges the changes from master, precompiles the | |
# assets and then pushes those to the deploy branch on remote so that the capistrano script can deploy the |
This file contains 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
# | |
# Domain Validator by Frank Rietta | |
# (C) 2012 Rietta Inc. All Rights Reserved. | |
# Licensed under terms of the BSD License. | |
# | |
# To use in a validation, add something like this to your model: | |
# | |
# validates :name, :domain => true | |
# | |
class DomainValidator < ActiveModel::EachValidator |
This file contains 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
RAILS_ENV=development rails c | |
/home/railsapps/.rvm/gems/ruby-1.9.2-p290@spree_demo/gems/activerecord-3.2.3/lib/active_record/connection_adapters/abstract/connection_pool.rb:398:in `retrieve_connection': ActiveRecord::ConnectionNotEstablished (ActiveRecord::ConnectionNotEstablished) | |
from /home/railsapps/.rvm/gems/ruby-1.9.2-p290@spree_demo/gems/activerecord-3.2.3/lib/active_record/connection_adapters/abstract/connection_specification.rb:168:in `retrieve_connection' | |
from /home/railsapps/.rvm/gems/ruby-1.9.2-p290@spree_demo/gems/activerecord-3.2.3/lib/active_record/connection_adapters/abstract/connection_specification.rb:142:in `connection' | |
from /home/railsapps/.rvm/gems/ruby-1.9.2-p290@spree_demo/gems/activerecord-3.2.3/lib/active_record/model_schema.rb:228:in `columns' | |
from /home/railsapps/.rvm/gems/ruby-1.9.2-p290@spree_demo/gems/activerecord-3.2.3/lib/active_record/model_schema.rb:248:in `column_names' | |
from /home/railsapps/.rvm/gems/ruby-1.9.2-p290@spree_demo/gems/rd_searchlogic-3.0.1/lib/searchlogic/n |
This file contains 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
When got: | |
perl: warning: Setting locale failed. | |
perl: warning: Please check that your locale settings: | |
LANGUAGE = (unset), | |
LC_ALL = (unset), | |
LC_CTYPE = "utf-8", | |
LANG = "en_US.UTF-8" | |
are supported and installed on your system. | |
perl: warning: Falling back to the standard locale ("C"). |