Permalink
Browse files

Revert "[ci skip] updated bin/rails code in Rails Initialization Proc…

…ess guide"

This reverts commit 7feec40.

Reason: The guide had the contents of railties/bin/rails and I don't see
any reason to change it.
  • Loading branch information...
1 parent fbccdf9 commit 286259f2aaf2fb83a886061a4a70e3c9cb22fd42 @vijaydev vijaydev committed Mar 27, 2012
Showing with 6 additions and 16 deletions.
  1. +6 −16 guides/source/initialization.textile
View
22 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.

0 comments on commit 286259f

Please sign in to comment.