aboutsummaryrefslogtreecommitdiffstats
path: root/guides/source
diff options
context:
space:
mode:
authorVijay Dev <vijaydev.cse@gmail.com>2012-03-27 21:08:08 +0530
committerVijay Dev <vijaydev.cse@gmail.com>2012-03-27 21:08:08 +0530
commit286259f2aaf2fb83a886061a4a70e3c9cb22fd42 (patch)
treec9d633f0c51b8432c2bbb6f4d17ba525d858f940 /guides/source
parentfbccdf9a96fe952ec3f99a2fb16afbc25c568ce5 (diff)
downloadrails-286259f2aaf2fb83a886061a4a70e3c9cb22fd42.tar.gz
rails-286259f2aaf2fb83a886061a4a70e3c9cb22fd42.tar.bz2
rails-286259f2aaf2fb83a886061a4a70e3c9cb22fd42.zip
Revert "[ci skip] updated bin/rails code in Rails Initialization Process guide"
This reverts commit 7feec40b89ada892ca6f107ada27ceedde505d83. Reason: The guide had the contents of railties/bin/rails and I don't see any reason to change it.
Diffstat (limited to 'guides/source')
-rw-r--r--guides/source/initialization.textile22
1 files changed, 6 insertions, 16 deletions
diff --git a/guides/source/initialization.textile b/guides/source/initialization.textile
index b5e427b35c..69e5c1edcc 100644
--- a/guides/source/initialization.textile
+++ b/guides/source/initialization.textile
@@ -21,24 +21,14 @@ The actual +rails+ command is kept in _bin/rails_:
<ruby>
#!/usr/bin/env ruby
-#
-# This file was generated by RubyGems.
-#
-# The application 'railties' is installed as part of a gem, and
-# this file is here to facilitate running it.
-#
-require 'rubygems'
-
-version = ">= 0"
-
-if ARGV.first =~ /^_(.*)_$/ and Gem::Version.correct? $1 then
- version = $1
- ARGV.shift
+begin
+ require "rails/cli"
+rescue LoadError
+ railties_path = File.expand_path('../../railties/lib', __FILE__)
+ $:.unshift(railties_path)
+ require "rails/cli"
end
-
-gem 'railties', version
-load Gem.bin_path('railties', 'rails', version)
</ruby>
This file will attempt to load +rails/cli+. If it cannot find it then +railties/lib+ is added to the load path (+$:+) before retrying.