aboutsummaryrefslogtreecommitdiffstats
path: root/railties/lib/rails/generators/base.rb
diff options
context:
space:
mode:
Diffstat (limited to 'railties/lib/rails/generators/base.rb')
-rw-r--r--railties/lib/rails/generators/base.rb12
1 files changed, 10 insertions, 2 deletions
diff --git a/railties/lib/rails/generators/base.rb b/railties/lib/rails/generators/base.rb
index 9624c35c0b..0da85ea4a4 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 /path/to/rails myapp --dev`"
+ exit
+end
+
require 'rails/generators/actions'
module Rails
@@ -17,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