work around "rake db:create:all" error on JRuby SQLite3

<pre>
$ bundle exec rake ci --trace
...
rake aborted!
stack level too deep
/home/xxxx/.rvm/gems/jruby-1.7.4/gems/activerecord-3.2.15/lib/active_record/railties/databases.rake:184:in `local_database?'
/home/xxxx/.rvm/gems/jruby-1.7.4/gems/activerecord-3.2.15/lib/active_record/railties/databases.rake:52:in `(root)'
org/jruby/RubyHash.java:1375:in `each_value'
/home/xxxx/.rvm/gems/jruby-1.7.4/gems/activerecord-3.2.15/lib/active_record/railties/databases.rake:38:in `(root)'
</pre>

git-svn-id: http://svn.redmine.org/redmine/trunk@12256 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Toshi MARUYAMA 2013-11-10 00:19:17 +00:00
parent 303fdc2913
commit 882c4495c0
1 changed files with 4 additions and 1 deletions

View File

@ -13,7 +13,10 @@ namespace :ci do
task :setup do task :setup do
Rake::Task["tmp:clear"].invoke Rake::Task["tmp:clear"].invoke
Rake::Task["log:clear"].invoke Rake::Task["log:clear"].invoke
database = ENV['DATABASE_ADAPTER']
unless Object.const_defined?(:JRUBY_VERSION) && database =~ /sqlite3/
Rake::Task["db:create:all"].invoke Rake::Task["db:create:all"].invoke
end
Rake::Task["db:migrate"].invoke Rake::Task["db:migrate"].invoke
Rake::Task["db:schema:dump"].invoke Rake::Task["db:schema:dump"].invoke
Rake::Task["test:scm:setup:all"].invoke Rake::Task["test:scm:setup:all"].invoke