rails 2.1.2 to rails 2.2.2 now I get mysql issues

After opening http://localhost:3000/ in browser, under About your application's environment get this error: LoadError in Rails/infoController#properties 193: %1 is not a valid Win32 application. - C:/jinstalled/ruby/lib/ruby/gems/1.8/gems/mysql-2.7.3-x86-mswin32/ext/mysql.soRAILS_ROOT: c:/Jinstalled/Apache Software Foundation/Apache2.2/htdocs/shovell

get the following when I jump into my ruby application(i.e localhost:3000/stories/ ) 193: %1 is not a valid Win32 application. - C:/jinstalled/ruby/lib/ruby/gems/1.8/gems/mysql-2.7.3-x86-mswin32/ext/mysql.so

My setup. I'm running Windows Vista Ultimate x64 edition(still crap).

I had rails 2.1.2 and updated to 2.2.2 and now get the above error. Ruby -v = 1.8.6 gem -v = 1.3.1 I have mysql-essential-5.0.67-winx64 The service is up and running and I can log in and manipulate the database just fine.

if I run ruby script\console

require 'rubygems'

=>

require 'mysql'

I get a popup that says: ruby.exe - Unable to Locate component This application has failed to start because LIBMYSQL.dll was not found. re-installing the application may fix this problem.

