aboutsummaryrefslogtreecommitdiffstats
path: root/guides/source/initialization.textile
diff options
context:
space:
mode:
authorOscar Del Ben <info@oscardelben.com>2012-05-22 08:35:49 -0700
committerOscar Del Ben <info@oscardelben.com>2012-05-22 08:35:49 -0700
commitd4d87941cbf4d8204c8d3ac6f4a87c29e42445b0 (patch)
treed3258fb6f5c9478f38b128f71938dcb410a3cff1 /guides/source/initialization.textile
parentacdf8ac58dbf71ac274dc93fd9b4c6da539a36b3 (diff)
downloadrails-d4d87941cbf4d8204c8d3ac6f4a87c29e42445b0.tar.gz
rails-d4d87941cbf4d8204c8d3ac6f4a87c29e42445b0.tar.bz2
rails-d4d87941cbf4d8204c8d3ac6f4a87c29e42445b0.zip
[Guides] change rails bin section
Diffstat (limited to 'guides/source/initialization.textile')
-rw-r--r--guides/source/initialization.textile11
1 files changed, 5 insertions, 6 deletions
diff --git a/guides/source/initialization.textile b/guides/source/initialization.textile
index 361045282a..5ffa62fd67 100644
--- a/guides/source/initialization.textile
+++ b/guides/source/initialization.textile
@@ -24,16 +24,15 @@ The actual +rails+ command is kept in _bin/rails_:
<ruby>
#!/usr/bin/env ruby
-begin
- require "rails/cli"
-rescue LoadError
- railties_path = File.expand_path('../../railties/lib', __FILE__)
+if File.exists?(File.join(File.expand_path('../../..', __FILE__), '.git'))
+ railties_path = File.expand_path('../../lib', __FILE__)
$:.unshift(railties_path)
- require "rails/cli"
end
+require "rails/cli"
</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.
+This file will first attempt to push the +railties/lib+ directory if
+present, and then require +rails/cli+.
h4. +railties/lib/rails/cli.rb+