views:

106

answers:

1

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

+1  A: 

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

Doon
I tried that rake already. Nothing. Any other ideas?
Ken
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
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
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
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
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
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
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
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
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
My development.sqlite3 is empty too, if that matters.
Ken
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
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
also see the first answer here... http://stackoverflow.com/questions/164896/limitations-in-running-ruby-rails-on-windows
Doon
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
No worries, hopefully you get squared away pretty quickly..
Doon