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
#Steps to install RVM + Ruby 1.9.2 + Rails + nginx + Passenger on CentOS (tested on v5.5) | |
# Install git and curl, if not already installed | |
sudo yum install git | |
sudo yum install curl | |
# Create the rvm group and add any users who will be using rvm to the group | |
sudo su - | |
groupadd rvm |
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
# The YUM package is too old for use with ruby-sqlite3, use the autoconf package from www.sqlite.org | |
cd /opt | |
wget http://www.sqlite.org/sqlite-autoconf-3070701.tar.gz | |
tar xvzf sqlite-autoconf-3070701.tar.gz | |
ln -s /opt/sqlite-autoconf-3070701 /opt/sqlite3 | |
cd /opt/sqlite3 | |
./configure --prefix=/opt/sqlite3 | |
make | |
make install | |
# Shared library will be installed in /usr/local/lib. |
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
class ApplicationController < ActionController::Base | |
before_filter :set_current_user | |
private | |
def set_current_user | |
UserActionObserver.current_user = current_user | |
end | |
end | |
class UserActionObserver < ActiveRecord::Observer | |
# assuming these all have created_by_id and updated_by_id |
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
group :development do | |
gem 'heroku', '2.1.4' | |
gem 'jquery-rails', '1.0.2' | |
gem 'rspec-rails', '2.6.1' | |
gem 'cucumber-rails', '0.4.1' | |
gem 'factory_girl_rails', '1.0.1' | |
gem 'capybara', '0.4.1.2' | |
gem 'delorean', '1.0.0' | |
gem 'mocha', '0.9.12' |
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
# Use /download as our temporary download directory | |
# Start download and install freetds | |
cd /download | |
# Offical Site: freetds.org | |
wget ftp://ftp.astron.com/pub/freetds/stable/freetds-stable.tgz | |
tar zxvf freetds-0.91 | |
cd freetds-0.91 | |
./configure | |
make | |
make install |
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
# 更换源 | |
comment_lines "Gemfile", /source .http.*/ | |
add_source "http://ruby.taobao.org" | |
# HTML模板 | |
gem 'slim' | |
# 单点登录 | |
gem 'rubycas-client' | |
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
Show hidden characters
{ | |
"alignment_chars" : ["=", ":"] | |
} |