There are many threads showing the error... no such file to load -- sqlite3 BUT they are all reported by people using sqlite3 wherease I am using mysql2. My gemfile clearly says mysql2. My database.yml file definitely only has mysql2 configuration in it. And a search of my project shows no files containing any reference to sqlite3. So why am I getting this message and how to I fix it? I can run db:create ok (and the mysql TEST and DEVELOPMENT databases are created) but when I run db:migrate then I get this error. -- Posted via http://www.ruby-forum.com/. -- 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 24 November 2010 20:28, Steve Mills <lists-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org> wrote:> There are many threads showing the error... > > no such file to load -- sqlite3 > > BUT they are all reported by people using sqlite3 wherease I am using > mysql2. > > My gemfile clearly says mysql2. My database.yml file definitely only has > mysql2 configuration in it. And a search of my project shows no files > containing any reference to sqlite3. > > So why am I getting this message and how to I fix it? > > I can run db:create ok (and the mysql TEST and DEVELOPMENT databases are > created) but when I run db:migrate then I get this error.It might be worth posting the complete output from the rake command with --trace specified. Also which Rails are you using? Which OS? Is this a new install and this is your first app? Output from gem list. Colin -- 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.
Colin Law wrote in post #963675:> It might be worth posting the complete output from the rake command > with --trace specified. > > Also which Rails are you using? Which OS? > Is this a new install and this is your first app? > Output from gem list. > > ColinHmmm. I forgot a lot of clues there didn''t I. Sorry about that... It''s one of several Rails projects and the others do not have this problem. I''m building the DEPOT application from the Agile book and wanted to see if their version v (depot_v) code would resolve another problem I''m having... The "other problem" is that TEST FUNCTIONALS seems to set up the TEST DB and then quickly erase it just before running the FUNCTIONALS test which then fails because the tables are not found. Everything else apart from this is working fine. I''m running under Windows 7, Rails 3.0.3. Ruby 1.9.2. I''m in the midst of wiping the DEPOT version "v" and setting it up again. Version "g" for example doesn''t have this problem. Will report back in 10 mins or so on whether setting it all up again worked or changed anything. Thanks for your reply to my question. -- Posted via http://www.ruby-forum.com/. -- 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.
Steve Mills wrote in post #963677:> I''m in the midst of wiping the DEPOT version "v" and setting it up > again. Version "g" for example doesn''t have this problem. > > Will report back in 10 mins or so on whether setting it all up again > worked or changed anything. >That didn''t make any difference. Looking at the earlier version which seemed ok, and this version that is not, the main difference is the following in the GEMFILE... gem ''activemerchant'', ''~> 1.9.0'' gem ''haml'', ''~> 3.0.18'' gem ''jquery-rails'', ''~> 0.2.2'' Could it be that although my application is using mysql2 that one of these things assumes or requires sqlite3? Kind Regards Steve -- Posted via http://www.ruby-forum.com/. -- 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 24 November 2010 20:57, Steve Mills <lists-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org> wrote:> Steve Mills wrote in post #963677: >> I''m in the midst of wiping the DEPOT version "v" and setting it up >> again. Version "g" for example doesn''t have this problem. >> >> Will report back in 10 mins or so on whether setting it all up again >> worked or changed anything. >> > > That didn''t make any difference. > > Looking at the earlier version which seemed ok, and this version that is > not, the main difference is the following in the GEMFILE... > > gem ''activemerchant'', ''~> 1.9.0'' > gem ''haml'', ''~> 3.0.18'' > gem ''jquery-rails'', ''~> 0.2.2'' > > Could it be that although my application is using mysql2 that one of > these things assumes or requires sqlite3?I would not have thought that likely, though I know nothing about activemerchant. Does rake --trace give any indication of where sqlite might be included? Colin -- 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.
post your Gemfile and database.yml in pastie.org Best Regards, Luciano Sousa http://www.lucianosousa.net http://twitter.com/lucianosousa http://rubyonrio.org *Ruby on Rails Developer *Linux User #456387 *Contact: +55 21 8418-5945 2010/11/24 Steve Mills <lists-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org>> Steve Mills wrote in post #963677: > > I''m in the midst of wiping the DEPOT version "v" and setting it up > > again. Version "g" for example doesn''t have this problem. > > > > Will report back in 10 mins or so on whether setting it all up again > > worked or changed anything. > > > > That didn''t make any difference. > > Looking at the earlier version which seemed ok, and this version that is > not, the main difference is the following in the GEMFILE... > > gem ''activemerchant'', ''~> 1.9.0'' > gem ''haml'', ''~> 3.0.18'' > gem ''jquery-rails'', ''~> 0.2.2'' > > Could it be that although my application is using mysql2 that one of > these things assumes or requires sqlite3? > > Kind Regards > Steve > > -- > Posted via http://www.ruby-forum.com/. > > -- > 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<rubyonrails-talk%2Bunsubscribe-/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.
Luciano Sousa wrote in post #963685:> post your Gemfile and database.yml in pastie.orgDone <script src=''http://pastie.org/1325155.js''></script> Hope I did it right? I''ve not used pastie.org before. Kind Regards Steve -- Posted via http://www.ruby-forum.com/. -- 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 25 November 2010 10:05, Steve Mills <lists-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org> wrote:> Luciano Sousa wrote in post #963685: >> post your Gemfile and database.yml in pastie.org > > Done > <script src=''http://pastie.org/1325155.js''></script> > > Hope I did it right? I''ve not used pastie.org before.I think that should just be http://pastie.org/1325155 Colin -- 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.
Luciano Sousa
2010-Nov-25 13:24 UTC
Re: Re: Re: no such file to load -- sqlite3 WITH mysql2
its ok! the config not have problem... ;s post your rake db:migrate --trace... ;) Best Regards, Luciano Sousa http://www.lucianosousa.net http://twitter.com/lucianosousa http://rubyonrio.org *Ruby on Rails Developer *Linux User #456387 *Contact: +55 21 8418-5945 2010/11/25 Colin Law <clanlaw-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org>> On 25 November 2010 10:05, Steve Mills <lists-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org> wrote: > > Luciano Sousa wrote in post #963685: > >> post your Gemfile and database.yml in pastie.org > > > > Done > > <script src=''http://pastie.org/1325155.js''></script> > > > > Hope I did it right? I''ve not used pastie.org before. > > I think that should just be http://pastie.org/1325155 > > Colin > > -- > 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<rubyonrails-talk%2Bunsubscribe-/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.
Luciano Sousa wrote in post #963876:> post your rake db:migrate --trace...Done. http://pastie.org/1325873 Kind Regards Steve -- Posted via http://www.ruby-forum.com/. -- 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.
OK. I now know why this is happening but I don''t know what to do to fix it... in the "app" folder is a file "store.rb" and this contains the following lines... ActiveRecord::Base.establish_connection( :adapter => ''sqlite3'', :database => ''db/development.sqlite3'') It is these lines that are causing the problem since I am not using sqlite3 but rather mysql2. I don''t know how to fix this. I tried the following... ActiveRecord::Base.establish_connection( :adapter => ''mysql2'', :database => ''db/development.mysql2'') But that produced a new set of errors. Any advice most welcome. -- Posted via http://www.ruby-forum.com/. -- 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.
Hassan Schroeder
2010-Nov-29 16:17 UTC
Re: Re: no such file to load -- sqlite3 WITH mysql2
On Mon, Nov 29, 2010 at 8:08 AM, Steve Mills <lists-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org> wrote:> in the "app" folder is a file "store.rb" and this contains the following > lines... > > ActiveRecord::Base.establish_connection( > :adapter => ''sqlite3'', > :database => ''db/development.sqlite3'') > > It is these lines that are causing the problem since I am not using > sqlite3 but rather mysql2. > > I don''t know how to fix this. I tried the following... > > ActiveRecord::Base.establish_connection( > :adapter => ''mysql2'', > :database => ''db/development.mysql2'') > > But that produced a new set of errors.No kidding -- " :database => ''db/development.mysql2'' " is certainly one problem. Do you not have a config/database.yml entry for your actual DB that works? To compare to? If not, you''ll have to get that sorted first. -- Hassan Schroeder ------------------------ hassan.schroeder-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org twitter: @hassan -- 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 29 November 2010 16:08, Steve Mills <lists-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org> wrote:> OK. I now know why this is happening but I don''t know what to do to fix > it... > > in the "app" folder is a file "store.rb" and this contains the following > lines... > > ActiveRecord::Base.establish_connection( > :adapter => ''sqlite3'', > :database => ''db/development.sqlite3'') > > It is these lines that are causing the problem since I am not using > sqlite3 but rather mysql2. > > I don''t know how to fix this. I tried the following... > > ActiveRecord::Base.establish_connection( > :adapter => ''mysql2'', > :database => ''db/development.mysql2'')Presumably you do not know why store.rb is attempting to open a separate connect to the (or a different) database. Presumably also you inherited this code. If you cannot contact the original developer or do not have documentation for it then you are just going to have to slog through the code trying to work it out. Personally I would start by just removing that code and see what happens (or even remove store.rb, what is it doing in the app folder anyway?). If you have tests then see if they run, otherwise write them. Colin -- 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 29 November 2010 16:08, Steve Mills <lists-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org> wrote:> OK. I now know why this is happening but I don''t know what to do to fix > it... > > in the "app" folder is a file "store.rb" and this contains the following > lines... > > ActiveRecord::Base.establish_connection( > :adapter => ''sqlite3'', > :database => ''db/development.sqlite3'')To quote from your OP> And a search of my project shows no files containing any reference to sqlite3.?? Colin -- 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.
Colin Law wrote in post #964785:> To quote from your OP >> And a search of my project shows no files containing any reference to sqlite3.What can I say? Windows 7 search is not too good. It brought up files that mentioned the target words in comments but it did not bring up this particular file. Because it brought back some files, and those files were lower down than the root, I assumed it had brought back all such files from all levels. Windows XP would have done that - no problem - but not it appears Windows 7. Today I trawled through each file that looked like it might have something to do with configuration by hand (effectively doing the search myself) and found the one I listed today. I do have a valid database.yml that works. The problem is the code you''re seeing here was downloaded as part of the Agile book and earlier editions of the project did not have this "store.rb" file, that''s what drew my attention to it. My next step was (or maybe is) to scan the book and see if I can find reference to where it was created and why. -- Posted via http://www.ruby-forum.com/. -- 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.
A bit more of the code - to clarify the origin... #--- # Excerpted from "Agile Web Development with Rails, 4rd Ed.", # published by The Pragmatic Bookshelf. # Copyrights apply to this code. It may not be used to create training material, # courses, books, articles, and the like. Contact us if you are in doubt. # We make no guarantees that this code is fit for any purpose. # Visit http://www.pragmaticprogrammer.com/titles/rails4 for more book information. #--- require ''builder'' require ''active_record'' #ActiveRecord::Base.establish_connection( # :adapter => ''sqlite3'', # :database => ''db/development.sqlite3'') ActiveRecord::Base.establish_connection( :adapter => ''mysql2'', :database => ''db/development.mysql2'') -- Posted via http://www.ruby-forum.com/. -- 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 29 November 2010 16:33, Steve Mills <lists-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org> wrote:> Colin Law wrote in post #964785: > >> To quote from your OP >>> And a search of my project shows no files containing any reference to sqlite3. > > What can I say? Windows 7 search is not too good. It brought up files > that mentioned the target words in comments but it did not bring up this > particular file. Because it brought back some files, and those files > were lower down than the root, I assumed it had brought back all such > files from all levels. Windows XP would have done that - no problem - > but not it appears Windows 7.I seriously suggest considering switching to Ubuntu (or similar). You would not regret it. It seems possible that the time you have spent trying to sort this problem would have covered getting you up and running in Ubuntu. Also I would suggest using a decent editor such as jEdit (others are available) that supports sets of files (projects) and includes source search that in this case in a few seconds would have found all references to sqlite. jEdit will run on Windows. Colin -- 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.
Hassan Schroeder
2010-Nov-29 16:51 UTC
Re: Re: no such file to load -- sqlite3 WITH mysql2
On Mon, Nov 29, 2010 at 8:35 AM, Steve Mills <lists-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org> wrote:> A bit more of the code - to clarify the origin...utterly irrrelevant.> :database => ''db/development.mysql2'')The line above is *wrong* -- look at your config/database.yml entries and compare. That is simply not a valid MySQL entry. -- Hassan Schroeder ------------------------ hassan.schroeder-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org twitter: @hassan -- 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.
Colin Law wrote in post #964799:> I seriously suggest considering switching to Ubuntu (or similar). You > would not regret it...I am doing the tutorials in parallel on Ubuntu. Unfortunately the "test functionals" issue I mentioned above that started me down this path occurs there too. My primary development platform has to be Windows I''m afraid - that''s what my customers want - but I do as much as possible on Ubuntu as well. :) -- Posted via http://www.ruby-forum.com/. -- 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.
Hassan Schroeder wrote in post #964802:> On Mon, Nov 29, 2010 at 8:35 AM, Steve Mills <lists-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org> > wrote: >> A bit more of the code - to clarify the origin... > > utterly irrrelevant. > >> :database => ''db/development.mysql2'') > > The line above is *wrong* -- look at your config/database.yml entries > and compare. That is simply not a valid MySQL entry. > > -- > Hassan Schroeder ------------------------ hassan.schroeder-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org > twitter: @hassanHi Hassan, The relevance was to show the full title and version number of the book from which this example code is taken, especially since I know many others are also reading and following that book and are having similar problems. Since many consider it the definitive work on Ruby on Rails then I think it''s worth mentioning it. I agree the actual additional code shown beyond the comments in the header adds nothing to the problem analysis. :) I know that line is wrong - Rails tells me that - what I don''t know is how to fix it, or even why the store.rb file exists at all in the app folder. However I downloaded this code from the web site associated with the book and that''s why it''s in there. The original code from the book uses sqlite but I prefer mysql and so changed it to use mysql. Following the book, and creating my own project, I don''t encounter this problem. But I do encounter a serious problem on "test functionals" where the db tables are created, seeded, and then promptly dropped prior to the first test running so all the tests fail. The applicaiton itself works fine. So as one particular way of investigating this I decided to download the code from the book, reconfigure it for mysql, and see if the testing problem still exists. However I can''t get beyond the db:migrate because of this problem being explored here. Unfortunately, although I''ve spent many hours on RoR on both Windows 7 and Ubuntu, the Rails aspects of it are IMHO poorly documented. Ruby language - yes good documentaiton and I understand that with no problem. But Rails is unusual in that you can place pieces of an Object in many places and they all come together at runtime, but if that fails to integrate properly then you''re pretty much reliant on helpful guys like yourself online pointing you in the right direction. I am working my way through... (a) Agile Web Development with Rails Ed.4 (b) Rails Recipes (c) RailsSpace: Building a Social Networking Website with Ruby on Rails (d) Beginning Ruby on Rails E-Commerce building all of the examples. But in each case I''m encountering problems and issues. So if I can solve why "test functionals" keeps dropping the tables before running the tests then that would be the biggest help. I realise that test mode is supposed to start with an empty database so that the tests always run the same. It then creates the tables, then it seeds them, then for some reason it drops the tables and runs the first test which failes because the tables don''t exist. I may be wrong here but I think it used to work before the seeds were written. That it was after the book covered seeds and the seeds file was created that this testing problem occured. It might also have something to do with using mysql with myisam files because the transaction capability is different according to the Rails books (although I''ve not noticed that in the past). Kind Regards Steve -- Posted via http://www.ruby-forum.com/. -- 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.
Hassan Schroeder
2010-Nov-29 17:59 UTC
Re: Re: Re: no such file to load -- sqlite3 WITH mysql2
On Mon, Nov 29, 2010 at 9:48 AM, Steve Mills <lists-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org> wrote:>> The line above is *wrong* -- look at your config/database.yml entries >> and compare. That is simply not a valid MySQL entry.> I know that line is wrong - Rails tells me that - what I don''t know is > how to fix it, or even why the store.rb file exists at all in the app > folder.And I''ve told you twice how to fix it. Seriously, WTF? -- Hassan Schroeder ------------------------ hassan.schroeder-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org twitter: @hassan -- 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.
Marnen Laibow-Koser
2010-Nov-29 18:09 UTC
Re: Re: Re: no such file to load -- sqlite3 WITH mysql2
Steve Mills wrote in post #964810:> Colin Law wrote in post #964799: >> I seriously suggest considering switching to Ubuntu (or similar). You >> would not regret it... > > I am doing the tutorials in parallel on Ubuntu. Unfortunately the "test > functionals" issue I mentioned above that started me down this path > occurs there too. > > My primary development platform has to be Windows I''m afraid - that''s > what my customers want - but I do as much as possible on Ubuntu as well. > :)Your development environment is no concern of your customers. What do you mean by "that''s what my customers want"? Why do you think you need to work on Windows? Remember, you''re developing *server-side* applications here that have nothing to do with the client OS. Best, -- Marnen Laibow-Koser http://www.marnen.org marnen-sbuyVjPbboAdnm+yROfE0A@public.gmane.org -- Posted via http://www.ruby-forum.com/. -- 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.
Marnen Laibow-Koser wrote in post #964825:> Your development environment is no concern of your customers. What do > you mean by "that''s what my customers want"? Why do you think you need > to work on Windows? Remember, you''re developing *server-side* > applications here that have nothing to do with the client OS.That''s true for just this one aspect of development. I also use OutSystems which runs on Windows, .NET which requires Windows, Prolog which runs best on Windows, and build free-standing apps that target Windows, I build Fusion:Gen apps where the case tools run on Windows, and Android apps where the tools that I use are Windows based. But I guess this is wandering off the point of this thread :) -- Posted via http://www.ruby-forum.com/. -- 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.
Hassan Schroeder wrote in post #964823:> On Mon, Nov 29, 2010 at 9:48 AM, Steve Mills <lists-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org> > wrote: > >>> The line above is *wrong* -- look at your config/database.yml entries >>> and compare. That is simply not a valid MySQL entry. > >> I know that line is wrong - Rails tells me that - what I don''t know is >> how to fix it, or even why the store.rb file exists at all in the app >> folder. > > And I''ve told you twice how to fix it. Seriously, WTF? > > -- > Hassan Schroeder ------------------------ hassan.schroeder-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org > twitter: @hassanI have followed the advice but it didn''t help... Database.yml contains entries like:- development: adapter: mysql2 encoding: utf8 reconnect: false database: depot_v_development pool: 5 username: <uname> password: <pw> host: localhost which is a database specification broken into multiple elements. Clearly what is required is a single parameter which specifies the database, something like, localhost:<uname>@<pw>/depot_v_development Unfortunately I don''t know the required syntax and database.yml doesn''t provide it. So yes, the advice appears good, but for me it''s incomplete. If I delete that section of code then the db:migrate works. So now I''m going to see if everything else still works with it deleted. I''ll report back. -- Posted via http://www.ruby-forum.com/. -- 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.
Marnen Laibow-Koser
2010-Nov-29 18:50 UTC
Re: Re: Re: no such file to load -- sqlite3 WITH mysql2
Steve Mills wrote in post #964833:> Marnen Laibow-Koser wrote in post #964825: > >> Your development environment is no concern of your customers. What do >> you mean by "that''s what my customers want"? Why do you think you need >> to work on Windows? Remember, you''re developing *server-side* >> applications here that have nothing to do with the client OS. > > That''s true for just this one aspect of development. I also use > OutSystems which runs on Windows, .NET which requires Windows, Prolog > which runs best on Windows, and build free-standing apps that target > Windows,Well, Rails runs best on a *nix system. I highly recommend at least a VM.> I build Fusion:Gen apps where the case tools run on Windows, > and Android apps where the tools that I use are Windows based.Uh...WTF? Android development is not platform-specific. Besides, the less you use Windows, the better. If your tools are tying you to Windows, you really need better tools.> > But I guess this is wandering off the point of this thread :)Slightly. But you seem to be under a misapprehension as to how much you *need* to use Windows. Best, -- Marnen Laibow-Koser http://www.marnen.org marnen-sbuyVjPbboAdnm+yROfE0A@public.gmane.org -- Posted via http://www.ruby-forum.com/. -- 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.
Hassan Schroeder
2010-Nov-29 19:03 UTC
Re: Re: Re: Re: no such file to load -- sqlite3 WITH mysql2
On Mon, Nov 29, 2010 at 10:42 AM, Steve Mills <lists-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org> wrote:> Clearly what is required is a single parameter which specifies the > database, something like, localhost:<uname>@<pw>/depot_v_developmentUh, "clearly"? Actually, "clearly" that''s not true -- and which would be quite "clear" if you read the documentation for the method in question: ActiveRecord::Base.establish_connection which, at least in the 2.3.8 version I just glanced at, has examples for both SQLite and MySQL... -- Hassan Schroeder ------------------------ hassan.schroeder-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org twitter: @hassan -- 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.
Steve Mills
2010-Nov-29 19:59 UTC
Re: Re: Re: Re: no such file to load -- sqlite3 WITH mysql2
Hassan Schroeder wrote in post #964841:> On Mon, Nov 29, 2010 at 10:42 AM, Steve Mills <lists-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org> > wrote: > >> Clearly what is required is a single parameter which specifies the >> database, something like, localhost:<uname>@<pw>/depot_v_development > > Uh, "clearly"? Actually, "clearly" that''s not true -- and which would be > quite "clear" if you read the documentation for the method in question: > > ActiveRecord::Base.establish_connection > > which, at least in the 2.3.8 version I just glanced at, has examples for > both SQLite and MySQL... > > -- > Hassan Schroeder ------------------------ hassan.schroeder-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org > twitter: @hassanOK. My apologies. I didn''t know where to look, but I''ve found it now, and as you say, it does have an example for MySQL. Thank you for your patience. -- Posted via http://www.ruby-forum.com/. -- 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 29 November 2010 17:48, Steve Mills <lists-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org> wrote:> [...] > Following the book, and creating my own project, I don''t encounter this > problem. But I do encounter a serious problem on "test functionals" > where the db tables are created, seeded, and then promptly dropped prior > to the first test running so all the tests fail. The application itself > works fine.Are you using fixtures? I think most now would advise against fixtures, suggesting factories instead. See http://railscasts.com/episodes/158-factories-not-fixtures for example. So if you can''t get fixtures to work (or even if you can) then forget them and move to something better. Colin -- 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.
Marnen Laibow-Koser
2010-Nov-29 20:56 UTC
Re: Re: Re: no such file to load -- sqlite3 WITH mysql2
Colin Law wrote in post #964874:> On 29 November 2010 17:48, Steve Mills <lists-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org> wrote: >> [...] >> Following the book, and creating my own project, I don''t encounter this >> problem. But I do encounter a serious problem on "test functionals" >> where the db tables are created, seeded, and then promptly dropped prior >> to the first test running so all the tests fail. The application itself >> works fine. > > Are you using fixtures? I think most now would advise against > fixtures, suggesting factories instead. See > http://railscasts.com/episodes/158-factories-not-fixtures for example. > So if you can''t get fixtures to work (or even if you can) then forget > them and move to something better.Agreed. Also forget about functional tests and use Cucumber instead. In fact, forget about Test::Unit and go for RSpec. The Rails core team made a wonderfully testable framework, but provided poor testing tools to actually do that testing.> > ColinBest, -- Marnen Laibow-Koser http://www.marnen.org marnen-sbuyVjPbboAdnm+yROfE0A@public.gmane.org -- Posted via http://www.ruby-forum.com/. -- 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.
Colin Law wrote in post #964874:> On 29 November 2010 17:48, Steve Mills <lists-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org> wrote: >> [...] >> Following the book, and creating my own project, I don''t encounter this >> problem. But I do encounter a serious problem on "test functionals" >> where the db tables are created, seeded, and then promptly dropped prior >> to the first test running so all the tests fail. The application itself >> works fine. > > Are you using fixtures? I think most now would advise against > fixtures, suggesting factories instead. See > http://railscasts.com/episodes/158-factories-not-fixtures for example. > So if you can''t get fixtures to work (or even if you can) then forget > them and move to something better. > > ColinThanks Colin. I''ll take that on board. Yes, the Agile book''s tutorial uses fixtures and that''s what I think caused the original problem. Trouble is, I''m trying to learn Rails and I''m using this book as my tutor. Can''t run before walking I guess. I''ll follow the link and see if I can understand how to keep on following the tutorials but switch to factories. :) -- Posted via http://www.ruby-forum.com/. -- 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.
Colin Law
2010-Nov-29 21:16 UTC
Re: Re: Re: Re: no such file to load -- sqlite3 WITH mysql2
On 29 November 2010 20:58, Steve Mills <lists-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org> wrote:> Colin Law wrote in post #964874: >> On 29 November 2010 17:48, Steve Mills <lists-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org> wrote: >>> [...] >>> Following the book, and creating my own project, I don''t encounter this >>> problem. But I do encounter a serious problem on "test functionals" >>> where the db tables are created, seeded, and then promptly dropped prior >>> to the first test running so all the tests fail. The application itself >>> works fine. >> >> Are you using fixtures? I think most now would advise against >> fixtures, suggesting factories instead. See >> http://railscasts.com/episodes/158-factories-not-fixtures for example. >> So if you can''t get fixtures to work (or even if you can) then forget >> them and move to something better. >> >> Colin > > Thanks Colin. I''ll take that on board. Yes, the Agile book''s tutorial > uses fixtures and that''s what I think caused the original problem. > Trouble is, I''m trying to learn Rails and I''m using this book as my > tutor. Can''t run before walking I guess. > > I''ll follow the link and see if I can understand how to keep on > following the tutorials but switch to factories. :)The tutorial at http://railstutorial.org/ is good and uses factories and rspec if I remember correctly. I think you can buy the book or work through it online for free. Colin Colin -- 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.