"193: %1 is not a valid Win32 application" bug with a new Rails Application

Solution 1:

Here's the answer that worked for me. Turns out it was an issue of x64 vs. x32 issue and Rails 2.3.2.

The answer I got from here (http://osdir.com/ml/RubyonRailsTalk/2009-06/msg01775.html):

In case anyone else has the same problem after a lot of struggling on my Windows XP x64 machine, with MySQL 5.1.30 (x64) and Rails 2.3.2 installed, this above suggestiong helped me. Download libMySql.dll from here (http://instantrails.rubyforge.org/svn/trunk/InstantRails-win/InstantRails/mysql/bin/) and putting it in ruby\bin solved the problem.

Solution 2:

Solved by following the directions on this blog here: http://blog.mmediasys.com/2011/07/07/installing-mysql-on-windows-7-x64-and-using-ruby-with-it/

which involves using the non installer version of the MySQL Connector http://dev.mysql.com/downloads/connector/c/

I could not get webrick to run on x64 Windows 7 system -- got the same error

"193: %1 is not a valid Win32 application”

If I just replaced the file libmysql.dll (as suggested in posts above), I got a different error.

"Incorrect MySQL client library version!"

My Path set like this: C:\Ruby187\bin;C:\Program Files\MySQL\MySQL Server 5.5\bin;C:\Ruby187\lib\ruby\gems\1.8\gems\rails-3.1.1\bin

(didn't need to change the path again)

Solution 3:

This error occurs if you have a file with name "Program" in the root of your drive. Say for example you are trying to execute "C:\Program Files\SomeApp\Bin\SomeExe.Exe" it tries to execute "C:\Program" if it exists. In some situations a file with this name get created if you forget to quote "C:\Program Files..." with some commandline commands. This of course also applies for you D: drive, etc.

This error often occurs if you try to start services, but may occur in other situations.

Simply deleting the file C:\Program or D:\Program etc. solves the problem.