Bundler
Remove the vendored sqlite3-ruby. Instead, add support for Bundler (which is vendored). Before running the new Instiki, do a ruby bundle which will install all of the needed gems locally. (If you need to, tweak the contents of Gemfile.)
This commit is contained in:
parent
399bd0d5a4
commit
4bf2e0d944
922 changed files with 71577 additions and 7055 deletions
|
@ -1,7 +1,7 @@
|
|||
# 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)
|
||||
RAILS_ROOT = File.join(File.dirname(__FILE__), '..') unless defined?(RAILS_ROOT)
|
||||
|
||||
module Rails
|
||||
class << self
|
||||
|
@ -21,7 +21,7 @@ module Rails
|
|||
end
|
||||
|
||||
def vendor_rails?
|
||||
File.exist?("#{RAILS_ROOT}/vendor/rails")
|
||||
File.exist?(File.join(RAILS_ROOT, 'vendor', 'rails'))
|
||||
end
|
||||
|
||||
def preinitialize
|
||||
|
@ -29,7 +29,7 @@ module Rails
|
|||
end
|
||||
|
||||
def preinitializer_path
|
||||
"#{RAILS_ROOT}/config/preinitializer.rb"
|
||||
File.join(RAILS_ROOT, 'config', 'preinitializer.rb')
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -42,8 +42,9 @@ module Rails
|
|||
|
||||
class VendorBoot < Boot
|
||||
def load_initializer
|
||||
require "#{RAILS_ROOT}/vendor/rails/railties/lib/initializer"
|
||||
require File.join(RAILS_ROOT, 'vendor', 'rails', 'railties', 'lib', 'initializer')
|
||||
Rails::Initializer.run(:install_gem_spec_stubs)
|
||||
Rails::GemDependency.add_frozen_gem_path
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -67,7 +68,7 @@ module Rails
|
|||
|
||||
class << self
|
||||
def rubygems_version
|
||||
Gem::RubyGemsVersion if defined? Gem::RubyGemsVersion
|
||||
Gem::RubyGemsVersion rescue nil
|
||||
end
|
||||
|
||||
def gem_version
|
||||
|
@ -81,15 +82,15 @@ module Rails
|
|||
end
|
||||
|
||||
def load_rubygems
|
||||
min_version = '1.3.6'
|
||||
require 'rubygems'
|
||||
|
||||
unless rubygems_version >= '0.9.4'
|
||||
$stderr.puts %(Rails requires RubyGems >= 0.9.4 (you have #{rubygems_version}). Please `gem update --system` and try again.)
|
||||
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 %(Rails requires RubyGems >= 0.9.4. Please install RubyGems and try again: http://rubygems.rubyforge.org)
|
||||
$stderr.puts %Q(Rails requires RubyGems >= #{min_version}. Please install RubyGems and try again: http://rubygems.rubyforge.org)
|
||||
exit 1
|
||||
end
|
||||
|
||||
|
@ -99,11 +100,25 @@ module Rails
|
|||
|
||||
private
|
||||
def read_environment_rb
|
||||
File.read("#{RAILS_ROOT}/config/environment.rb")
|
||||
File.read(File.join(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!
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue