From d03af48a7d215e121e57a5621c0c57a834f473a1 Mon Sep 17 00:00:00 2001 From: wycats Date: Mon, 22 Mar 2010 14:08:50 -0700 Subject: Provide a better error if thor is missing --- railties/lib/rails/generators/base.rb | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'railties/lib/rails/generators/base.rb') diff --git a/railties/lib/rails/generators/base.rb b/railties/lib/rails/generators/base.rb index 9624c35c0b..27e8d8483d 100644 --- a/railties/lib/rails/generators/base.rb +++ b/railties/lib/rails/generators/base.rb @@ -1,4 +1,12 @@ -require 'thor/group' +begin + require 'thor/group' +rescue LoadError + puts "Thor is not available.\nIf you ran this command from a git checkout " \ + "of Rails, please make sure thor is installed,\nand run this command " \ + "as `ruby -rubygems /path/to/rails myapp --dev`" + exit +end + require 'rails/generators/actions' module Rails -- cgit v1.2.3 From 0b16c7602dee2aafc95017c72152564ef84ae29a Mon Sep 17 00:00:00 2001 From: wycats Date: Mon, 22 Mar 2010 14:17:49 -0700 Subject: No -rubygems needed --- railties/lib/rails/generators/base.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'railties/lib/rails/generators/base.rb') diff --git a/railties/lib/rails/generators/base.rb b/railties/lib/rails/generators/base.rb index 27e8d8483d..dbc759fbe5 100644 --- a/railties/lib/rails/generators/base.rb +++ b/railties/lib/rails/generators/base.rb @@ -3,7 +3,7 @@ begin rescue LoadError puts "Thor is not available.\nIf you ran this command from a git checkout " \ "of Rails, please make sure thor is installed,\nand run this command " \ - "as `ruby -rubygems /path/to/rails myapp --dev`" + "as `ruby /path/to/rails myapp --dev`" exit end -- cgit v1.2.3 From b61f6f59805eec4f5bb873a85910c9fe00e839a9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Valim?= Date: Tue, 23 Mar 2010 13:40:19 +0100 Subject: Load generators from both lib/rails/generators and lib/generators. Using the former since it's less obstrusive. --- railties/lib/rails/generators/base.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'railties/lib/rails/generators/base.rb') diff --git a/railties/lib/rails/generators/base.rb b/railties/lib/rails/generators/base.rb index dbc759fbe5..0da85ea4a4 100644 --- a/railties/lib/rails/generators/base.rb +++ b/railties/lib/rails/generators/base.rb @@ -25,7 +25,7 @@ module Rails def self.source_root @_rails_source_root ||= begin if base_name && generator_name - File.expand_path(File.join("../../generators", base_name, generator_name, 'templates'), File.dirname(__FILE__)) + File.expand_path(File.join(base_name, generator_name, 'templates'), File.dirname(__FILE__)) end end end -- cgit v1.2.3