PDA

View Full Version : Support for Rails & PostgreSQL but not the binddings.


hokoon
09-06-2006, 09:40 PM
I sent email to support team four times about this issue, but nothing reply to me...


Dear support team

Have you ever test running Ruby on Rails application with PostgreSQL?

The applications raise error when I try to use activerecord.
I think it because the rails app can't connect to the database.
I try to make my own test application at http://pgtest.outputstream.net with the following steps.

1. Create PostgreSQL user and database with cPanel (Database: outputst_pgtest, User: outputst_pgtest, Password: pgtest).
2. Generate new rails app with command "rails pgtest"
3. Change "config/database.yml" to look like the following
development:
adapter: postgresql
database: outputst_pgtest
username: outputst_pgtest
password: ********
host: localhost
4. Uncomment the line "config.active_record.default_timezone = :utc" in "config/environment.rb"
5. Generate Controller named "helloworld" and action named "index" with command "ruby ./script/generate controller helloworld index"
6. Change "app/controllers/helloworld_controller.rb" to look like the following
class HelloworldController < ApplicationController
def index
@output = "Establishing DB connection.."
ActiveRecord::Base.establish_connection
@output += "ok!<br/>"
@output += "Testing DB connection .."
begin
tables = ActiveRecord::Base.connection.select_all('SHOW TABLES')
rescue => err
@output += "<br/>===== database connection failed =====<br/>"
@output += "Missing database bindings for #{err.blamed_files}<br/>" if err.message =~ /^uninitialized constant PostgreSQL$/
end
@output += "Database tested OK, found #{tables.size} tables<br/>"
render_text @output
end
end
7. Test the application with http://pgtest.outputstream.net/helloworld


And I get the following message.

MissingSourceFile in HelloworldController#index
no such file to load -- postgres


Please help me solve this problem and post new article to the knowledgebase.

Thank's for help
-Ho




Dear support team,

I got the following message when I try to use PosstgreSQL with Ruby on Rails.

MissingSourceFile in HelloworldController#index
no such file to load -- postgres


by the fllowing mailing list url
http://lists.rubyonrails.org/pipermail/rails/2005-March/004872.html

They said
It appears that the PostgreSQL bindings are not installed (despite your
mention.) Try 'gem install postgres'.


Thank's for help
Anuwat Hokoon

hokoon
09-07-2006, 06:01 AM
Where's the support team?

Reply me some thing...