This script enables you to launch your Rails application in production environment (port:80) with Nginx and Unicorn.
Please make sure that your Gemfile in your rails application includes unicorn.
| # The latest version of this script is now available at | |
| # https://github.com/jasoncodes/dotfiles/blob/master/aliases/rbenv.sh | |
| VERSION=1.9.3-p286 | |
| brew update | |
| brew install rbenv ruby-build rbenv-vars readline ctags | |
| if [ -n "${ZSH_VERSION:-}" ]; then | |
| echo 'eval "$(rbenv init - --no-rehash)"' >> ~/.zshrc | |
| else | |
| echo 'eval "$(rbenv init - --no-rehash)"' >> ~/.bash_profile |
| ## Apache Load Balancer Front End ## | |
| # Puppet Apache::Config[010_frontend_puppet_prod.conf] | |
| # This file managed by Puppet from a template. | |
| # source: puppet_frontend_XXXX.conf | |
| # All CA requests should be directed to specific workers | |
| <Proxy balancer://puppet_prod_ca> | |
| # Only one member | |
| BalancerMember http://puppetca.puppetlabs.vm:18140 |
| #!/usr/bin/ruby | |
| require 'rss' | |
| p 'Downloading rss index' | |
| rss_string = open('http://feeds.feedburner.com/railscasts').read | |
| rss = RSS::Parser.parse(rss_string, false) | |
| videos_urls = rss.items.map { |it| it.enclosure.url }.reverse | |
| videos_filenames = videos_urls.map {|url| url.split('/').last } |
| # Install ruby 1.8.7 -p299 | |
| sudo mkdir /usr/local/src | |
| cd /usr/local/src | |
| sudo curl -O ftp://ftp.ruby-lang.org/pub/ruby/1.8/ruby-1.8.7-p299.tar.gz | |
| sudo tar xzvf ruby-1.8.7-p299.tar.gz | |
| cd ruby-1.8.7-p299 | |
| sudo ./configure --enable-shared --enable-pthread | |
| sudo make | |
| sudo make install | |
| cd ext/zlib |
| Full Plugin List Deployed in Rails applications monitored by New Relic, September 2011 | |
| Count Plugin Name | |
| ------------------- | |
| 2040 rpm | |
| 1534 newrelic_rpm | |
| 1268 acts_as_list | |
| 1186 paperclip | |
| 1130 will_paginate | |
| 1068 exception_notification |
| Full Gem List Deployed in ruby applications monitored by New Relic, September 2011 | |
| Count Gem Name | |
| ---------------- | |
| 7570 rack | |
| 7444 rake | |
| 7425 rails | |
| 7424 activesupport | |
| 7421 bundler | |
| 7412 actionpack |
| #!/bin/sh | |
| # Install ImageMagick on Snow Leopard: by kain, improved by mislav and samsoffes | |
| # http://www.icoretech.org/2009/08/install-imagemagick-in-leopard-snow-leopard/ | |
| # Work with 64bit kernel mode | |
| set -e | |
| PREFIX=/usr/local | |
| # Passenger users: amend your Apache global configuration with the following directive | |
| # SetEnv PATH /usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin |
| # To show SQL Statements in the rails console | |
| # copy this code to ~/.irbrc | |
| # code found there http://frozenplague.net/2008/12/showing-sql-statements-in-scriptconsole/ | |
| if ENV.include?('RAILS_ENV') && !Object.const_defined?('RAILS_DEFAULT_LOGGER') | |
| require 'logger' | |
| RAILS_DEFAULT_LOGGER = Logger.new(STDOUT) | |
| end |
| require "thor/shell" | |
| say("Modifying a new Rails app ...", :yellow) | |
| #---------------------------------------------------------------------------- | |
| # Configure | |
| #---------------------------------------------------------------------------- | |
| =begin | |
| unless options[:database] == 'sqlite3' | |
| username = ask("What's your database username[root]") | |
| username = 'root' if username.blank? |