Ruby on Rails - Sqlite3 -


i new both ror , sqlite; pardon lack of knowledge.

i ran scaffold command:

rails generate scaffold user password:string email:string 

everything worked fine, next ran rake db:migrate command, terminal suggested created.

now opened new terminal , wanted verify table created, hit sqlite3 on terminal , ran .tables command, shows null value.

so time ran sqlite3 db/development.sqlite3 command , hit .tables it said unable open database file

next tried sqlite3 development.sqlite3 , hit .tables command , no results shown.

i not understand doing wrong? , unable find decent tutorial walks 1 through this. please help.

here .yml file:

default: &default   adapter: sqlite3   pool: 5   timeout: 5000  development:   <<: *default   database: db/development.sqlite3   test:   <<: *default   database: db/test.sqlite3  production:   <<: *default   database: db/production.sqlite3" 

when done from-scratch, sequence of actions produces expected results:

sqlite version 3.8.2 2013-12-06 14:53:30 enter ".help" instructions enter sql statements terminated ";" sqlite> .tables schema_migrations  users 

so problems specific database. likely, file corrupted. there many reasons why happen, , easiest workaround (if data in file not important) wipe database file , recreate it:

rm db/development.sqlite3 rake db:create db:migrate 

Comments

Popular posts from this blog

powershell Start-Process exit code -1073741502 when used with Credential from a windows service environment -

twig - Using Twigbridge in a Laravel 5.1 Package -

c# - LINQ join Entities from HashSet's, Join vs Dictionary vs HashSet performance -