Multisite:migrate fails with rails 4


(Zvika Rap) #1

ActiveRecord::Base::ConnectionSpecification was moved somewhere else in rails 4.
I tried fixing it some time ago, but the all multisite plugin is not compatible wit rails 4.
Right now I am stack with rails 3 because I am running multisite discourse.

Here is the failure stack trace. I am using latest commit from master:

discourse@xxxxxxx:/var/www/discourse$ RUBY_GC_MALLOC_LIMIT=90000000 RAILS_ENV=production RAILS4=1 bundle exec rake multisite:migrate
Booting in Rails 4 mode
Booting in Rails 4 mode
DEPRECATION WARNING: Model based mass assignment security has been extracted
out of Rails into a gem. Please use the new recommended protection model for
params or add `protected_attributes` to your Gemfile to use the old one.

To disable this message remove the `whitelist_attributes` option from your
`config/application.rb` file and any `mass_assignment_sanitizer` options
from your `config/environments/*.rb` files.

See http://guides.rubyonrails.org/security.html#mass-assignment for more information.
 
rake aborted!
uninitialized constant ActiveRecord::Base::ConnectionSpecification
/var/www/discourse/vendor/gems/rails_multisite/lib/rails_multisite/connection_management.rb:78:in `block in load_settings!'
/var/www/discourse/vendor/gems/rails_multisite/lib/rails_multisite/connection_management.rb:77:in `each'
/var/www/discourse/vendor/gems/rails_multisite/lib/rails_multisite/connection_management.rb:77:in `map'
/var/www/discourse/vendor/gems/rails_multisite/lib/rails_multisite/connection_management.rb:77:in `load_settings!'
/var/www/discourse/vendor/gems/rails_multisite/lib/rails_multisite/railtie.rb:9:in `block in <class:Railtie>'
/home/discourse/.rvm/gems/ruby-2.0.0-p247/bundler/gems/rails-7b2f64fca71c/railties/lib/rails/initializable.rb:30:in `instance_exec'
/home/discourse/.rvm/gems/ruby-2.0.0-p247/bundler/gems/rails-7b2f64fca71c/railties/lib/rails/initializable.rb:30:in `run'
/home/discourse/.rvm/gems/ruby-2.0.0-p247/bundler/gems/rails-7b2f64fca71c/railties/lib/rails/initializable.rb:55:in `block in run_initializers'
/home/discourse/.rvm/gems/ruby-2.0.0-p247/bundler/gems/rails-7b2f64fca71c/railties/lib/rails/initializable.rb:54:in `run_initializers'
/home/discourse/.rvm/gems/ruby-2.0.0-p247/bundler/gems/rails-7b2f64fca71c/railties/lib/rails/application.rb:215:in `initialize!'
/home/discourse/.rvm/gems/ruby-2.0.0-p247/bundler/gems/rails-7b2f64fca71c/railties/lib/rails/railtie/configurable.rb:30:in `method_missing'
/var/www/discourse/config/environment.rb:5:in `<top (required)>'
/home/discourse/.rvm/gems/ruby-2.0.0-p247/bundler/gems/rails-7b2f64fca71c/railties/lib/rails/application.rb:189:in `require_environment!'
/home/discourse/.rvm/gems/ruby-2.0.0-p247/bundler/gems/rails-7b2f64fca71c/railties/lib/rails/application.rb:250:in `block in run_tasks_blocks'
/home/discourse/.rvm/gems/ruby-2.0.0-p247/bin/ruby_executable_hooks:15:in `eval'
/home/discourse/.rvm/gems/ruby-2.0.0-p247/bin/ruby_executable_hooks:15:in `<main>'
Tasks: TOP => multisite:migrate => environment
(See full trace by running task with --trace)

discourse@xxxxxx:/var/www/discourse$ RUBY_GC_MALLOC_LIMIT=90000000 RAILS_ENV=production RAILS4=1 bundle exec rake db:migrate
Booting in Rails 4 mode
Booting in Rails 4 mode
DEPRECATION WARNING: Model based mass assignment security has been extracted
out of Rails into a gem. Please use the new recommended protection model for
params or add `protected_attributes` to your Gemfile to use the old one.

To disable this message remove the `whitelist_attributes` option from your
`config/application.rb` file and any `mass_assignment_sanitizer` options
from your `config/environments/*.rb` files.

See http://guides.rubyonrails.org/security.html#mass-assignment for more information.
 
rake aborted!
uninitialized constant ActiveRecord::Base::ConnectionSpecification
/var/www/discourse/vendor/gems/rails_multisite/lib/rails_multisite/connection_management.rb:78:in `block in load_settings!'
/var/www/discourse/vendor/gems/rails_multisite/lib/rails_multisite/connection_management.rb:77:in `each'
/var/www/discourse/vendor/gems/rails_multisite/lib/rails_multisite/connection_management.rb:77:in `map'
/var/www/discourse/vendor/gems/rails_multisite/lib/rails_multisite/connection_management.rb:77:in `load_settings!'
/var/www/discourse/vendor/gems/rails_multisite/lib/rails_multisite/railtie.rb:9:in `block in <class:Railtie>'
/home/discourse/.rvm/gems/ruby-2.0.0-p247/bundler/gems/rails-7b2f64fca71c/railties/lib/rails/initializable.rb:30:in `instance_exec'
/home/discourse/.rvm/gems/ruby-2.0.0-p247/bundler/gems/rails-7b2f64fca71c/railties/lib/rails/initializable.rb:30:in `run'
/home/discourse/.rvm/gems/ruby-2.0.0-p247/bundler/gems/rails-7b2f64fca71c/railties/lib/rails/initializable.rb:55:in `block in run_initializers'
/home/discourse/.rvm/gems/ruby-2.0.0-p247/bundler/gems/rails-7b2f64fca71c/railties/lib/rails/initializable.rb:54:in `run_initializers'
/home/discourse/.rvm/gems/ruby-2.0.0-p247/bundler/gems/rails-7b2f64fca71c/railties/lib/rails/application.rb:215:in `initialize!'
/home/discourse/.rvm/gems/ruby-2.0.0-p247/bundler/gems/rails-7b2f64fca71c/railties/lib/rails/railtie/configurable.rb:30:in `method_missing'
/var/www/discourse/config/environment.rb:5:in `<top (required)>'
/home/discourse/.rvm/gems/ruby-2.0.0-p247/bundler/gems/rails-7b2f64fca71c/railties/lib/rails/application.rb:189:in `require_environment!'
/home/discourse/.rvm/gems/ruby-2.0.0-p247/bundler/gems/rails-7b2f64fca71c/railties/lib/rails/application.rb:250:in `block in run_tasks_blocks'
/home/discourse/.rvm/gems/ruby-2.0.0-p247/bin/ruby_executable_hooks:15:in `eval'
/home/discourse/.rvm/gems/ruby-2.0.0-p247/bin/ruby_executable_hooks:15:in `<main>'
Tasks: TOP => db:migrate => environment
(See full trace by running task with --trace)

(Akshar Prabhudesai) #2

I too started seeing this.


(Sam Saffron) #3

On it, it will be fixed shortly


(Sam Saffron) #4

Should be fixed with:


(Sam Saffron) #5

Note, there is a perf regression here I am working on fixing. In particular multisite in Rails 4 is not caching schema properly, leading to excessive querying. This issue only affects Rails 4 + multisite.


(Sam Saffron) #6

This topic was automatically closed after 6 days. New replies are no longer allowed.