开发者

Ruby on Rails database.yml information

I'm a designer and brand new to programming.

I have just opened my localhost and can see "Welcome aboard". It has 3 steps to complete - all of which simple to most, are complexing to me.

  1. config/database.yml ok it wants to know my username and password. Where do I get these and where do I post them to to get them to work? I opened my database.yml and it is SQLite version 3.x gem install sqlite3-ruby

I hear people talking about git and all this but confused on how to do these 3 steps - 1. Create your databases and edit config/database.yml

  Rails needs to know your login and password.

2. Use script/generate to create your models and controllers

  To see all available options, run it without parameters.

3. Set up a default route and remove or rename this file

  Routes are set up in config/routes.rb.

Is this just too over my head? I wouldn't mind hiring someone to teach get it all going for me because I really want to learn to code Ruby on Rails.

Thanks!

Note - All resolved by deleting and reinstalling. Now I understand what is actua开发者_Python百科lly happening.


Since you're using an SQLite database, you don't need to configure any username or password to get going with the database -- the default configuration should work out of the box and creates a new database file automatically for you.

For your other questions, the Getting Started with Rails guide over at guides.rubyonrails.org is an excellent introduction that walks you through all the steps in creating a new Rails application. Start by going through this tutorial step by step -- if you get stuck somewhere along the way you can always come back here and post follow-up questions.


If you don't have any idea what a database is you should just leave database.yml alone and use the provided defaults (use sqlite, does not require a password/login). For getting started with Rails, this should be enough. Just delete the public/index.html file.

I would really recommend you to buy a book (Rails 3) (3rd edition is for Rails 2.3) which guides you through the creation of a Rails app - with a lot of examples. The guides are an alternative, but also might be a little difficult to read with close-to-none preknowledge of programming.


I think you might find Michael Hartl's Ruby on Rails Tutorial helpful. It's available for purchase as a PDF or you can view the online version for free. It covers all the major steps of developing a Rails application, including using Git.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