title: Oracle XE connection configuration for Ruby on Rails
body: <p>I am fairly new to Ruby on Rails and am currently having a problem with configuring config/database.yml to connect Oracle XE 11g R2. I need your help!</p>
  
  <pre>
  Here is my setup:
  VirtualBox 4.3.6
  Ubuntu 64 v12.04.3
  
  $ruby -v
  ruby 2.1.0p0 (2013-12-25 revision 44422) [x86_64-linux]
  
  $ rails -v
  Rails 4.0.2
  
  $ gem -v
  2.2.2
  
  $ gem install ruby-oci8
  Building native extensions.  This could take a while...
  Successfully installed ruby-oci8-2.1.7
  Parsing documentation for ruby-oci8-2.1.7
  Done installing documentation for ruby-oci8 after 4 seconds
  1 gem installed
  
  # Oracle XE 11gR2 installed in a different VM (Host: 10.1.1.3)
  #
  $ ruby -r oci8 -e 'OCI8.new("ruby/ruby@10.1.1.3").exec("select * from session_privs") do |r| puts r.join(","); end'
  CREATE SESSION
  UNLIMITED TABLESPACE
  CREATE TABLE
  CREATE CLUSTER
  CREATE SEQUENCE
  CREATE PROCEDURE
  CREATE TRIGGER
  CREATE TYPE
  CREATE OPERATOR
  CREATE INDEXTYPE
  </pre>
  
  <p>Note that I can verify connection using the command above. However, I cannot create a new model using the "rails generate model Post title:string text:text" command - I get a long list of errors which complain that my "adapter" is not valid.</p>
  
  <p>Questions:</p>
  
  <p>Q1. What do I have to put in the Gemfile?</p>
  
  <p>Q2. Should I see ruby-oci8 gem in the output of the command "bundle install" - currently I can see "Using sqlite3 (1.3.9) and there also 2 entries in the Gemfile as follows:</p>
  
  <pre>
  # Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
  gem 'rails', '4.0.2'
  
  # Use sqlite3 as the database for Active Record
  gem 'sqlite3'
  </pre>
  
  <p>Q3. Has anyone successfully configured database.yml to work with Oracle XE? Please share it with me.</p>
  
  <p>Thanks in advance for your help,<br>
  Roobie</p>