after clicking ok or continue the console spits out: LoadError: 193: %1 is not a valid Win32 application. - C:/Jinstalled/Ruby/lib/ruby/gems/1.8/gems/mysql-2.7.3-x86-mswin 32/ext/mysql.so         from C:/Jinstalled/Ruby/lib/ruby/gems/1.8/gems/mysql-2.7.3-x86-mswin32/ext/mysql.so         from C:/Jinstalled/Ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:36:in `require'         from C:/Jinstalled/Ruby/lib/ruby/gems/1.8/gems/activesupport-2.2.2/lib/active_support/dependencies.rb:153:in `re quire'         from C:/Jinstalled/Ruby/lib/ruby/gems/1.8/gems/activesupport-2.2.2/lib/active_support/dependencies.rb:521:in `ne w_constants_in'         from C:/Jinstalled/Ruby/lib/ruby/gems/1.8/gems/activesupport-2.2.2/lib/active_support/dependencies.rb:153:in `re quire'         from (irb):2

my env path is(relevant info only)

path

PATH=C:\jinstalled\MySQL\MySQL Server 5.0\bin;C:\jinstalled\ruby\bin

I've copied over a copy of libmysql.dll from the mysql bin into the ruby/bin as well.

Anyone know how to fix this issues?

Anyone know anywhere else I might be able to post this question and get a response? I'd really like to get back to development, and would prefer not to have to roll back to Rails 2.1.2.

thanks, Jason

You wrote that you’re running Vista 64-bit and mysql-essential-5.0.67-winx64, yet the gem seems to be for win32: mysql-2.7.3-x86-

mswin32. Could it be that you need a mysql gem for win64 (is there one?) or that you need to run mysql for win32 instead of win64? Just guessing really, since I don’t run Windows.

Regards, Craig

Craig Demyanovich wrote:

You wrote that you're running Vista 64-bit and mysql-essential-5.0.67-winx64, yet the gem seems to be for win32: mysql-2.7.3-x86-mswin32. Could it be that you need a mysql gem for win64 (is there one?) or that you need to run mysql for win32 instead of win64? Just guessing really, since I don't run Windows.

Regards, Craig

Well I am running mysql x64, unfortunately there isn't a proper 64 bit gem(I've searched). What I don't understand though is how it was running fine with just an error message(not an error but the deprecation warning) under 2.1.2 and now won't function at all. So I'm hoping to find some workaround so that I can continue using the 64 bit Mysql(for perfomance). Otherwise I guess I can just roll back from 2.2.2 but would like to avoid this as I like what 2.2.2 brings to the table and as I'm learning ruby and playing with rails don't want to be able to update to the latest code base's.

thanks, Jason

Craig Demyanovich wrote: > You wrote that you're running Vista 64-bit and > mysql-essential-5.0.67-winx64, yet the gem seems to be for win32: > mysql-2.7.3-x86-mswin32. Could it be that you need a mysql gem for win64 > (is > there one?) or that you need to run mysql for win32 instead of win64? > Just > guessing really, since I don't run Windows.

> Regards, > Craig

Well I am running mysql x64, unfortunately there isn't a proper 64 bit gem(I've searched). What I don't understand though is how it was running fine with just an error message(not an error but the deprecation warning) under 2.1.2 and now won't function at all. So I'm hoping to

2.1.2 and earlier bundled a pure ruby mysql driver which would be loaded if the native one couldn't be (usually this would be because the native one wasn't there, but any sort of load error would trigger the fallback), but 2.2 no longer bundles it.

find some workaround so that I can continue using the 64 bit Mysql(for perfomance). Otherwise I guess I can just roll back from 2.2.2 but would like to avoid this as I like what 2.2.2 brings to the table and as I'm learning ruby and playing with rails don't want to be able to update to the latest code base's.

it shouldn't be an issue running a 32bit client against a 64bit server.

http://support.microsoft.com/kb/325680 and System Error Codes (0-499) (WinError.h) - Win32 apps | Microsoft Learn implies this error can be triggered by having folders with 'bad' names

Fred

Frederick Cheung wrote: >> > Craig

I did look at both of these links earlier in my search to fix this problem, one or both of these links....can't quite remember. Anyways I think it may relate to this problem, but the problem only happens while running Rails and its currently looking for the mysql driver(?)

Which could indicate that it's along the path to where the mysql libraries (as in the ones that come with mysql itself) that windows gets lost. I suppose one possibility would be if ruby was a x32 application but the mysql libraries (not the gems) it was trying to load were x64. If so then installing the 32bit version of mysql might help (but still keep running the x64 server). Don't know really, not a windows expert :slight_smile:

possibly. As the Mysqlx64 service is up and running just fine in Vista and I currently have no database issues except when Rails/Ruby.exe complains about mysql when the script/console and servers are running. So is there a way I can force 2.2.2 to load some fallback mysql driver,

You might be able to poach the pure ruby driver out of rails 2.1.2

Fred

Frederick Cheung wrote:

UPDATE!!!!!!

Here is what I did and everything is working. I uninstalled Mysqlx64 and Ruby. ran into an issue where Vista kept the service for Mysql even after I unistalled it, so I had to go into the registry and manually delete the service entry. Then I was able to install mysql-essential-5.1.30-win32. After installation I checked to make sure everything was fine, there is only one small error and that is when you do a version check

mysql -v

ERROR 1045 (28000): Access denied for user 'ODBC'@'localhost' (using password: NO)

This is no big deal as I can access the mysql database using

mysql -u admin -p #and then providing the password, also can get in using the mysql command line client after providing password.

next I installed Ruby 1.8.6, I tried grabbing 1.8.7 but there is no one-click installer and I had issues with the binary so decided to stay with 1.8.6

Then I ran:

gem install rubygems-update update_rubygems gem install rails gem install mysql

# which has an ERROR: While generating documentation for mysql-2.7.3-x86-mswin32 ... MESSAGE: Unhandled special: Special: type=17, text="<!-- $Id: README.html,v 1.20 2006-12-20 05:31:52 tommy Exp $ -->" ........... (continuing with the rest of the installation)

gem install mongrel --include-dependencies

#this also appears to be no big deal, as it only affects documentation.

Then I launched the Server, head to localhost:3000 click on about your app and everything appears rosy, no apparent mysql issues and all the versions look good...until you run rake db:migrate then run into the undefined method 'each' for #<Mysql:0x609076c>

which apparently is a problem only when running mysql 5.1 and rails 2.2.2(maybe 2.1.2 not checking) so I need to back that out to 5.0.67 and then.....hopefully everything will be good....until I have to update any component in this equation.

so thats the update, enjoy. Jason

So my final notes as of Dec 05, 2008 to get Ruby, Rails, Mysql working on Windows Vista Ultimate x64 edition.

MySQL x64 will work fine on it's own, but not with the latest versions of Ruby on rails, as the mysql driver is for 32 bit only. So you have grab an older version[ MySQL 5.0.67 win32(I installed essential)], as 5.1.30-win32 won't play nice with Rails. After installing you need to reboot, then you run the instance script to configure MySQL.

Then you can install/update Ruby and Rails and all the gems as you'd like.

I currently have Ruby 1.8.6 (there is no one step installer for ruby 1.8.7 and I had some issues with the binaries) Rails 2.2.2 Gem 1.3.1 ( had to first run >gem install rubygems-update then

update_rubygems to update from 1.2.0 gems )

also ran

gem install mysql gem install mongrel

Don't forget to make sure the PATH is updated and points to both your mysql/bin directory and ruby/bin directories. You can just pop open a command prompt and type path to see if it is set.

I noticed that you've already managed to resolve the issue, but I also had a similar problem upgrading to 2.2.2 and found a quick work- around. Here is my solution in case others need help (if this doesn't work, try Jason Smith's method).

Funny, I had same problem but neede the opposite solution: I copied libmysql.dll from msyql/bin to ruby/bin.

Either way, that's a bit less drastic than nuking and reinstalling mysql and ruby, so worth trying first.

Ed wrote:

Funny, I had same problem but neede the opposite solution: I copied libmysql.dll from msyql/bin to ruby/bin.

Either way, that's a bit less drastic than nuking and reinstalling mysql and ruby, so worth trying first.

If you go back to the first post you'll see libmysql.dll was copied over, but with the 64 bit version of mysql running this does not help at all and you'll still be unable to proceed with rails 2.2.2

I did see read somewhere that someone installed mysqlx64 then installed 32 over it took something out and re-installed 64 bit and from his writeup got 64 bit working with rails, but it wasn't very clear and I was already frustrated enough that I was comfortable dropping back down to 32 bit version of mysql.

jasoo24 wrote:

Here is the solution: 1) First, gem install mysql. If this doesn�t help continue� 2) Copy libmysql.dll from InstantRails (see below) to your mysql directory (C:\mysql\bin\). Restart your computer and it should be working.

InstantRails libmysql.dll: http://instantrails.rubyforge.org/svn/trunk/InstantRails-win/InstantRails/mysql/bin/

On Dec 5, 12:49�pm, Jason Smith <rails-mailing-l...@andreas-s.net>

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.

I had tried copying the libmySQL.dll from my MySQL x64 bin directory to the ruby\bin directory but that didn't help. Instead placing the version from InstantRails URL above into my ruby\bin solved the problem.

Thanks...

+1 - copying from the instant rails download link to ruby/bin worked for me:

Rails 3.0.1 Ruby 1.8.7 (and Ruby 1.9.2, works on both) MySQL 5.5 x64 Windows 7 x64 NetBeans IDE

Thanks! Another Jason S.

Jason S. wrote in post #955144:

+1 - copying from the instant rails download link to ruby/bin worked for me:

Rails 3.0.1 Ruby 1.8.7 (and Ruby 1.9.2, works on both) MySQL 5.5 x64 Windows 7 x64 NetBeans IDE

Thanks! Another Jason S.

ohhh.. long lasting issue..now I am facing this issue

Environment..

Rails 3.0.3 ruby 1.9.2 p136 mysql Ver 14.14 Distrib 5.1.29-rc, for Win32 (ia32) windows vista 32bit

I am getting following error, when I try to do dbconsole.. Couldn't find database client: mysql, mysql5. Check your $PATH and try again.

regards Selvaraj

Install mysql package in your system and then copy mysql5.dll and paste it in the ruby bin folder. And while installing mysql allow it to edit your environment . You are done. The error wont appear and if using netbeans.... Then i really cant help coz stay version 3 and above are not working correctly for many people. Whether these s a bug or something else m still wondering