-
-
Save bglusman/849679 to your computer and use it in GitHub Desktop.
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
## config/boot.rb | |
# Place this snippet right above the "Rails.boot!" command at the bottom of the file. | |
class Rails::Boot | |
def run | |
load_initializer | |
extend_environment | |
Rails::Initializer.run(:set_load_path) | |
end | |
def extend_environment | |
Rails::Initializer.class_eval do | |
old_load = instance_method(:load_environment) | |
define_method(:load_environment) do | |
Bundler.require :default, Rails.env | |
old_load.bind(self).call | |
end | |
end | |
end | |
end | |
## config/preinitializer.rb | |
# Create this file and paste the code in | |
begin | |
# Require the preresolved locked set of gems. | |
require File.expand_path('../../.bundle/environment', __FILE__) | |
rescue LoadError | |
# Fallback on doing the resolve at runtime. | |
require "rubygems" | |
require "bundler" | |
Bundler.setup | |
end | |
## Install bundler | |
# cd /path/to/RAILS_ROOT | |
# gem install bundler | |
# bundle init | |
## Generates a Gemfile in the RAILS_ROOT | |
# Here's a simple template to start off with | |
# Default RubyGems Source | |
source :gemcutter | |
# Ruby on Rails Framework Requirements | |
gem "rails", "2.3.5" | |
gem "rack", "1.0.1" | |
# Additional Gems | |
gem "sqlite3-ruby" | |
# Gems specifically for development environment | |
group :development do | |
gem "hirb" | |
end | |
# Gems specifically for test environment | |
group :test do | |
gem "rspec" | |
gem "rspec-rails" | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment