Skip to content

Instantly share code, notes, and snippets.

@donnoman
Created July 24, 2010 00:50
Show Gist options
  • Save donnoman/488261 to your computer and use it in GitHub Desktop.
Save donnoman/488261 to your computer and use it in GitHub Desktop.
causing script/server and rake db:migrate to hang with bundler 0.9.24, 1.0.0.beta.9, and 1.0.0.rc.1
# Don't change this file!
# Configure your app in config/environment.rb and config/environments/*.rb
RAILS_ROOT = "#{File.dirname(__FILE__)}/.." unless defined?(RAILS_ROOT)
module Rails
class << self
def boot!
unless booted?
preinitialize
pick_boot.run
end
end
def booted?
defined? Rails::Initializer
end
def pick_boot
(vendor_rails? ? VendorBoot : GemBoot).new
end
def vendor_rails?
File.exist?("#{RAILS_ROOT}/vendor/rails")
end
def preinitialize
load(preinitializer_path) if File.exist?(preinitializer_path)
end
def preinitializer_path
"#{RAILS_ROOT}/config/preinitializer.rb"
end
end
class Boot
def run
load_initializer
Rails::Initializer.run(:set_load_path)
end
end
class VendorBoot < Boot
def load_initializer
require "#{RAILS_ROOT}/vendor/rails/railties/lib/initializer"
Rails::Initializer.run(:install_gem_spec_stubs)
Rails::GemDependency.add_frozen_gem_path
end
end
class GemBoot < Boot
def load_initializer
self.class.load_rubygems
load_rails_gem
require 'initializer'
end
def load_rails_gem
if version = self.class.gem_version
gem 'rails', version
else
gem 'rails'
end
rescue Gem::LoadError => load_error
$stderr.puts %(Missing the Rails #{version} gem. Please `gem install -v=#{version} rails`, update your RAILS_GEM_VERSION setting in config/environment.rb for the Rails version you do have installed, or comment out RAILS_GEM_VERSION to use the latest version installed.)
exit 1
end
class << self
def rubygems_version
Gem::RubyGemsVersion rescue nil
end
def gem_version
if defined? RAILS_GEM_VERSION
RAILS_GEM_VERSION
elsif ENV.include?('RAILS_GEM_VERSION')
ENV['RAILS_GEM_VERSION']
else
parse_gem_version(read_environment_rb)
end
end
def load_rubygems
require 'rubygems'
min_version = '1.3.1'
unless rubygems_version >= min_version
$stderr.puts %Q(Rails requires RubyGems >= #{min_version} (you have #{rubygems_version}). Please `gem update --system` and try again.)
exit 1
end
rescue LoadError
$stderr.puts %Q(Rails requires RubyGems >= #{min_version}. Please install RubyGems and try again: http://rubygems.rubyforge.org)
exit 1
end
def parse_gem_version(text)
$1 if text =~ /^[^#]*RAILS_GEM_VERSION\s*=\s*["']([!~<>=]*\s*[\d.]+)["']/
end
private
def read_environment_rb
File.read("#{RAILS_ROOT}/config/environment.rb")
end
end
end
end
class Rails::Boot
def run
load_initializer
Rails::Initializer.class_eval do
def load_gems
@bundler_loaded ||= Bundler.require :default, Rails.env
end
end
Rails::Initializer.run(:set_load_path)
end
end
# All that for this:
Rails.boot!
---
BUNDLE_DISABLE_SHARED_GEMS: "1"
BUNDLE_PATH: vendor/bundler
# Be sure to restart your server when you modify this file
require 'rubygems';require 'ruby-debug'; debugger;
# Specifies gem version of Rails to use when vendor/rails is not present
RAILS_GEM_VERSION = '2.3.4' unless defined? RAILS_GEM_VERSION
# Bootstrap the Rails environment, frameworks, and default configuration
require File.join(File.dirname(__FILE__), 'boot')
# Initialize the log facility
if defined?(RAKEVERSION) and defined?(::Logging)
Object.send(:remove_const, :Logging)
end
require 'logging' # <---- It's hanging at this require.
require File.dirname(__FILE__) + '/../vendor/plugins/wp_logging/lib/logging_extensions'
Rails::Initializer.run do |config|
# Settings in config/environments/* take precedence over those specified here.
# Application configuration should go into files in config/initializers
# -- all .rb files in that directory are automatically loaded.
# Add additional load paths for your own custom dirs
config.load_paths += %W( #{RAILS_ROOT}/app/jobs #{RAILS_ROOT}/app/dynos )
# Specify gems that this application depends on in the Gemfile and install with bundle install
# Only load the plugins named here, in the order given (default is alphabetical).
# :all can be used as a placeholder for all plugins not explicitly named
# config.plugins = [ :exception_notification, :ssl_requirement, :all ]
# Skip frameworks you're not going to use. To use Rails without a database,
# you must remove the Active Record framework.
# config.frameworks -= [ :active_record, :active_resource, :action_mailer ]
# Activate observers that should always be running
# config.active_record.observers = :cacher, :garbage_collector, :forum_observer
# Set Time.zone default to the specified zone and make Active Record auto-convert to this zone.
# Run "rake -D time" for a list of tasks for finding time zone names.
config.time_zone = 'UTC'
# The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded.
# config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}')]
config.i18n.load_path += Dir[Rails.root.join('app', 'locales', '*', '*.yml')]
# Extract the enviroment type, e.g. 'development', 'production', etc.
RAILS_ENV_TYPE = RAILS_ENV.split('_')[-1] unless defined?(RAILS_ENV_TYPE)
#---------------------------------------------------------
# Set up for diagnostic logging
#---------------------------------------------------------
unless defined?($app_logger)
Logging.configure(File.join(Rails.root, "config", "logging.#{RAILS_ENV}.yml"))
$app_logger = Logging::Logger["App"] || Logging::Logger.new("App")
$app_logger.info("-------- Begin Application Instance (#{RAILS_ENV}) --------")
# Rails framework logger - redirected to Logging exension from built-in logger
config.logger = RAILS_DEFAULT_LOGGER = Logging::Logger["Rails"] || Logging::Logger.new("Rails")
end
end
RubyGems Environment:
- RUBYGEMS VERSION: 1.3.7
- RUBY VERSION: 1.8.7 (2009-06-12 patchlevel 174) [i686-linux]
- INSTALLATION DIRECTORY: /usr/local/ruby-enterprise/lib/ruby/gems
- RUBY EXECUTABLE: /usr/local/ruby-enterprise/bin/ruby
- EXECUTABLE DIRECTORY: /usr/local/ruby-enterprise/lib/ruby/gems/bin
- RUBYGEMS PLATFORMS:
- ruby
- x86-linux
- GEM PATHS:
- /usr/local/ruby-enterprise/lib/ruby/gems
- /home/dbray/.gem/ruby/1.8
- /usr/local/ruby-enterprise/lib/ruby/gems/1.8
- GEM CONFIGURATION:
- :update_sources => true
- :verbose => true
- :benchmark => false
- :backtrace => false
- :bulk_threshold => 1000
- REMOTE SOURCES:
- http://rubygems.org/
# bundle update vendor/bundler_gems
# Sources
source "http://gemcutter.org"
source "http://gems.github.com"
# Stack
gem "rails", "2.3.4"
gem "rack", "1.0.1"
gem 'mysql', "2.7"
# Application
gem 'logging', '1.2.2'
gem 'fastercsv', '1.4.0'
gem "rforce", '0.3'
gem 'yajl-ruby', '0.6.5', :require => 'yajl'
gem 'right_aws', '1.10.0'
gem "quantipay-authlogic_haapi", '1.0.3', :require => "authlogic_haapi"
gem "haml", '2.2.17'
gem 'soap4r', '1.5.8'
gem 'bcrypt-ruby', '2.1.2', :require => 'bcrypt'
# gem 'vpim', '0.695'
# gem 'nokogiri', '1.4.1'
# gem "taf2-curb", '0.5.4.0', :require => 'curb'
# gem 'feedzirra', '0.0.20'
# gem 'activemerchant', '1.4.2wp', :require => 'active_merchant', :path => 'vendor/gems/activemerchant-1.4.2wp'
# gem 'libxml-ruby', '0.9.7', :require => "libxml"
# gem 'ruby-openid', '2.1.7'
# gem 'ruby-openid-apps-discovery', '1.01'
# gem 'rack-openid', '1.0.3'
# gem 'authlogic', '2.0.11'
# gem 'newrelic_rpm', '2.12.3'
# gem 'paperclip', '2.2.8'
# gem 'princely', '1.2.5'
#gem 'awesome_nested_set', '1.4.3' #plugin is version 1.2.0 not available as a gem. Need to upgrade and remove plugin.
#gem 'acts_as_versioned', '0.6.0' #plugin is version 0.3.1 not available as gem. Need to upgrade and remove plugin.
#gem 'will_paginate', '2.3.14' #plugin is version 2.3.8 and not available as a gem. Need to upgrade and remove plugin.
#gem 'exception_notification', '2.3.3.0' #plugin is version 1.3 and not available as a gem. Need to upgrade and remove plugin.
group :production do
# gem 'acts_as_paranoid', '0.3.1' #doesn't play well with others.
end
# Testing
group :test do
# gem 'acts_as_paranoid', '0.3.1'
gem "rspec", '1.2.9', :require => 'spec'
gem "rspec-rails", '1.2.9'
gem "rcov", "0.9.6"
end
# Development
group :development do
# gem 'acts_as_paranoid', '0.3.1'
gem "thin", "1.2.5" #Replacement as preferred server for development mode.
gem "ruby-debug", "0.10.3"
end
begin
require "rubygems"
require "bundler"
rescue LoadError
raise "Could not load the bundler gem. Install it with `gem install bundler`."
end
if Gem::Version.new(Bundler::VERSION) <= Gem::Version.new("0.9.24")
raise RuntimeError, "Your bundler version is too old for Rails 2.3." +
"Run `gem install bundler` to upgrade."
end
begin
# Set up load paths for all bundled gems
ENV["BUNDLE_GEMFILE"] = File.expand_path("../../Gemfile", __FILE__)
Bundler.setup
rescue Bundler::GemNotFound
raise RuntimeError, "Bundler couldn't find some gems." +
"Did you run `bundle install`?"
end
Gems included by the bundle:
* actionmailer (2.3.4)
* actionpack (2.3.4)
* activerecord (2.3.4)
* activeresource (2.3.4)
* activesupport (2.3.4)
* bcrypt-ruby (2.1.2)
* builder (2.1.2)
* bundler (1.0.0.rc.1)
* columnize (0.3.1)
* daemons (1.1.0)
* eventmachine (0.12.10)
* facets (2.8.4)
* fastercsv (1.4.0)
* flexmock (0.8.7)
* haml (2.2.17)
* httpclient (2.1.5.2)
* linecache (0.43)
* little-plugger (1.1.2)
* lockfile (1.4.3)
* logging (1.2.2)
* mysql (2.7)
* quantipay-authlogic_haapi (1.0.3)
* rack (1.0.1)
* rails (2.3.4)
* rake (0.8.7)
* rcov (0.9.6)
* rforce (0.3)
* right_aws (1.10.0)
* right_http_connection (1.2.4)
* rspec (1.2.9)
* rspec-rails (1.2.9)
* ruby-debug (0.10.3)
* ruby-debug-base (0.10.3)
* soap4r (1.5.8)
* thin (1.2.5)
* yajl-ruby (0.6.5)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment