Hello guys, I''ve made a very simple application following the footsteps of http://guides.rubyonrails.org/getting_started.html. I managed to insert my objects (i checked the existence of inserted objects through the rails console with a simple Foo.all ) but if I run sqlite3 from command line and then run .databases I can''t see any database created. I thought I could see the databases set in my database.yml ( database: db/development.sqlite3 database: db/test.sqlite3 database: db/ production.sqlite3 ) but the .databases command shows nothing. sqlite3 --version 3.5.6 rails -v 3.0.5 O.S. Windows 7 Thank you Federico -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
On Tue, Apr 19, 2011 at 4:27 PM, Federico <federico.rota01-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Hello guys, > I''ve made a very simple application following the footsteps of > http://guides.rubyonrails.org/getting_started.html. > I managed to insert my objects (i checked the existence of inserted > objects through the rails console with a simple Foo.all ) but if I run > sqlite3 from command line and then run .databases I can''t see any > database created. > I thought I could see the databases set in my database.yml ( database: > db/development.sqlite3 database: db/test.sqlite3 database: db/ > production.sqlite3 ) but the .databases command shows nothing. > > sqlite3 --version > 3.5.6 > rails -v > 3.0.5 > O.S. Windows 7 > >You don''t see any of the databases you expected to see. What do you see when you run .databases? B. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Well, when I run .databases i see something like an empty grid clearly indicating that there is no database. I think i should see my rails'' databases (the ones resulting populated from rails console as i said before). This is the first time i use sqlite but i think the command is right. I don''t think i have 2 different instances of sqlite installed (one used by rails and another one where i use the .databases command). I can''t understand where is my sqlite database populated via rails and how can i verify my tables via sqlite console queries. Thanks again Il giorno 20/apr/2011, alle ore 16:09, Bryan Crossland <bacrossland@gmail.com> ha scritto:> On Tue, Apr 19, 2011 at 4:27 PM, Federico <federico.rota01-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > Hello guys, > I''ve made a very simple application following the footsteps of > http://guides.rubyonrails.org/getting_started.html. > I managed to insert my objects (i checked the existence of inserted > objects through the rails console with a simple Foo.all ) but if I run > sqlite3 from command line and then run .databases I can''t see any > database created. > I thought I could see the databases set in my database.yml ( database: > db/development.sqlite3 database: db/test.sqlite3 database: db/ > production.sqlite3 ) but the .databases command shows nothing. > > sqlite3 --version > 3.5.6 > rails -v > 3.0.5 > O.S. Windows 7 > > > You don''t see any of the databases you expected to see. What do you see when you run .databases? > > B. > -- > You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. > To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. > For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.-- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
On Apr 20, 2011, at 3:17 PM, Federico Rota wrote:> Well, when I run .databases i see something like an empty grid > clearly indicating that there is no database. > I think i should see my rails'' databases (the ones resulting > populated from rails console as i said before). > This is the first time i use sqlite but i think the command is right. > I don''t think i have 2 different instances of sqlite installed (one > used by rails and another one where i use the .databases command). I > can''t understand where is my sqlite database populated via rails and > how can i verify my tables via sqlite console queries. > > Thanks againTry rails dbconsole or script/dbconsole (not sure which for whatever version you are using) for the abstracted view of your Rails database. This also responds to the development (default) production and test keywords to select a specific database. This may also be a clue -- are you looking for the development database but finding production or test? Walter> > Il giorno 20/apr/2011, alle ore 16:09, Bryan Crossland <bacrossland-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org > > ha scritto: > >> On Tue, Apr 19, 2011 at 4:27 PM, Federico >> <federico.rota01-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: >> Hello guys, >> I''ve made a very simple application following the footsteps of >> http://guides.rubyonrails.org/getting_started.html. >> I managed to insert my objects (i checked the existence of inserted >> objects through the rails console with a simple Foo.all ) but if I >> run >> sqlite3 from command line and then run .databases I can''t see any >> database created. >> I thought I could see the databases set in my database.yml >> ( database: >> db/development.sqlite3 database: db/test.sqlite3 database: db/ >> production.sqlite3 ) but the .databases command shows nothing. >> >> sqlite3 --version >> 3.5.6 >> rails -v >> 3.0.5 >> O.S. Windows 7 >> >> >> You don''t see any of the databases you expected to see. What do you >> see when you run .databases? >> >> B. >> >> -- >> You received this message because you are subscribed to the Google >> Groups "Ruby on Rails: Talk" group. >> To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org >> . >> To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org >> . >> For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en >> . > > > -- > You received this message because you are subscribed to the Google > Groups "Ruby on Rails: Talk" group. > To post to this group, send email to rubyonrails- > talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org > . > For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en > .-- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
On 20 Apr 2011, at 20:17, Federico Rota <federico.rota01-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Well, when I run .databases i see something like an empty grid clearly indicating that there is no database. > I think i should see my rails'' databases (the ones resulting populated from rails console as i said before).You misunderstand what .databases does. It lists all attached databases, not all the databases that exist (since a database is just a file anywhere on disk). If you just run sqlite3 there are no attached databases. If you run sqlite3 path/to/something.sqlite3 then it will attempt to load that database, you can also attach extra databases with the attach database command Fred> This is the first time i use sqlite but i think the command is right. > I don''t think i have 2 different instances of sqlite installed (one used by rails and another one where i use the .databases command). I can''t understand where is my sqlite database populated via rails and how can i verify my tables via sqlite console queries. > > Thanks again > > Il giorno 20/apr/2011, alle ore 16:09, Bryan Crossland <bacrossland@gmail.com> ha scritto: > >> On Tue, Apr 19, 2011 at 4:27 PM, Federico <federico.rota01-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: >> Hello guys, >> I''ve made a very simple application following the footsteps of >> http://guides.rubyonrails.org/getting_started.html. >> I managed to insert my objects (i checked the existence of inserted >> objects through the rails console with a simple Foo.all ) but if I run >> sqlite3 from command line and then run .databases I can''t see any >> database created. >> I thought I could see the databases set in my database.yml ( database: >> db/development.sqlite3 database: db/test.sqlite3 database: db/ >> production.sqlite3 ) but the .databases command shows nothing. >> >> sqlite3 --version >> 3.5.6 >> rails -v >> 3.0.5 >> O.S. Windows 7 >> >> >> You don''t see any of the databases you expected to see. What do you see when you run .databases? >> >> B. >> -- >> You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. >> To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org >> To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org >> For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en. > -- > You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. > To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. > For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.-- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
That''s right. I did it. Shame on me for not reading carefully the documentation. Thank you guys. On Thu, Apr 21, 2011 at 10:09 AM, Frederick Cheung < frederick.cheung-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > > On 20 Apr 2011, at 20:17, Federico Rota <federico.rota01-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > Well, when I run .databases i see something like an empty grid clearly > indicating that there is no database. > I think i should see my rails'' databases (the ones resulting populated from > rails console as i said before). > > > You misunderstand what .databases does. It lists all attached databases, > not all the databases that exist (since a database is just a file anywhere > on disk). If you just run sqlite3 there are no attached databases. If you > run sqlite3 path/to/something.sqlite3 then it will attempt to load that > database, you can also attach extra databases with the attach database > command > > Fred > > This is the first time i use sqlite but i think the command is right. > I don''t think i have 2 different instances of sqlite installed (one used by > rails and another one where i use the .databases command). I can''t > understand where is my sqlite database populated via rails and how can i > verify my tables via sqlite console queries. > > Thanks again > > Il giorno 20/apr/2011, alle ore 16:09, Bryan Crossland <<bacrossland-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> > bacrossland-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> ha scritto: > > On Tue, Apr 19, 2011 at 4:27 PM, Federico < <federico.rota01-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org><federico.rota01-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> > federico.rota01-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > >> Hello guys, >> I''ve made a very simple application following the footsteps of >> <http://guides.rubyonrails.org/getting_started.html><http://guides.rubyonrails.org/getting_started.html> >> http://guides.rubyonrails.org/getting_started.html. >> I managed to insert my objects (i checked the existence of inserted >> objects through the rails console with a simple Foo.all ) but if I run >> sqlite3 from command line and then run .databases I can''t see any >> database created. >> I thought I could see the databases set in my database.yml ( database: >> db/development.sqlite3 database: db/test.sqlite3 database: db/ >> production.sqlite3 ) but the .databases command shows nothing. >> >> sqlite3 --version >> 3.5.6 >> rails -v >> 3.0.5 >> O.S. Windows 7 >> >> > You don''t see any of the databases you expected to see. What do you see > when you run .databases? > > B. > > -- > You received this message because you are subscribed to the Google Groups > "Ruby on Rails: Talk" group. > To post to this group, send email to <rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org> > rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > To unsubscribe from this group, send email to > <rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org> > rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > For more options, visit this group at > <http://groups.google.com/group/rubyonrails-talk?hl=en> > http://groups.google.com/group/rubyonrails-talk?hl=en. > > -- > You received this message because you are subscribed to the Google Groups > "Ruby on Rails: Talk" group. > To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > To unsubscribe from this group, send email to > rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > For more options, visit this group at > http://groups.google.com/group/rubyonrails-talk?hl=en. > > -- > You received this message because you are subscribed to the Google Groups > "Ruby on Rails: Talk" group. > To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > To unsubscribe from this group, send email to > rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > For more options, visit this group at > http://groups.google.com/group/rubyonrails-talk?hl=en. >-- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.