Giter Site home page Giter Site logo

Database setup about bookyt HOT 5 CLOSED

harman052 avatar harman052 commented on May 17, 2024
Database setup

from bookyt.

Comments (5)

huerlisi avatar huerlisi commented on May 17, 2024

Hi there

Did the 'bundle exec rake db:setup' command work? If yes, the database is initialized and tables are created.

If not, here's some background: 'rake db:setup' does create the mysql databases according to 'database.yml' you created out of 'database.yml.example'. It should ask you for the root password for your mysql server to create the databases. This function is provided by Rails and we just use that for Bookyt. It does not always work if there's more than one database is configured in database.yml (like production, test, development) with the same username.

So here's a recipe that should probably get you a working DB setup if you used a more or less verbatim copy of database.yml.example:

  • Drop the databases that got created: mysqladmin -u root -p drop bookyt_production; mysqladmin -u root -p drop bookyt_development
  • Change database.yml: remove the section for 'production', change the username value for test to bookyt_test, set some passwords
  • Run bundle exec rake db:setup and enter your DB root password when you're asked (you'll be asked twice).

It that fails, please post the output of the last step here, preferable using a gist.

Cheers
Simon

from bookyt.

harman052 avatar harman052 commented on May 17, 2024

Please check the following gist to look into the problem.
https://gist.github.com/harman052/5648734

Harman

from bookyt.

huerlisi avatar huerlisi commented on May 17, 2024

(Did comment on the gist long time ago, but I'll re-post here as I'm not sure it reached you, @harman052)

You need to keep both a test and a development section. They should both have a different user name and database name to get db:create (which is called by db:setup) working properly.

The reason there are no tables in the test db is that it failed to do the db:create properly. db:setup actually calls the following tasks: db:create (create databases), db:schema:load (to build the tables), and db:seed (to add some seed data from db/seeds.rb. So when db:create fails (because there is no development section), the other tasks are not run.

from bookyt.

huerlisi avatar huerlisi commented on May 17, 2024

@harman052 okay to close? Or do you need some support?

from bookyt.

harman052 avatar harman052 commented on May 17, 2024

On Wed, Jun 26, 2013 at 12:44 AM, Simon Hürlimann
[email protected]:

@harman052 https://github.com/harman052 okay to close? Or do you need
some support?

Thanks for your assistance. But actually I am busy with my work so is
unable to act upon your recent emails. You can close but I will only be

able to check it after September.

Harmanpreet Singh
Blog: http://singhharman.wordpress.com/

from bookyt.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.