From 5d3d76039c60fa2fc02f233a7f6e42a56af75796 Mon Sep 17 00:00:00 2001 From: Adam McCrea Date: Tue, 9 Dec 2008 21:47:19 -0500 Subject: [PATCH] setup activerecord for local testing --- .../test/connections/native_mysql/connection.rb | 4 +++- 1 files changed, 3 insertions(+), 1 deletions(-) diff --git a/activerecord/test/connections/native_mysql/connection.rb b/activerecord/test/connections/native_mysql/connection.rb index 140e06d..d021dc3 100644 --- a/activerecord/test/connections/native_mysql/connection.rb +++ b/activerecord/test/connections/native_mysql/connection.rb @@ -13,11 +13,13 @@ ActiveRecord::Base.configurations = { :username => 'rails', :encoding => 'utf8', :database => 'activerecord_unittest', + :socket => '/tmp/mysql.sock' }, 'arunit2' => { :adapter => 'mysql', :username => 'rails', - :database => 'activerecord_unittest2' + :database => 'activerecord_unittest2', + :socket => '/tmp/mysql.sock' } } -- 1.6.0.4 From 0d2d96ef2e408dcc94b5990d80cb25dfc47375d8 Mon Sep 17 00:00:00 2001 From: Adam McCrea Date: Fri, 6 Feb 2009 10:10:58 -0500 Subject: [PATCH] always run initializers with rake:gems tasks --- railties/lib/initializer.rb | 15 +++++++-------- 1 files changed, 7 insertions(+), 8 deletions(-) diff --git a/railties/lib/initializer.rb b/railties/lib/initializer.rb index e3811dd..64f3403 100644 --- a/railties/lib/initializer.rb +++ b/railties/lib/initializer.rb @@ -298,12 +298,13 @@ module Rails end def check_gem_dependencies + @gems_dependencies_loaded = true unloaded_gems = @configuration.gems.reject { |g| g.loaded? } - if unloaded_gems.size > 0 + + # don't worry about missing gems if the gems rake tasks are being run + if unloaded_gems.any? && !$rails_rake_task @gems_dependencies_loaded = false - # don't print if the gems rake tasks are being run - unless $rails_rake_task - abort <<-end_error + abort <<-end_error Missing these required gems: #{unloaded_gems.map { |gem| "#{gem.name} #{gem.requirement}" } * "\n "} @@ -312,13 +313,11 @@ You're running: rubygems #{Gem::RubyGemsVersion} at #{Gem.path * ', '} Run `rake gems:install` to install the missing gems. - end_error - end - else - @gems_dependencies_loaded = true + end_error end end + # Loads all plugins in config.plugin_paths. plugin_paths # defaults to vendor/plugins but may also be set to a list of # paths, such as -- 1.6.0.4