0

I have InstantRails installed along with WeBrick and sqlite3.

What exactly do I type in the Windows cmd console to setup a db called 'development' and to get the entire things running?

This is my #&%^# 4th day of installation. I can get everything running on my localhost EXCEPT setup my db. I'm not a programmer so if you have a good url for beginner tutorials that would be great.

Please tell me exactly what I need to type in the cmd console (or what console I need) to make my db hold the information.

I was typing $ sqlite3 db/development.sqlite3 to (boot up?) the db.

Then I typed: CREATE TABLES (code)

Note - I already tried rake db:migrate

Ken
  • 184
  • 1
  • 2
  • 16

1 Answers1

1

Try rake db:migrate (assumimg you have at least 1 migration created ) . The db should be created automatically.

Doon
  • 19,719
  • 3
  • 40
  • 44
  • do you get an error? if so what is it? could you post your config/database.yml file? And do you have at least 1 migration created? Also a good place to look would be logs/development.log for any errors... – Doon Aug 17 '10 at 01:38
  • ok that looks fine, any errors when you run the rake db:migrate command? even without a migration it should create the db and create the schema_migrations table – Doon Aug 17 '10 at 01:50
  • I don't even know what a migration is. lol Sorry I didn't get to that part in the book yet. I looked at the logs/dev.log and only see 4 things that look like GET but I have no idea what the other information means. – Ken Aug 17 '10 at 01:52
  • When I type in the rake db:migrate this happens: No Rakefile found (looking for:rakefile, Rakefile, rakefile.db, Rakefile.rb) C:/Ruby/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2377:in 'raw_load_rakefile' – Ken Aug 17 '10 at 01:55
  • are you running rake db:migrate in the root of your rails_app? and in that directory do you see a file called Rakefile? – Doon Aug 17 '10 at 02:00
  • you can try following http://guides.rubyonrails.org/getting_started.html it should translate to windows (assuming you have rails, and the like installed which it seems that you do.) – Doon Aug 17 '10 at 02:02
  • Yea, I see a file called Rakefile. It's in the InstantRails in the folder of the app I'm trying to build. -I have read that getting_started guide and it's way too advanced. They designed it for developers not designers. I'm lost when I start at 3.1 – Ken Aug 17 '10 at 02:06
  • when you create a model, scaffold, etc.. It will create a migration file, which is a piece of ruby that tells how to build the database table to hold the data. Don't worry if you don't have one yet, they aren't needed to run rake db:create or rake db:migrate. But the fact that it cannot find the rake file, indicates to me that either you are not in the correct directory, or something got messed with either the rails_app in the directory or rake itself. I don't actually use windows, but have helped enough devs in our user group get rails setup on it... – Doon Aug 17 '10 at 02:07
  • Ok. Yes it could have got broke or could be in the wrong folder. Should I just delete everything and reinstall to ensure the correct paths and information. What you're saying does make sense to me. :) - I actually use to have it in a main folder called Ruby1 but deleted that and made Ruby. – Ken Aug 17 '10 at 02:10
  • My development.sqlite3 is empty too, if that matters. – Ken Aug 17 '10 at 02:11
  • hmm I not sure how instantrails works, in looking at the webpage it appears to be installing apache and mysql as well? you should have a rakefile in the root of your directory? not in the instant rails directory. If you would like you can try the installer a friend of mine built (and I helped debug) http://edwardprevost.info/Blog/2010/06/19/winror-win-roar/ That will install ruby/rails and a text editor, and get you basically up and running. Sorry I can't help more with instant rails.. – Doon Aug 17 '10 at 02:12
  • I would delete and start over. Just get up a cmd prompt, and assuming the installer put rails in your path just create a directory to store you projects in (c:\railsprojects for example). then cd \railsprojects ; rails test_app ; cd test_app; rake db:migrate – Doon Aug 17 '10 at 02:13
  • also see the first answer here... http://stackoverflow.com/questions/164896/limitations-in-running-ruby-rails-on-windows – Doon Aug 17 '10 at 02:16
  • Ok. My rakefile is in my folder of my app that's inside of InstantRails. I appreciate your help and would give you an arrow up but my Reputation is too low to do that. Thanks! – Ken Aug 17 '10 at 02:16