From 87a28e34aef3f68de8e344aadc47a516e28c0b09 Mon Sep 17 00:00:00 2001 From: Xavier Noria Date: Fri, 30 Jul 2010 21:50:38 +0200 Subject: if there's a Gemfile and doc:guides can't load RedCloth, print instructions for bundler --- railties/guides/rails_guides.rb | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) (limited to 'railties/guides/rails_guides.rb') diff --git a/railties/guides/rails_guides.rb b/railties/guides/rails_guides.rb index e6f0b694a6..dfbb06cc76 100644 --- a/railties/guides/rails_guides.rb +++ b/railties/guides/rails_guides.rb @@ -1,6 +1,13 @@ pwd = File.dirname(__FILE__) $:.unshift pwd +# This is a predicate useful for the doc:guides task of applications. +def bundler? + # Note that rake sets the cwd to the one that contains the Rakefile + # being executed. + File.exists?('Gemfile') +end + # Loading Action Pack requires rack and erubis. require 'rubygems' @@ -20,7 +27,19 @@ begin gem 'RedCloth', '>= 4.1.1' require 'redcloth' rescue Gem::LoadError - $stderr.puts %(Generating Guides requires RedCloth 4.1.1+) + $stderr.puts('Generating guides requires RedCloth 4.1.1+.') + $stderr.puts(<= 4.1.1' + +to the Gemfile, run + + bundle install + +and try again. +ERROR + exit 1 end -- cgit v1.2.3