diff options
author | Prathamesh Sonpatki <csonpatki@gmail.com> | 2013-08-22 09:08:38 +0530 |
---|---|---|
committer | Prathamesh Sonpatki <csonpatki@gmail.com> | 2013-08-22 09:11:34 +0530 |
commit | 2c02fc3fd7181ab1cc39b0426491a830e0c52d5a (patch) | |
tree | 8d8c9c44bd00b0959f6e4e89ac147c6f71107b83 /guides/rails_guides.rb | |
parent | 9208338b0f982e9776f29caeb46795c4cd9207a1 (diff) | |
download | rails-2c02fc3fd7181ab1cc39b0426491a830e0c52d5a.tar.gz rails-2c02fc3fd7181ab1cc39b0426491a830e0c52d5a.tar.bz2 rails-2c02fc3fd7181ab1cc39b0426491a830e0c52d5a.zip |
Add error message for including nokogiri in Gemfile for rake doc:guides [ci skip]
- When `rake doc:guides` is run from applications, it complains for
presence of redcarpet if it not present in Gemfile
- Similarly it should complain about nokogiri
Diffstat (limited to 'guides/rails_guides.rb')
-rw-r--r-- | guides/rails_guides.rb | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/guides/rails_guides.rb b/guides/rails_guides.rb index ce409868ca..33975718c9 100644 --- a/guides/rails_guides.rb +++ b/guides/rails_guides.rb @@ -39,6 +39,25 @@ ERROR exit 1 end +begin + require 'nokogiri' +rescue LoadError + # This can happen if doc:guides is executed in an application. + $stderr.puts('Generating guides requires Nokogiri.') + $stderr.puts(<<ERROR) if bundler? +Please add + + gem 'nokogiri' + +to the Gemfile, run + + bundle install + +and try again. +ERROR + exit 1 +end + require 'rails_guides/markdown' require "rails_guides/generator" RailsGuides::Generator.new.generate |