How to run an import script in Docker?


(Bohuslav Svancara) #1

Hello,

I am converting our proprietal forum to Discourse.
I was able to migrate everything on my desktop using Discourse instance running via Vagrant.
It looks really good!
Now, I need to run my script on the server where Discourse is running in Docker.
I am a Windows guy and I am desperate. It seems I need some black magic. :frowning:
I have my import script “collective2.rb” in /var/www/discourse/script/import_scripts
I have my data in /tmp/c2data.
So far so good.

Now, I am in Docker after ./launcher enter app

I am doing:

cd /var/www/discourse/

ruby script/import_scripts/collective2.rb

-bash: ruby: command not found

What now please?

How to run my import script please?


Backup and restore SQL error
(Jeff Atwood) #2

Did you check the how to category here? I believe @techapj wrote a how to on this topic.


(Bohuslav Svancara) #3

Thanks Jeff, but I can’t find a solution there.

I should probably mention that I am running Discourse on Amazon AWS.
I am starting to think that that is the problem.
I installed Dicourse using this instructions:
http://www.howtoinstalldiscourse.com/how-to-setup-an-amazon-ec2-instance-to-host-discourse-for-free-manual-install/

There is probably something missing there.

Ruby does not exist in Docker:

root@ip-10-0-0-158-app:/var/www/discourse# ruby --help
-bash: ruby: command not found

But it is not alone! For example yum does not exist there too!

root@ip-10-0-0-158-app:/var/www/discourse# yum
-bash: yum: command not found

How can I run a software which is installed in host inside a Docker?

Thank you.


(James Milligan) #4

@Svancara it looks like you’re not actually in the Docker container. If Discourse is running, Ruby is definitely installed! In the Discourse directory (which is usually /var/discourse, not /var/www/discourse), use ./launcher enter app (or ./launcher ssh app) to get into the container itself.

Yum is unavailable because you’re (probably) running Ubuntu or similar. Swap yum for apt-get and you should get there.

Also worth noting that that site is not affiliated with Discourse, have a look at the official documentation here.


(Bohuslav Svancara) #5

I am sure I am in Docker.

/var/discourse exists in host and it includes just the “shared” folder

The /var/www/discourse folder exists only in Docker.

Yum exist in the host.

I will tell my boss to use Digital Ocean.

Thank you.


(Jeff Atwood) #6

As long as you follow our install guide you can be on Amazon.

Just stop reading on their site where it says “install Discourse” and use our install guide instead. I strongly recommend you use Ubuntu Server 14.04 lts as the base OS and not CentOS as their guide specifies, though.


(Bohuslav Svancara) #7

Thank you.
I installed it per your suggestion using Ubuntu.
Discourse is running, but my import script is not.

The first visible problem - I think - is that your development Vagrant installs Ruby 1.9.3 and the Docker is running
ruby 2.0.0p576 (2014-09-19 revision 47628) [x86_64-linux]

I have a series of ‘incompatibility’ errors.
My script includes:

require 'xmlsimple'
require 'active_support/all'

Which was missing in Docker.
So I installed
gem install activesupport
gem install xml-simple

Then:

root@ip-10-0-0-186-app:/var/www/discourse# ruby script/import_scripts/collective2.rb
/usr/local/lib/ruby/gems/2.0.0/gems/bundler-1.7.4/lib/bundler/runtime.rb:34:in `block in setup': You have already activated json 1.7.7, but your Gemfile requires json 1.8.1. Prepending `bundle exec` to your command may solve this. 

So I installed:

gem install json

Now:

root@ip-10-0-0-186-app:/var/www/discourse# ruby script/import_scripts/collective2.rb
WARN: Unresolved specs during Gem::Specification.reset:
      json (>= 1.7.7, ~> 1.7)
WARN: Clearing out unresolved specs.
Please report a bug if this causes problems.
/usr/local/lib/ruby/gems/2.0.0/gems/bundler-1.7.4/lib/bundler/runtime.rb:34:in `block in setup': You have already activated minitest 5.4.2, but your Gemfile requires minitest 5.4.1. Prepending `bundle exec` to your command may solve this. (Gem::LoadError)

And I am lost.

I installed
gem install minitest

but have the same reusult.

