Skip to content
Browse files

[ci skip] updated bin/rails code in Rails Initialization Process guide

  • Loading branch information...
1 parent 014498e commit 7feec40b89ada892ca6f107ada27ceedde505d83 @sent-hil sent-hil committed Mar 24, 2012
Showing with 16 additions and 6 deletions.
  1. +16 −6 guides/source/initialization.textile
View
22 guides/source/initialization.textile
@@ -21,14 +21,24 @@ 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.
+#
-begin
- require "rails/cli"
-rescue LoadError
- railties_path = File.expand_path('../../railties/lib', __FILE__)
- $:.unshift(railties_path)
- require "rails/cli"
+require 'rubygems'
+
+version = ">= 0"
+
+if ARGV.first =~ /^_(.*)_$/ and Gem::Version.correct? $1 then
+ version = $1
+ ARGV.shift
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 7feec40

Please sign in to comment.
Something went wrong with that request. Please try again.