Skip to content
This repository
Browse code

Merge pull request #11973 from prathamesh-sonpatki/nokogiri-warning

Add error message for including nokogiri in Gemfile for rake doc:guides
  • Loading branch information...
commit 26ad789050f3b4b25ca544baab886b47fc3e7aa8 1 parent 5608c90
Yves Senn authored August 26, 2013

Showing 1 changed file with 19 additions and 0 deletions. Show diff stats Hide diff stats

  1. 19  guides/rails_guides.rb
19  guides/rails_guides.rb
@@ -39,6 +39,25 @@ def bundler?
39 39
   exit 1
40 40
 end
41 41
 
  42
+begin
  43
+  require 'nokogiri'
  44
+rescue LoadError
  45
+  # This can happen if doc:guides is executed in an application.
  46
+  $stderr.puts('Generating guides requires Nokogiri.')
  47
+  $stderr.puts(<<ERROR) if bundler?
  48
+Please add
  49
+
  50
+  gem 'nokogiri'
  51
+
  52
+to the Gemfile, run
  53
+
  54
+  bundle install
  55
+
  56
+and try again.
  57
+ERROR
  58
+  exit 1
  59
+end
  60
+
42 61
 require 'rails_guides/markdown'
43 62
 require "rails_guides/generator"
44 63
 RailsGuides::Generator.new.generate

0 notes on commit 26ad789

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