aboutsummaryrefslogtreecommitdiffstats
path: root/railties/lib/initializer.rb
diff options
context:
space:
mode:
Diffstat (limited to 'railties/lib/initializer.rb')
-rw-r--r--railties/lib/initializer.rb21
1 files changed, 21 insertions, 0 deletions
diff --git a/railties/lib/initializer.rb b/railties/lib/initializer.rb
index 1bd7baed62..71366a4480 100644
--- a/railties/lib/initializer.rb
+++ b/railties/lib/initializer.rb
@@ -156,6 +156,8 @@ module Rails
add_support_load_paths
+ check_for_unbuilt_gems
+
load_gems
load_plugins
@@ -308,6 +310,25 @@ module Rails
end
end
+ def check_for_unbuilt_gems
+ unbuilt_gems = @configuration.gems.select(&:frozen?).reject(&:built?)
+ if unbuilt_gems.size > 0
+ # don't print if the gems:build rake tasks are being run
+ unless $gems_build_rake_task
+ abort <<-end_error
+The following gems have native components that need to be built
+ #{unbuilt_gems.map { |gem| "#{gem.name} #{gem.requirement}" } * "\n "}
+
+You're running:
+ ruby #{Gem.ruby_version} at #{Gem.ruby}
+ rubygems #{Gem::RubyGemsVersion} at #{Gem.path * ', '}
+
+Run `rake gems:build` to build the unbuilt gems.
+ end_error
+ end
+ end
+ end
+
def check_gem_dependencies
unloaded_gems = @configuration.gems.reject { |g| g.loaded? }
if unloaded_gems.size > 0