Wednesday, August 19, 2009

Ruby - Rails - PostgreSQL Issues

I encountered a couple of issues with the development stack. Luckily, I was able to solve them since they were documented on the web. By way of review, my development environment is as follows:
Operating System: Windows XP
Ruby: 1.8.6
Rails: 2.3.3
PostgreSQL: 8.4.0

A) The first error occured when starting WEBrick server. A pop up message displayed:
ruby.exe Ordinal Not Found
The ordinal 284 could not be located in the dynamic link library SSLEAY32.DLL

Searching the web led me to this post at Stackoverflow. My solution was to:

1) Rename libeay32.dll and ssleay32.dll in both ruby\bin folder and posgresql\lib folder to old_libeay32.dll and old_ssleay32.dll respectively. This way I don't lose these dlls in case my fix doesn't work.

2) Install Visual C++ 2008 Redistributables which can be obtained from Microsoft site. This is needed prior to installing OpenSSL below.

3) Install the latest OpenSSL from Shining Light Productions. I used "Win32 OpenSSL v0.9.8k Light".

4) Copy libeay32.dll and ssleay32.dll from OpenSSL folder to h ruby\bin and posgresql\lib folder.

5) Restart WEBrick server and the error should be gone.


B) The second error occured in the browser when Rails tried to connect to PostgreSQL. I tried to migrate a model using rake db:migrate. An error displayed:
Rake aborted!
undefined method 'quote_indent' for PGconn:class

Searching the web led me to this post at HighDot Forums. My solution was to:

1) Open Rails file config/initializers/new_rails_defaults.rb

2) Add the following code at the end of the file:


# Postgres "quote_indent for PGconn:class" fix from http://www.highdots.com/forums/ruby-rails-talk/quote_ident-283323.html
def PGconn.quote_ident(name)
%("#{name}")
end


After that, I did not experience any other issues with the development environment.

4 comments:

Anonymous said...

Hi System Trader,

Awesome blog with great documentation...

I read all of your blog posts. I am following your foot steps as I am developing the same thing you have described..

I am curious to know your current progress... any plans to post where you are with this project?

Thanks
-- J

System Trader said...

I've had others asking about project status well. I'll post a separate blog entry about this tonight.

Thanks!

Unknown said...

How to Solve Undefined Methods in PostgreSQL? Contact to Postgres SQL Support Linux
Quickly understand the health and performance of your Postgres with Cognegic’s Postgres SQL Support Windows and PostgreSQL Remote Database Service. Our technical experts solve undefined methods in Postgres and make you trouble free. Here we provide remote DBA work, error prevention, bug fixing for our customers. Anytime you can contact to PostgreSQL Relational Database Service and get the top-notch assistance.
For More Info: https://cognegicsystems.com/
Contact Number: 1-800-450-8670
Email Address- info@cognegicsystems.com
Company’s Address- 507 Copper Square Drive Bethel Connecticut (USA) 06801

Bruce David said...

Hello everyone..Welcome to my free masterclass strategy where i teach experience and inexperience traders the secret behind a successful trade.And how to be profitable in trading I will also teach you how to make a profit of $12,000 USD weekly and how to get back all your lost funds feel free to email me on( brucedavid004@gmail.com ) or whataspp number is +22999290178