The ROR configuration Oracle database error, acute!!

I set the configuration database in database.yml
development:
adapter: oracle
database: sxfx
username: whg
password: whg

Host should not set.

The database is installed on the server, the client. Pl/sql can be used to connect to the database.

Then I used the rake db:migrate --trace test, the following error occurred, please master, thank you.

F:\rails\depot>rake db:migrate --trace
(in F:/rails/depot)
** Invoke db:migrate (first_time)
** Invoke environment (first_time)
** Execute environment
** Execute db:migrate
rake aborted!
Oracle/OCI libraries could not be loaded: no such file to load -- oci8
c:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.15.5/lib/active_record/connection_
adapters/oracle_adapter.rb:682:in `oracle_connection'
c:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.15.5/lib/active_record/connection_
adapters/abstract/connection_specification.rb:262:in `send'
c:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.15.5/lib/active_record/connection_
adapters/abstract/connection_specification.rb:262:in `connection_without_query_c
ache='
c:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.15.5/lib/active_record/query_cache
.rb:54:in `connection='
c:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.15.5/lib/active_record/connection_
adapters/abstract/connection_specification.rb:230:in `retrieve_connection'
c:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.15.5/lib/active_record/connection_
adapters/abstract/connection_specification.rb:78:in `connection'
c:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.15.5/lib/active_record/migration.r
b:284:in `migrate'
c:/ruby/lib/ruby/gems/1.8/gems/rails-1.2.5/lib/tasks/databases.rake:4
c:/ruby/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:392:in `call'
c:/ruby/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:392:in `execute'
c:/ruby/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:392:in `each'
c:/ruby/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:392:in `execute'
c:/ruby/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:362:in `invoke'
c:/ruby/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:355:in `synchronize'
c:/ruby/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:355:in `invoke'
c:/ruby/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:1739:in `top_level'
c:/ruby/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:1739:in `each'
c:/ruby/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:1739:in `top_level'
c:/ruby/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:1761:in `standard_exceptio
n_handling'
c:/ruby/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:1733:in `top_level'
c:/ruby/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:1711:in `run'
c:/ruby/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:1761:in `standard_exceptio
n_handling'
c:/ruby/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:1708:in `run'
c:/ruby/lib/ruby/gems/1.8/gems/rake-0.7.3/bin/rake:7
c:/ruby/bin/rake:16:in `load'
c:/ruby/bin/rake:16

Please master, thank you

Started by Dick at November 19, 2016 - 7:57 AM

From release_id=16611 download ruby-oci8;
Run the RB file, as follows
>ruby ruby-oci8-1.0.0-mswin32.rb
Copy OCI8.rb to D:/Ruby/lib/ruby/site_ruby/1.8/DBD/OCI8
Copy oci8.rb to D:/Ruby/lib/ruby/site_ruby/1.8
Copy oci8lib.so to D:/Ruby/lib/ruby/site_ruby/1.8/i386-msvcrt
OK?
Enter Yes/No: Yes
Copying OCI8.rb to D:/Ruby/lib/ruby/site_ruby/1.8/DBD/OCI8 ... done
Copying oci8.rb to D:/Ruby/lib/ruby/site_ruby/1.8 ... done
Copying oci8lib.so to D:/Ruby/lib/ruby/site_ruby/1.8/i386-msvcrt ... done
OK
>Exit code: 0
==============OK===============
Then modify the config\database.yml file under the Rails project
development:
adapter: oci
database: MYORACLE
username: user11
password: password22

...........

Posted by Kerwin at November 24, 2016 - 8:30 AM

The wrong point
development:
adapter: oci
database: MYORACLE <<<<host: MYORACLE
username: user11
password: password22

Should be like this:
development:
adapter: oci
host: MYORACLE
username: user11
password: password22
Test connection to ORACLE 10G OK.

Posted by Kerwin at November 29, 2016 - 8:31 AM

Test connection to ORACLE 10G OK

Posted by Margaret at December 05, 2016 - 8:52 AM

Is good advice is worth learning!

Posted by Chester at December 20, 2016 - 9:11 AM