aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYves Senn <yves.senn@gmail.com>2013-08-26 03:20:48 -0700
committerYves Senn <yves.senn@gmail.com>2013-08-26 03:20:48 -0700
commit55c9109b5a4e5018973d3f9856d0ba15123ae3a9 (patch)
tree0c8fd2ae9f0c29f8b42402aaf37e08aa1e9d014b
parentc19958015fac7b50f8dedbdf17991c00d6b8bbd4 (diff)
parent2c02fc3fd7181ab1cc39b0426491a830e0c52d5a (diff)
downloadrails-55c9109b5a4e5018973d3f9856d0ba15123ae3a9.tar.gz
rails-55c9109b5a4e5018973d3f9856d0ba15123ae3a9.tar.bz2
rails-55c9109b5a4e5018973d3f9856d0ba15123ae3a9.zip
Merge pull request #11973 from prathamesh-sonpatki/nokogiri-warning
Add error message for including nokogiri in Gemfile for rake doc:guides
-rw-r--r--guides/rails_guides.rb19
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