problems with oracle xe server connection

i'm working on ubuntu 11.04; i need to create some rails application
with oracle database on local computer.
i installed: ruby 1.9.2, rails 3.1, oracle 10g XE, rubu-oci8 2.0.6,
gem 'activerecord-oracle_enhanced-adapter', create database user named
'orak' with password 'orakpass' through 127.0.0.1:8080/apex, i maked
new application 'orak' with database.yml parameters
development:
  adapter: oracle_enhanced
  database: 127.0.0.1/orak
  username: orak
  password: oraclepass
test:
  adapter: oracle_enhanced
  database: 127.0.0.1/orak
  username: orak
  password: oraclepass
production:
  adapter: oracle_enhanced
  database: 127.0.0.1/orak
  username: orak
  password: oraclepass
next i'm doing simple scaffold, and trying to rake db:create
result:
rake db:create
Please provide the SYSTEM password for your oracle installation

oraclepass

rake aborted!
ORA-12514: TNS:listener does not currently know of service requested
in connect descriptor
Tasks: TOP => db:create
(See full trace by running task with --trace)
but I can connect with sqlplus orak/oraclepass@127.0.0.1
i had not work with oracle before, i had search with the google hard
and not found answer.
what i'm doing wrong?

I have designed a simple rails 3 app that displays information about all of the talks for the upcoming RubyConf 2011 in New Orleans.

I did it so that I could have quick access to information about each talk and because 3 talks are scheduled in different rooms at each given time, I have assigned a field intitled "priority" which contains values 0,1, or 2 (descending order of importance, 0 being most important) depending on which talks I would prefer to attend at a given time slot.

This is working for my personal choices and can be seen here:

http://sf.gcdsystems.com:3000

I would like to make this more useful by adding a new table for users that would contain a comma separated string of "priorities" associated with each id of "talks" table, so that I could display the data properly for multiple users. I will need to add user validation, etc..., but that I have done before and can do again.

The initial display should display the data sorted by priority,time (it does this now, but is setup to work for only for one user).

The priority field in the "talks" table needs to be moved to the users table, where I can store it in a text field as a string of numbers in talks.id order.

The users table would contain such things as firstname, lastname, username, password, and priorities.

If anyone could suggest a rails form helper or a optimal approach that would allow me to collect, store and display the data so that I could have multiple users, each with their own set of priorities, displayed as mine are now, it would be a great help.

I have shortened some of the titles for the sake of brevity. If any of the Railsconf 2011 speakers would like me to use a different image for them, email me your preferred image. If I am missing your image, please email me one that I can use. :wink:

Once I've got this latest part working, I'll make the sources available on GitHub along with the data in MySQL format.

-- Steve
s.d@comcast.net

i installed: ruby 1.9.2, rails 3.1, oracle 10g XE, rubu-oci8 2.0.6,
gem 'activerecord-oracle_enhanced-adapter', create database user named
'orak' with password 'orakpass' through 127.0.0.1:8080/apex, i maked
new application 'orak' with database.yml parameters

ORA-12514: TNS:listener does not currently know of service requested
in connect descriptor
Tasks: TOP => db:create
(See full trace by running task with --trace)

The full trace would probably be useful, and -- disclaimer: I haven't
done anything with Rails 3.1 yet *at all* -- but try something like e.g.

development:
database: 127.0.0.1/orak

    database: oracle:thin:@127.0.0.1:8080:xe

just for grins and see what that produces.

The oracle:thin syntax is usually for JDBC connections in my experience. Per the readme and my own experience, you’ll want to specify 1 of 4 possible formats.

  1. just the TNS name as the database key like ‘xe’ if you have the TNS_ADMIN environment variable set to point to where your tnsnames.ora file is located, and it contains the TNS descriptor for your server

  2. the url, port, and SID for the database, like '//localhost:1521/xe

  3. the url, port, and SID as 3 different config keys, database: xe, host: 127.0.0.1, port: 1521

  4. The full TNS descriptor (DESCRIPTION = … )

I’ve had the most luck with option 4 since it is the most explicit. I’ve had cases where TNS_ADMIN wasn’t set right or the ruby process wasn’t getting that environment variable (like when running under apache) and even when forcing it to be set, things still weren’t right. It should be as easy as specifying the TNS name, but I have not found that to always be the case.