I''ve created a db. Well... running ''rails console'' and testing for the existence of users and other resources works, so I''d infer that my db has been created. But it''s not in my db directory, or in the root directory... where could it be? I recently tried getting mysql2 to work with my rails 3.0.3 app. I''m on windows, and ever since the switch from sqlite3 to mysql2 (I changed my database.yml to look like below) I''ve gotten this confusion. Even worse, now when I run ''rails server'' the page literally takes forever to load!! Hitting ctrl + c to stop the server makes the cmd say "going to shutdown ..." but it never does, so I have to manually close the window and reopen the command line. Any insights would be greatly appreciated!!! -database.yml- development: adapter: mysql2 encoding: utf8 database: development pool: 5 timeout: 5000 username: root password: admin socket: /tmp/mysql.sock # Warning: The database defined as "test" will be erased and # re-generated from your development database when you run "rake". # Do not set this db to the same as development or production. test: adapter: mysql2 encoding: utf8 reconnect: false database: test username: root password: admin #pool: 5 #timeout: 5000 production: adapter: mysql2 encoding: utf8 reconnect: false database: blog3_development pool: 5 username: root password: admin socket: /var/run/mysqld/mysqld.sock -- 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.
Oh I just opened my HeidiSQL program and found that all these databases an be found there! All the tables and stuff can be viewed there...how nice. Except...I still don''t understand WHERE these dbs are....how does mysql2 handle them? How come they''re not found in my application when I look through all my directories e.g. db, config, app, etc.? It bothers me... And I guess the more pressing issue now is WHY rails server goes so slowwwwwww! Is it possible that too many dbs can make it that way? So basically 1) why is rails server so slow/not working and 2) WHERE are these dbs on my computer REALLY and how come they''re not in my app''s directory? -- 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.
daze wrote in post #966105:> I''ve created a db. Well... running ''rails console'' and testing for > the existence of users and other resources works, so I''d infer that my > db has been created. But it''s not in my db directory, or in the root > directory... where could it be?It''s in MySQL''s data directory, the location of which is set in your MySQL configuration. SQLiite works fundamentally differently from most other DBs, in that it puts the whole DB in a single file, which is nice and portable, but runs into concurrency issues. MySQL and other DBs locate all DBs centrally, and use multiple files to represent one DB. You normally shouldn''t need to worry about where your MySQL DBs live. Best, -- Marnen Laibow-Koser http://www.marnen.org marnen-sbuyVjPbboAdnm+yROfE0A@public.gmane.org Sent from my iPhone -- 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@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Hello, as I know this is true about DBs. And one more thing about it: if you keep your migrating files, then you can easily migrate on your server later, and it will create all the databases for you, so it won''t be problem if you have another type of DB in production then development. Try this: gem install thin (or gem install mongrel also good), then write it to your Gemfile: gem ''thin'', then from command line: ''rails server -thin'' it will be faster then Webrick, the default server. Good luck, Zoltán On dec. 4, 03:26, daze <dmonopol...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Oh I just opened my HeidiSQL program and found that all these > databases an be found there! All the tables and stuff can be viewed > there...how nice. Except...I still don''t understand WHERE these dbs > are....how does mysql2 handle them? How come they''re not found in my > application when I look through all my directories e.g. db, config, > app, etc.? It bothers me... > > And I guess the more pressing issue now is WHY rails server goes so > slowwwwwww! Is it possible that too many dbs can make it that way? > > So basically 1) why is rails server so slow/not working and 2) WHERE > are these dbs on my computer REALLY and how come they''re not in my > app''s directory?-- 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 Dec 4, 12:57 am, Marnen Laibow-Koser <li...-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org> wrote:> It''s in MySQL''s data directory, the location of which is set in your > MySQL configuration. SQLiite works fundamentally differently from most > other DBs, in that it puts the whole DB in a single file, which is nice > and portable, but runs into concurrency issues. MySQL and other DBs > locate all DBs centrally, and use multiple files to represent one DB. > > You normally shouldn''t need to worry about where your MySQL DBs live.Thanks!!! This is really helpful - it makes sense now. -- 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 Dec 4, 5:41 am, gezope <gez...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Try this: gem install thin (or gem install mongrel also good), > then write it to your Gemfile: gem ''thin'', > then from command line: ''rails server -thin'' > it will be faster then Webrick, the default server.I''m trying this right now, but I can''t install thin - or I can''t get it working. I''m on Windows by the way, so I realized from http://groups.google.com/group/thin-ruby/browse_thread/thread/c15b2472eb97c2ba that I need eventmachine -v0.8.1 which I have installed (or at least it appears when I type "gem list"). Gem list also says that I have "thin (1.2.7 x86-mingw32)" so I should have thin now too. HOWEVER, after adding gem ''eventmachine'', ''0.8.1'' gem ''thin'' to the gemfile and running bundle update, I get this error: ------------------- C:\Users\Family\workspace\beesl>bundle update Fetching source index for http://rubygems.org/ Using rake (0.8.7) [etc...] Using daemons (1.1.0) Installing eventmachine (0.8.1) with native extensions C:/Ruby187/lib/ ruby/site_ruby/1.8/rubygems/installer.rb:483:in ` d to build gem native extension. (Gem::Installer::ExtensionBuildError) C:/Ruby187/bin/ruby.exe extconf.rb checking for windows.h... yes checking for winsock.h... yes checking for main() in -lkernel32... yes checking for main() in -lrpcrt4... yes checking for main() in -lgdi32... yes checking for main() in -lssleay32... no creating Makefile make MAKE Version 5.2 Copyright (c) 1987, 2000 Borland Fatal: ''ruby.h'' does not exist - don''t know how to make it Gem files will remain installed in C:/Ruby187/lib/ruby/gems/1.8/gems/ eventmachine-0.8.1 for inspection. Results logged to C:/Ruby187/lib/ruby/gems/1.8/gems/eventmachine-0.8.1/ ext/gem_make.out from C:/Ruby187/lib/ruby/site_ruby/1.8/rubygems/installer.rb: 446:in `each'' from C:/Ruby187/lib/ruby/site_ruby/1.8/rubygems/installer.rb: 446:in `build_extensions'' from C:/Ruby187/lib/ruby/site_ruby/1.8/rubygems/installer.rb: 198:in `install'' from C:/Ruby187/lib/ruby/gems/1.8/gems/bundler-1.0.7/lib/ bundler/source.rb:95:in `install'' from C:/Ruby187/lib/ruby/gems/1.8/gems/bundler-1.0.7/lib/ bundler/installer.rb:55:in `run'' from C:/Ruby187/lib/ruby/gems/1.8/gems/bundler-1.0.7/lib/ bundler/spec_set.rb:12:in `each'' from C:/Ruby187/lib/ruby/gems/1.8/gems/bundler-1.0.7/lib/ bundler/spec_set.rb:12:in `each'' from C:/Ruby187/lib/ruby/gems/1.8/gems/bundler-1.0.7/lib/ bundler/installer.rb:44:in `run'' from C:/Ruby187/lib/ruby/gems/1.8/gems/bundler-1.0.7/lib/ bundler/installer.rb:8:in `install'' from C:/Ruby187/lib/ruby/gems/1.8/gems/bundler-1.0.7/lib/ bundler/cli.rb:271:in `update'' from C:/Ruby187/lib/ruby/gems/1.8/gems/bundler-1.0.7/lib/ bundler/vendor/thor/task.rb:22:in `send'' from C:/Ruby187/lib/ruby/gems/1.8/gems/bundler-1.0.7/lib/ bundler/vendor/thor/task.rb:22:in `run'' from C:/Ruby187/lib/ruby/gems/1.8/gems/bundler-1.0.7/lib/ bundler/vendor/thor/invocation.rb:118:in `invoke_task'' from C:/Ruby187/lib/ruby/gems/1.8/gems/bundler-1.0.7/lib/ bundler/vendor/thor.rb:246:in `dispatch'' from C:/Ruby187/lib/ruby/gems/1.8/gems/bundler-1.0.7/lib/ bundler/vendor/thor/base.rb:389:in `start'' from C:/Ruby187/lib/ruby/gems/1.8/gems/bundler-1.0.7/bin/ bundle:13 from C:/Ruby187/bin/bundle:19:in `load'' from C:/Ruby187/bin/bundle:19 ------------------------------- Running "rails server -thin" gives these errors: ------------------------------- C:\Users\Family\workspace\beesl>rails server -thin Could not find gem ''eventmachine (= 0.8.1, runtime)'' in any of the gem sources listed in your Gemfile. Try running `bundle install`. ------------------------------- And running bundle install yields the same error as bundle update!! Ideas? Darn, I really wanted to get this server to run more quickly.... (of course if someone else had an idea of WHY my server is so slow now, and if there were alternatives to thin...) -- 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.
I don''t recommend using mysql2 gem right now. It still has many problems, especially with (invalid date) in numerous cases. I use the normal mysql gem right now with windows and rails 3.0.3 and ruby 1.9.2. You can use that gem by doing: gem install mysql --source http://gems.rubyinstaller.org (because you are windows and developing in windows) You also have to replace mysql2 in the database.yml with mysql for the adpater types. I also specify mysql in my Gemfile and then run bundle install. There are numerous issues still at large for mysql2. https://github.com/brianmario/mysql2/issues Also I recommend using mongrel as well. Place => gem ''mongrel'', ''>= 1.2.0.pre2'' .. in your Gemfile # used with Ruby 1.9.2 on Windows (no other files necessary) # use bundle install to install mongrel # once mongrel is installed use "rails server" not "mongrel_rails start" to start your server. I develop many rails apps on Windows, Linux, and Mac. I like being familiar with all of the environments. Windows is by far the most difficult to setup and use with Ruby and RoR, but there are some advantages with Windows installations (Windows 7 especially) that you don''t get with the other OSs. It involves invoking PowerShell scripting. But, that''s another disussion entirely. Good luck. -- 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.
er one correction - gem install mysql (not with the --sources). -- 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.
Hey thanks! I''ll try mysql instead and hope that the server will work better... what a pity that mysql2 isn''t so stable. -- 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.
Wait com''on there must be a way to get this mysql2 database to work quickly with rails server.... And I''ve never come across the invalid date error you described. Something...maybe??? On Dec 4, 5:40 pm, Alpha Blue <li...-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org> wrote:> I don''t recommend using mysql2 gem right now. It still has many > problems, especially with (invalid date) in numerous cases. I use the > normal mysql gem right now with windows and rails 3.0.3 and ruby 1.9.2. >...-- 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.
Well, in the end, I''ve decided to only have mysql2 for production. For development, I have sqlite3...it''s just so "rails server" can work. -- 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.
daze wrote in post #969350:> Well, in the end, I''ve decided to only have mysql2 for production. > For development, I have sqlite3...it''s just so "rails server" can work.You''re going to want to get this working properly. At some point, you''ll want to use something other than SQLite for development. Best, -- Marnen Laibow-Koser http://www.marnen.org marnen-sbuyVjPbboAdnm+yROfE0A@public.gmane.org Sent from my iPhone -- 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@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.