/usr/local/lib/ruby/gems/2.0.0/gems/bundler-1.7.4/lib/bundler/runtime.rb:34:in `block in setup': You have already activated minitest 5.4.2, but your Gemfile requires minitest 5.4.1. Prepending `bundle exec` to your command may solve this. (Gem::LoadError)

Prepending bundle exec does not solve it:

root@ip-10-0-0-186-app:/var/www/discourse# bundle exec ruby script/import_scripts/collective2.rb
/var/www/discourse/script/import_scripts/c2DataReader.rb:5:in `require': cannot load such file -- xmlsimple (LoadError)
        from /var/www/discourse/script/import_scripts/c2DataReader.rb:5:in `<top (required)>'
        from script/import_scripts/collective2.rb:4:in `require'
        from script/import_scripts/collective2.rb:4:in `<main>'
root@ip-10-0-0-186-app:/var/www/discourse#

It means it wants xmlsimple which is already installed :frowning:

I have no idea where the “minitest” is required and how to solve that.

And I am afraid this will be not the end.

Can you help me please?

Thank you.

PS:
I should mention I am totally Ruby rookie. And my “mother development environment” is Windows.


(Bohuslav Svancara) #8

ok I learned something about gem and installed required minitest.

root@ip-10-0-0-186-app:/var/www/discourse# gem install minitest:5.4.1
Fetching: minitest-5.4.1.gem (100%)
Successfully installed minitest-5.4.1
1 gem installed
root@ip-10-0-0-186-app:/var/www/discourse# ruby script/import_scripts/collective2.rb
WARN: Unresolved specs during Gem::Specification.reset:
      json (>= 1.7.7, ~> 1.7)
      minitest (~> 5.1)
WARN: Clearing out unresolved specs.
Please report a bug if this causes problems.
/var/www/discourse/vendor/bundle/ruby/2.0.0/gems/activerecord-4.1.6/lib/active_record/connection_adapters/postgresql_adapter.rb:898:in `rescue in connect': FATAL:  role "root" does not exist (ActiveRecord::NoDatabaseError)
Run `$ bin/rake db:create db:migrate` to create your database
        from /var/www/discourse/vendor/bundle/ruby/2.0.0/gems/activerecord-4.1.6/lib/active_record/connection_adapters/postgresql_adapter.rb:888:in `connect'
        from /var/www/discourse/vendor/bundle/ruby/2.0.0/gems/activerecord-4.1.6/lib/active_record/connection_adapters/postgresql_adapter.rb:568:in `initialize'

ok. So

