Every couple of weeks, I hear someone complaining about some difficulties with Bundler. Yesterday, it happened twice. But somehow I just never have those difficulties. I'm not saying Bundler is perfect; certainly in its early days it wasn't even close. But for the past two years it's been incredibly solid and trouble-free for me, and I think a large part of the reason is the way I use it. Bundler arguably does too much, and just as with Git, a big part of it is knowing what not to do, and configuring things to avoid the trouble spots.
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
set :application, '<APP_NAME>' | |
set :repo_url, "<git@PATH/REPO.git>" | |
# ask :branch, proc { `git rev-parse --abbrev-ref HEAD`.chomp } | |
set :deploy_to, "/home/deploy/rails/<APP_NAME>" | |
# set :scm, :git | |
set :format, :pretty | |
set :log_level, :debug |
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 'spec/support/grep_matcher' | |
describe do | |
disallow_presence_of pattern: "send(.*#", | |
location: "app/", | |
description: "Do not use dynamic method invocations", | |
failure: "Please change dynamic method call to something more sane." | |
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
Sinatra 1.4.4 | |
Rails 4.0.1 | |
Rails-API 0.1.0 | |
Rails-API disabled Mailer and Sockets | |
Each app connected to a MySQL database via ActiveRecord with an empty Accounts table; each app's root path responded with "#{Account.count} accounts detected." | |
Each app was configured to use Thin as its web server. |
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
# | |
# CORS header support | |
# | |
# One way to use this is by placing it into a file called "cors_support" | |
# under your Nginx configuration directory and placing the following | |
# statement inside your **location** block(s): | |
# | |
# include cors_support; | |
# | |
# As of Nginx 1.7.5, add_header supports an "always" parameter which |
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
# to generate your dhparam.pem file, run in the terminal | |
openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048 |
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
units = types.reject { |type, dir| type == 'features' } | |
namespace :spec do | |
desc "Run 'unit' specs: #{units.keys.to_sentence}" | |
RSpec::Core::RakeTask.new(:units) do |t| | |
t.pattern = units.map { |type, dir| "./#{dir}/**/*_spec.rb" } | |
end | |
end | |
default_task = Rake::Task['default'] |
Updated for Rails 4.0.0+
-
Set up the
bower
gem. -
Follow the Bower instructions and list your dependencies in your
bower.json
, e.g.// bower.json
{
echo 'export NEWRELIC_DISPATCHER=pow' >> ~/.powconfig
echo 'export POW_WORKERS=1' >> ~/.powconfig
Explanation:
http://andre.arko.net/2011/11/12/use-newrelic-rpm-developer-mode-with-pow/
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
if [ -f "$rvm_path/scripts/rvm" ]; then | |
source "$rvm_path/scripts/rvm" | |
if [ -f ".rvmrc" ]; then | |
source ".rvmrc" | |
fi | |
if [ -f ".ruby-version" ]; then | |
rvm use `cat .ruby-version` | |
fi |