Sunday, September 21, 2014

Ruby on Rails Getting Started


Pre-request

Ruby Getting Started
http://ben-bai.blogspot.tw/2014/09/ruby-getting-started.html

SQLite Getting Started
http://ben-bai.blogspot.tw/2014/09/sqlite-getting-started.html

Note

You can also use rails installer to install ruby, sqlite and rails at once.
see http://railsinstaller.org/en

Simple Note

Follow tutorial
http://guides.rubyonrails.org/getting_started.html

But not works



Follow Installation Instructions at
https://github.com/oneclick/rubyinstaller/wiki/Development-Kit
to install Development Kit



Test Development Kit



Install Rails again



Still has some error, but seems rails is installed.

Follow tutorial, type "rails new blog" to create a blog and run server



Hello, Rails!


Ruby Getting Started


Simple Note

Go to http://rubyinstaller.org/downloads/ and
choose latest stable version (1.9.3 for now)
or
check the recommanded version in download page of RoR.
http://rubyonrails.org/download/
I prefer the stable one.

Download it

run installer

follow tutorial to run first gem
http://guides.rubygems.org/make-your-own-gem/#first-gem

testing process and result
https://github.com/benbai123/RubyOnRails/blob/master/Practice/Ruby_Getting_Started/test.png

Full test project at github
https://github.com/benbai123/RubyOnRails/tree/master/Practice/Ruby_Getting_Started

Friday, September 19, 2014

SQLite Getting Started


Simple Note


Go to http://www.sqlite.org/

Go to download page

Download Precompiled Binaries for Windows
(sqlite-shell and sqlite-dll here)

Unzip them into a folder (e.g. C:\programs\sqlite)

Add the folder above into Path (the Environment variable)
or you will need to cd to that folder each time.

Open cmd

Type "sqlite3 test.db"
test.db created

now you can use SQL to access test.db

you can also execute "sqlite3" then choose database with attach command,
e.g. attach "test.db" as test
see http://stackoverflow.com/questions/9057787/opening-database-file-from-within-sqlite-command-line-shell