root@ip-10-0-0-186-app:/var/www/discourse# bin/rake db:create db:migrate
FATAL:  role "root" does not exist
/var/www/discourse/vendor/bundle/ruby/2.0.0/gems/activerecord-4.1.6/lib/active_record/connection_adapters/postgresql_adapter.rb:898:in `rescue in connect'
/var/www/discourse/vendor/bundle/ruby/2.0.0/gems/activerecord-4.1.6/lib/active_record/connection_adapters/postgresql_adapter.rb:888:in `connect'
/var/www/discourse/vendor/bundle/ruby/2.0.0/gems/activerecord-4.1.6/lib/active_record/connection_adapters/postgresql_adapter.rb:568:in `initialize'
/var/www/discourse/vendor/bundle/ruby/2.0.0/gems/activerecord-4.1.6/lib/active_record/connection_adapters/postgresql_adapter.rb:41:in `new'
/var/www/discourse/vendor/bundle/ruby/2.0.0/gems/activerecord-4.1.6/lib/active_record/connection_adapters/postgresql_adapter.rb:41:in `postgresql_connection'
/var/www/discourse/vendor/bundle/ruby/2.0.0/gems/activerecord-4.1.6/lib/active_record/connection_adapters/abstract/connection_pool.rb:435:in `new_connection'
/var/www/discourse/vendor/bundle/ruby/2.0.0/gems/activerecord-4.1.6/lib/active_record/connection_adapters/abstract/connection_pool.rb:445:in `checkout_new_connection'
/var/www/discourse/vendor/bundle/ruby/2.0.0/gems/activerecord-4.1.6/lib/active_record/connection_adapters/abstract/connection_pool.rb:416:in `acquire_connection'
/var/www/discourse/vendor/bundle/ruby/2.0.0/gems/activerecord-4.1.6/lib/active_record/connection_adapters/abstract/connection_pool.rb:351:in `block in checkout'
/usr/local/lib/ruby/2.0.0/monitor.rb:211:in `mon_synchronize'
/var/www/discourse/vendor/bundle/ruby/2.0.0/gems/activerecord-4.1.6/lib/active_record/connection_adapters/abstract/connection_pool.rb:350:in `checkout'
/var/www/discourse/vendor/bundle/ruby/2.0.0/gems/activerecord-4.1.6/lib/active_record/connection_adapters/abstract/connection_pool.rb:265:in `block in connection'
/usr/local/lib/ruby/2.0.0/monitor.rb:211:in `mon_synchronize'
/var/www/discourse/vendor/bundle/ruby/2.0.0/gems/activerecord-4.1.6/lib/active_record/connection_adapters/abstract/connection_pool.rb:264:in `connection'
/var/www/discourse/vendor/bundle/ruby/2.0.0/gems/activerecord-4.1.6/lib/active_record/connection_adapters/abstract/connection_pool.rb:541:in `retrieve_connection'
/var/www/discourse/vendor/bundle/ruby/2.0.0/gems/activerecord-4.1.6/lib/active_record/connection_handling.rb:113:in `retrieve_connection'
/var/www/discourse/vendor/bundle/ruby/2.0.0/gems/activerecord-4.1.6/lib/active_record/connection_handling.rb:87:in `connection'
/var/www/discourse/vendor/bundle/ruby/2.0.0/gems/activerecord-4.1.6/lib/active_record/tasks/postgresql_database_tasks.rb:8:in `connection'
/var/www/discourse/vendor/bundle/ruby/2.0.0/gems/activerecord-4.1.6/lib/active_record/tasks/postgresql_database_tasks.rb:17:in `create'
/var/www/discourse/vendor/bundle/ruby/2.0.0/gems/activerecord-4.1.6/lib/active_record/tasks/database_tasks.rb:88:in `create'
/var/www/discourse/vendor/bundle/ruby/2.0.0/gems/activerecord-4.1.6/lib/active_record/tasks/database_tasks.rb:102:in `block in create_current'
/var/www/discourse/vendor/bundle/ruby/2.0.0/gems/activerecord-4.1.6/lib/active_record/tasks/database_tasks.rb:209:in `block in each_current_configuration'
/var/www/discourse/vendor/bundle/ruby/2.0.0/gems/activerecord-4.1.6/lib/active_record/tasks/database_tasks.rb:208:in `each'
/var/www/discourse/vendor/bundle/ruby/2.0.0/gems/activerecord-4.1.6/lib/active_record/tasks/database_tasks.rb:208:in `each_current_configuration'
/var/www/discourse/vendor/bundle/ruby/2.0.0/gems/activerecord-4.1.6/lib/active_record/tasks/database_tasks.rb:101:in `create_current'
/var/www/discourse/vendor/bundle/ruby/2.0.0/gems/activerecord-4.1.6/lib/active_record/railties/databases.rake:17:in `block (2 levels) in <top (required)>'
/var/www/discourse/vendor/bundle/ruby/2.0.0/gems/rake-10.3.2/lib/rake/task.rb:240:in `call'
/var/www/discourse/vendor/bundle/ruby/2.0.0/gems/rake-10.3.2/lib/rake/task.rb:240:in `block in execute'
/var/www/discourse/vendor/bundle/ruby/2.0.0/gems/rake-10.3.2/lib/rake/task.rb:235:in `each'
/var/www/discourse/vendor/bundle/ruby/2.0.0/gems/rake-10.3.2/lib/rake/task.rb:235:in `execute'
/var/www/discourse/vendor/bundle/ruby/2.0.0/gems/rake-10.3.2/lib/rake/task.rb:179:in `block in invoke_with_call_chain'
/usr/local/lib/ruby/2.0.0/monitor.rb:211:in `mon_synchronize'
/var/www/discourse/vendor/bundle/ruby/2.0.0/gems/rake-10.3.2/lib/rake/task.rb:172:in `invoke_with_call_chain'
/var/www/discourse/vendor/bundle/ruby/2.0.0/gems/rake-10.3.2/lib/rake/task.rb:165:in `invoke'
/var/www/discourse/vendor/bundle/ruby/2.0.0/gems/rake-10.3.2/lib/rake/application.rb:150:in `invoke_task'
/var/www/discourse/vendor/bundle/ruby/2.0.0/gems/rake-10.3.2/lib/rake/application.rb:106:in `block (2 levels) in top_level'
/var/www/discourse/vendor/bundle/ruby/2.0.0/gems/rake-10.3.2/lib/rake/application.rb:106:in `each'
/var/www/discourse/vendor/bundle/ruby/2.0.0/gems/rake-10.3.2/lib/rake/application.rb:106:in `block in top_level'
/var/www/discourse/vendor/bundle/ruby/2.0.0/gems/rake-10.3.2/lib/rake/application.rb:115:in `run_with_threads'
/var/www/discourse/vendor/bundle/ruby/2.0.0/gems/rake-10.3.2/lib/rake/application.rb:100:in `top_level'
/var/www/discourse/vendor/bundle/ruby/2.0.0/gems/rake-10.3.2/lib/rake/application.rb:78:in `block in run'
/var/www/discourse/vendor/bundle/ruby/2.0.0/gems/rake-10.3.2/lib/rake/application.rb:176:in `standard_exception_handling'
/var/www/discourse/vendor/bundle/ruby/2.0.0/gems/rake-10.3.2/lib/rake/application.rb:75:in `run'
bin/rake:4:in `<main>'
Couldn't create database for {"adapter"=>"postgresql", "database"=>"discourse_development", "min_messages"=>"warning", "pool"=>5, "timeout"=>5000, "host_names"=>["localhost"]}
FATAL:  role "root" does not exist
/var/www/discourse/vendor/bundle/ruby/2.0.0/gems/activerecord-4.1.6/lib/active_record/connection_adapters/postgresql_adapter.rb:898:in `rescue in connect'
/var/www/discourse/vendor/bundle/ruby/2.0.0/gems/activerecord-4.1.6/lib/active_record/connection_adapters/postgresql_adapter.rb:888:in `connect'
/var/www/discourse/vendor/bundle/ruby/2.0.0/gems/activerecord-4.1.6/lib/active_record/connection_adapters/postgresql_adapter.rb:568:in `initialize'
/var/www/discourse/vendor/bundle/ruby/2.0.0/gems/activerecord-4.1.6/lib/active_record/connection_adapters/postgresql_adapter.rb:41:in `new'
/var/www/discourse/vendor/bundle/ruby/2.0.0/gems/activerecord-4.1.6/lib/active_record/connection_adapters/postgresql_adapter.rb:41:in `postgresql_connection'
/var/www/discourse/vendor/bundle/ruby/2.0.0/gems/activerecord-4.1.6/lib/active_record/connection_adapters/abstract/connection_pool.rb:435:in `new_connection'
/var/www/discourse/vendor/bundle/ruby/2.0.0/gems/activerecord-4.1.6/lib/active_record/connection_adapters/abstract/connection_pool.rb:445:in `checkout_new_connection'
/var/www/discourse/vendor/bundle/ruby/2.0.0/gems/activerecord-4.1.6/lib/active_record/connection_adapters/abstract/connection_pool.rb:416:in `acquire_connection'
/var/www/discourse/vendor/bundle/ruby/2.0.0/gems/activerecord-4.1.6/lib/active_record/connection_adapters/abstract/connection_pool.rb:351:in `block in checkout'
/usr/local/lib/ruby/2.0.0/monitor.rb:211:in `mon_synchronize'
/var/www/discourse/vendor/bundle/ruby/2.0.0/gems/activerecord-4.1.6/lib/active_record/connection_adapters/abstract/connection_pool.rb:350:in `checkout'
/var/www/discourse/vendor/bundle/ruby/2.0.0/gems/activerecord-4.1.6/lib/active_record/connection_adapters/abstract/connection_pool.rb:265:in `block in connection'
/usr/local/lib/ruby/2.0.0/monitor.rb:211:in `mon_synchronize'
/var/www/discourse/vendor/bundle/ruby/2.0.0/gems/activerecord-4.1.6/lib/active_record/connection_adapters/abstract/connection_pool.rb:264:in `connection'
/var/www/discourse/vendor/bundle/ruby/2.0.0/gems/activerecord-4.1.6/lib/active_record/connection_adapters/abstract/connection_pool.rb:541:in `retrieve_connection'
/var/www/discourse/vendor/bundle/ruby/2.0.0/gems/activerecord-4.1.6/lib/active_record/connection_handling.rb:113:in `retrieve_connection'
/var/www/discourse/vendor/bundle/ruby/2.0.0/gems/activerecord-4.1.6/lib/active_record/connection_handling.rb:87:in `connection'
/var/www/discourse/vendor/bundle/ruby/2.0.0/gems/activerecord-4.1.6/lib/active_record/tasks/postgresql_database_tasks.rb:8:in `connection'
/var/www/discourse/vendor/bundle/ruby/2.0.0/gems/activerecord-4.1.6/lib/active_record/tasks/postgresql_database_tasks.rb:17:in `create'
/var/www/discourse/vendor/bundle/ruby/2.0.0/gems/activerecord-4.1.6/lib/active_record/tasks/database_tasks.rb:88:in `create'
/var/www/discourse/vendor/bundle/ruby/2.0.0/gems/activerecord-4.1.6/lib/active_record/tasks/database_tasks.rb:102:in `block in create_current'
/var/www/discourse/vendor/bundle/ruby/2.0.0/gems/activerecord-4.1.6/lib/active_record/tasks/database_tasks.rb:209:in `block in each_current_configuration'
/var/www/discourse/vendor/bundle/ruby/2.0.0/gems/activerecord-4.1.6/lib/active_record/tasks/database_tasks.rb:208:in `each'
/var/www/discourse/vendor/bundle/ruby/2.0.0/gems/activerecord-4.1.6/lib/active_record/tasks/database_tasks.rb:208:in `each_current_configuration'
/var/www/discourse/vendor/bundle/ruby/2.0.0/gems/activerecord-4.1.6/lib/active_record/tasks/database_tasks.rb:101:in `create_current'
/var/www/discourse/vendor/bundle/ruby/2.0.0/gems/activerecord-4.1.6/lib/active_record/railties/databases.rake:17:in `block (2 levels) in <top (required)>'
/var/www/discourse/vendor/bundle/ruby/2.0.0/gems/rake-10.3.2/lib/rake/task.rb:240:in `call'
/var/www/discourse/vendor/bundle/ruby/2.0.0/gems/rake-10.3.2/lib/rake/task.rb:240:in `block in execute'
/var/www/discourse/vendor/bundle/ruby/2.0.0/gems/rake-10.3.2/lib/rake/task.rb:235:in `each'
/var/www/discourse/vendor/bundle/ruby/2.0.0/gems/rake-10.3.2/lib/rake/task.rb:235:in `execute'
/var/www/discourse/vendor/bundle/ruby/2.0.0/gems/rake-10.3.2/lib/rake/task.rb:179:in `block in invoke_with_call_chain'
/usr/local/lib/ruby/2.0.0/monitor.rb:211:in `mon_synchronize'
/var/www/discourse/vendor/bundle/ruby/2.0.0/gems/rake-10.3.2/lib/rake/task.rb:172:in `invoke_with_call_chain'
/var/www/discourse/vendor/bundle/ruby/2.0.0/gems/rake-10.3.2/lib/rake/task.rb:165:in `invoke'
/var/www/discourse/vendor/bundle/ruby/2.0.0/gems/rake-10.3.2/lib/rake/application.rb:150:in `invoke_task'
/var/www/discourse/vendor/bundle/ruby/2.0.0/gems/rake-10.3.2/lib/rake/application.rb:106:in `block (2 levels) in top_level'
/var/www/discourse/vendor/bundle/ruby/2.0.0/gems/rake-10.3.2/lib/rake/application.rb:106:in `each'
/var/www/discourse/vendor/bundle/ruby/2.0.0/gems/rake-10.3.2/lib/rake/application.rb:106:in `block in top_level'
/var/www/discourse/vendor/bundle/ruby/2.0.0/gems/rake-10.3.2/lib/rake/application.rb:115:in `run_with_threads'
/var/www/discourse/vendor/bundle/ruby/2.0.0/gems/rake-10.3.2/lib/rake/application.rb:100:in `top_level'
/var/www/discourse/vendor/bundle/ruby/2.0.0/gems/rake-10.3.2/lib/rake/application.rb:78:in `block in run'
/var/www/discourse/vendor/bundle/ruby/2.0.0/gems/rake-10.3.2/lib/rake/application.rb:176:in `standard_exception_handling'
/var/www/discourse/vendor/bundle/ruby/2.0.0/gems/rake-10.3.2/lib/rake/application.rb:75:in `run'
bin/rake:4:in `<main>'
Couldn't create database for {"adapter"=>"postgresql", "database"=>"discourse_test", "min_messages"=>"warning", "pool"=>5, "timeout"=>5000, "host_names"=>["test.localhost"]}
rake aborted!
ActiveRecord::NoDatabaseError: FATAL:  role "root" does not exist
Run `$ bin/rake db:create db:migrate` to create your database
/var/www/discourse/vendor/bundle/ruby/2.0.0/gems/activerecord-4.1.6/lib/active_record/connection_adapters/postgresql_adapter.rb:898:in `rescue in connect'
/var/www/discourse/vendor/bundle/ruby/2.0.0/gems/activerecord-4.1.6/lib/active_record/connection_adapters/postgresql_adapter.rb:888:in `connect'
/var/www/discourse/vendor/bundle/ruby/2.0.0/gems/activerecord-4.1.6/lib/active_record/connection_adapters/postgresql_adapter.rb:568:in `initialize'
/var/www/discourse/vendor/bundle/ruby/2.0.0/gems/activerecord-4.1.6/lib/active_record/connection_adapters/postgresql_adapter.rb:41:in `new'
/var/www/discourse/vendor/bundle/ruby/2.0.0/gems/activerecord-4.1.6/lib/active_record/connection_adapters/postgresql_adapter.rb:41:in `postgresql_connection'
/var/www/discourse/vendor/bundle/ruby/2.0.0/gems/activerecord-4.1.6/lib/active_record/connection_adapters/abstract/connection_pool.rb:435:in `new_connection'
/var/www/discourse/vendor/bundle/ruby/2.0.0/gems/activerecord-4.1.6/lib/active_record/connection_adapters/abstract/connection_pool.rb:445:in `checkout_new_connection'
/var/www/discourse/vendor/bundle/ruby/2.0.0/gems/activerecord-4.1.6/lib/active_record/connection_adapters/abstract/connection_pool.rb:416:in `acquire_connection'
/var/www/discourse/vendor/bundle/ruby/2.0.0/gems/activerecord-4.1.6/lib/active_record/connection_adapters/abstract/connection_pool.rb:351:in `block in checkout'
/var/www/discourse/vendor/bundle/ruby/2.0.0/gems/activerecord-4.1.6/lib/active_record/connection_adapters/abstract/connection_pool.rb:350:in `checkout'
/var/www/discourse/vendor/bundle/ruby/2.0.0/gems/activerecord-4.1.6/lib/active_record/connection_adapters/abstract/connection_pool.rb:265:in `block in connection'
/var/www/discourse/vendor/bundle/ruby/2.0.0/gems/activerecord-4.1.6/lib/active_record/connection_adapters/abstract/connection_pool.rb:264:in `connection'
/var/www/discourse/vendor/bundle/ruby/2.0.0/gems/activerecord-4.1.6/lib/active_record/connection_adapters/abstract/connection_pool.rb:541:in `retrieve_connection'
/var/www/discourse/vendor/bundle/ruby/2.0.0/gems/activerecord-4.1.6/lib/active_record/connection_handling.rb:113:in `retrieve_connection'
/var/www/discourse/vendor/bundle/ruby/2.0.0/gems/activerecord-4.1.6/lib/active_record/connection_handling.rb:87:in `connection'
/var/www/discourse/lib/site_settings/db_provider.rb:65:in `table_exists?'
/var/www/discourse/lib/site_settings/db_provider.rb:14:in `all'
/var/www/discourse/lib/site_setting_extension.rb:159:in `block in refresh!'
/var/www/discourse/lib/site_setting_extension.rb:155:in `synchronize'
/var/www/discourse/lib/site_setting_extension.rb:155:in `refresh!'
/var/www/discourse/config/initializers/05-site_settings.rb:4:in `block (2 levels) in <top (required)>'
/var/www/discourse/vendor/gems/rails_multisite/lib/rails_multisite/connection_management.rb:86:in `block in each_connection'
/var/www/discourse/vendor/gems/rails_multisite/lib/rails_multisite/connection_management.rb:84:in `each'
/var/www/discourse/vendor/gems/rails_multisite/lib/rails_multisite/connection_management.rb:84:in `each_connection'
/var/www/discourse/config/initializers/05-site_settings.rb:2:in `block in <top (required)>'
/var/www/discourse/config/initializers/05-site_settings.rb:15:in `call'
/var/www/discourse/config/initializers/05-site_settings.rb:15:in `block in <top (required)>'
/var/www/discourse/vendor/bundle/ruby/2.0.0/gems/activesupport-4.1.6/lib/active_support/callbacks.rb:438:in `instance_exec'
/var/www/discourse/vendor/bundle/ruby/2.0.0/gems/activesupport-4.1.6/lib/active_support/callbacks.rb:438:in `block in make_lambda'
/var/www/discourse/vendor/bundle/ruby/2.0.0/gems/activesupport-4.1.6/lib/active_support/callbacks.rb:184:in `call'
/var/www/discourse/vendor/bundle/ruby/2.0.0/gems/activesupport-4.1.6/lib/active_support/callbacks.rb:184:in `block in simple'
/var/www/discourse/vendor/bundle/ruby/2.0.0/gems/activesupport-4.1.6/lib/active_support/callbacks.rb:185:in `call'
/var/www/discourse/vendor/bundle/ruby/2.0.0/gems/activesupport-4.1.6/lib/active_support/callbacks.rb:185:in `block in simple'
/var/www/discourse/vendor/bundle/ruby/2.0.0/gems/activesupport-4.1.6/lib/active_support/callbacks.rb:86:in `call'
/var/www/discourse/vendor/bundle/ruby/2.0.0/gems/activesupport-4.1.6/lib/active_support/callbacks.rb:86:in `run_callbacks'
/var/www/discourse/vendor/bundle/ruby/2.0.0/gems/actionpack-4.1.6/lib/action_dispatch/middleware/reloader.rb:83:in `prepare!'
/var/www/discourse/vendor/bundle/ruby/2.0.0/gems/actionpack-4.1.6/lib/action_dispatch/middleware/reloader.rb:55:in `prepare!'
/var/www/discourse/vendor/bundle/ruby/2.0.0/gems/railties-4.1.6/lib/rails/application/finisher.rb:52:in `block in <module:Finisher>'
/var/www/discourse/vendor/bundle/ruby/2.0.0/gems/railties-4.1.6/lib/rails/initializable.rb:30:in `instance_exec'
/var/www/discourse/vendor/bundle/ruby/2.0.0/gems/railties-4.1.6/lib/rails/initializable.rb:30:in `run'
/var/www/discourse/vendor/bundle/ruby/2.0.0/gems/railties-4.1.6/lib/rails/initializable.rb:55:in `block in run_initializers'
/var/www/discourse/vendor/bundle/ruby/2.0.0/gems/railties-4.1.6/lib/rails/initializable.rb:54:in `run_initializers'
/var/www/discourse/vendor/bundle/ruby/2.0.0/gems/railties-4.1.6/lib/rails/application.rb:300:in `initialize!'
/var/www/discourse/vendor/bundle/ruby/2.0.0/gems/railties-4.1.6/lib/rails/railtie.rb:194:in `public_send'
/var/www/discourse/vendor/bundle/ruby/2.0.0/gems/railties-4.1.6/lib/rails/railtie.rb:194:in `method_missing'
/var/www/discourse/config/environment.rb:5:in `<top (required)>'
/var/www/discourse/vendor/bundle/ruby/2.0.0/gems/activesupport-4.1.6/lib/active_support/dependencies.rb:247:in `require'
/var/www/discourse/vendor/bundle/ruby/2.0.0/gems/activesupport-4.1.6/lib/active_support/dependencies.rb:247:in `block in require'
/var/www/discourse/vendor/bundle/ruby/2.0.0/gems/activesupport-4.1.6/lib/active_support/dependencies.rb:232:in `load_dependency'
/var/www/discourse/vendor/bundle/ruby/2.0.0/gems/activesupport-4.1.6/lib/active_support/dependencies.rb:247:in `require'
/var/www/discourse/vendor/bundle/ruby/2.0.0/gems/railties-4.1.6/lib/rails/application.rb:276:in `require_environment!'
/var/www/discourse/vendor/bundle/ruby/2.0.0/gems/railties-4.1.6/lib/rails/application.rb:389:in `block in run_tasks_blocks'
Tasks: TOP => db:migrate => environment
(See full trace by running task with --trace)
root@ip-10-0-0-186-app:/var/www/discourse#

(Ilya Kuchaev) #9

(Bohuslav Svancara) #10

THANK YOU!
It works now!