Today I learned about the latest popular Ruby on Rails, feeling like a code generator linking OracleDatabase, I searched for half a day of information. Finally found a way, ^______^.
1. Installation drive
http://rubyforge.org/projects/ruby-oci8/
Download and run (double-click) Ruby-oci8-mswin inside the *.RB
2. Change Database.yml
Development
Adapter:oci
Host:examplesid
Username:exampleuser
Password:examplepass
Or
Development
Adapter:oci
Host:192.168.0.50/examplesid
Username:exampleuser
Password:examplepass
The database field is not used; Exampleuser can be replaced with TNS;
My Oracle is installed on another machine, so configure the following
Development
Adapter:oci
Host:mytnsname
Username:system
Password:manager
3. CREATE TABLE Considerations
The name of the default datasheet in Ruby on rails is a plural noun, which means if you want to use the following command:
Ruby Script/generate Scaffold Item Manage
Then the name of your datasheet is going to be items (note the S in it) and the location is in the default space of the username in the database.yml that you just made.
I'm using a ruby 1.8.4.
Rails 1.0.0
The table must be created with the name of a field ID, and a {TABLE_NAME}_SEQ sequence for the table should be established, as follows:
such as my Items datasheet, the fields are: ID, Title, Createdat Three, and set up a items_seq sequence (sql:create sequence items_seq increment by 1)
4. Then use Ruby Script/server to see the results. ^____^