Can't connect to database locally!

Hello fellow Sharetribers!

I am having trouble starting my server locally with rails s. It gives the error:
Cannot load ´Rails.application.database_configuration´: (RuntimeError) Could not load database configuration. No such file - ["config/database.yml"]

I noticed that the file was named database.docker.yml so I tried to do: cp config/database.docker.yml config/databse.yml.

After that I got another error saying:

Unknown MySQL server host 'mysql' (0) (Mysql2::Error)

  • The gem "mysql2", "~> 0.4.4" is in the Gemfile.
  • I can connect to MySQL with mysql -u root

The database.yml looks as follows:
development: adapter: mysql2 database: sharetribe_development encoding: utf8 username: sharetribe password: secret host: mysql

Tried using bundle exec foreman -f Procfile.hot.
Results in: Server JS bundle missing after waiting for 30 seconds: 'app/assets/webpack/server-bundle.js'

NOTE
I’m a total noob on working with Sharetribe.

I appreciate all the help I can get and I’m more than open to the suggestion of taking this over Skype, to save you and me some time, instead of discussing it here. Skype ID: o.lindqvist
Later I will post the resolution in the thread for future reference.

Cheers!

1 Like

Have a look at the installation instructions and follow the steps carefully: https://github.com/sharetribe/sharetribe#setting-up-the-development-environment

The 4. step is important. In that step you’ll create the database.yml file:

4. Create a database.yml file by copying the example database configuration:

cp config/database.example.yml config/database.yml

After that step, the step 5 instructs you to edit the file to match your own MySQL configurations.

I hope this helps!

1 Like

Hi rap1ds,

Thank you for your reply!

Is there some standard configuration that I can use?
I’m not sure how my MySQL is configured…

Cheers,