Unable to create a sqlite database



I am new to Cloud9 and just created a new Ruby On Rails workspace. I need a new SQLITE database but it seems something is going wrong. These are the steps I am following:

  • In bash prompt, I type sqlite3 db_test.db and get sqlite> prompt
  • I type .databases and get the following information:

seq name file

0 main /home/ubuntu/workspace/db/db_test.db

  • I can see the entry “db_test.db” in db folder.
  • I type .exit and get back to bash $ prompt.
  • I open database.yml file and replace the database: entries with database: db/db_test.db for development, test and production.
  • I type sqlite3 again
  • I type .databases but this time nothing appears:

seq name file

0 main

I will very much appreciate your feedback.

I, in fact, followed the example here: Setting Up SQLite and everything works fine until I .exit. If I type sqlite3 again and try to see the tables content, I get a message saying that such tables do not exist.

Jorge Maldonado


It seems I found the problem.
After creating the database and tables, I inserted some test data and .exit to get the bash $ prompt.
When going back to the database, I only typed sqlite3 without a database name so I tried sqlite3 db_test.db everytime I want to do something to this DB and now I get information when typing .databases and also when issuing a SELECT command to get my test data.

Anyway, I would like to hear from you just to confirm this is the correct solution.

Best regards.