Mysql.so: Permission denied (Ruby under Cygwin)

[this message is crossposted to the Cygwin- and RubyTalk mailing lists].

Running Ruby 1.8.6 under Cygwin, i.e.

$ /usr/bin/ruby --version
ruby 1.8.6 (2007-03-13 patchlevel 0) [i386-cygwin]

the statement

  require 'mysql'

raises the following error message:

/usr/lib/ruby/gems/1.8/gems/mysql-2.7.3-mswin32/ext/mysql.so: Permission
denied - /usr/lib/ruby/gems/1.8/gems/mysql-2.7.3-mswin32/ext/mysql.so
(LoadError)
        from
/usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:32:in `require'

The access rights to mysql.so are as follows:

-rw-r--r-- 1 rfischer mkgroup-l-d 81984 May 21 18:08
/usr/lib/ruby/gems/1.8/gems/mysql-2.7.3-mswin32/ext/mysql.so

Using the mysql module with Ruby on Windows outside Cygwin works well.
What could be the reason for this problem?

Ronald

···

--
Ronald Fischer <ronald.fischer@venyon.com>
Phone: +49-89-452133-162

The first problem are the access rights. Shared libs must have the
execute bits set. chmod +x mysql.so will help.

The second problem is that this shared lib has been created for the
native win32 version of ruby, not for the Cygwin version. It *might*
work together, but it's neither guaranteed, nor supported.

The third problem is that right now there's no Cygwin ruby-gems package
in the cygwin net distribution. Volunteers welcome.

Corinna

···

On Jun 18 14:15, Ronald Fischer wrote:

[this message is crossposted to the Cygwin- and RubyTalk mailing lists].

Running Ruby 1.8.6 under Cygwin, i.e.

$ /usr/bin/ruby --version
ruby 1.8.6 (2007-03-13 patchlevel 0) [i386-cygwin]

the statement

  require 'mysql'

raises the following error message:

/usr/lib/ruby/gems/1.8/gems/mysql-2.7.3-mswin32/ext/mysql.so: Permission
denied - /usr/lib/ruby/gems/1.8/gems/mysql-2.7.3-mswin32/ext/mysql.so
(LoadError)
        from
/usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:32:in `require'

The access rights to mysql.so are as follows:

-rw-r--r-- 1 rfischer mkgroup-l-d 81984 May 21 18:08
/usr/lib/ruby/gems/1.8/gems/mysql-2.7.3-mswin32/ext/mysql.so

Using the mysql module with Ruby on Windows outside Cygwin works well.
What could be the reason for this problem?

--
Corinna Vinschen Please, send mails regarding Cygwin to
Cygwin Project Co-Leader cygwin AT cygwin DOT com
Red Hat

> require 'mysql'
>
> raises the following error message:
>
>
/usr/lib/ruby/gems/1.8/gems/mysql-2.7.3-mswin32/ext/mysql.so:
Permission
> denied -
/usr/lib/ruby/gems/1.8/gems/mysql-2.7.3-mswin32/ext/mysql.so
> (LoadError)
> from
>
/usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:32:in `require'
>
> The access rights to mysql.so are as follows:
>
>
> -rw-r--r-- 1 rfischer mkgroup-l-d 81984 May 21 18:08
> /usr/lib/ruby/gems/1.8/gems/mysql-2.7.3-mswin32/ext/mysql.so
>
>
> Using the mysql module with Ruby on Windows outside Cygwin
works well.
> What could be the reason for this problem?

The first problem are the access rights. Shared libs must have the
execute bits set. chmod +x mysql.so will help.

This helped a lot!

The second problem is that this shared lib has been created for the
native win32 version of ruby, not for the Cygwin version. It *might*
work together, but it's neither guaranteed, nor supported.

... which might explain the new behaviour, that the programs starts to
run, but at the end gets a

  ~/thome/importer_tests $ onereq_oneappl.rb
  /usr/lib/ruby/gems/1.8/gems/mysql-2.7.3-mswin32/ext/mysql.so: [BUG]
Segmentation fault
  ruby 1.8.6 (2007-03-13) [i386-cygwin]

I see that I am here still on experimental ground. Maybe the idea of
using mysql from within
Cygwin-Ruby was really not so good in the first place....

Ronald

···

--
Ronald Fischer <ronald.fischer@venyon.com>
Phone: +49-89-452133-162

Ronald Fischer wrote:

I see that I am here still on experimental ground. Maybe the idea of using mysql from within Cygwin-Ruby was really not so good in the first place....

Didn't we, at one time, have an experimental mysql package for Cygwin? Well maybe not a package but I believe there was a mysql monitor program that could at least talk to my running mysqld on my Linux box. I don't recall if there was ever an experimental mysqld for Cygwin. I also seem to recall Brian's name in that past conversation...

I guess another question would be: If we don't have Cygwin packages for both mysql client and mysqld then why not (I can hear the "volunteers welcomed" from here...)

···

--
Andrew DeFaria <http://defaria.com>
We don't like their sound, and guitar music is on the way out. -Decca Recording Co. rejecting the Beatles, 1962.

Andrew DeFaria wrote:

Ronald Fischer wrote:
> I see that I am here still on experimental ground. Maybe the idea of
> using mysql from within Cygwin-Ruby was really not so good in the
> first place....
Didn't we, at one time, have an experimental mysql package for Cygwin?
Well maybe not a package but I believe there was a mysql monitor program
that could at least talk to my running mysqld on my Linux box. I don't
recall if there was ever an experimental mysqld for Cygwin. I also seem
to recall Brian's name in that past conversation...

I guess another question would be: If we don't have Cygwin packages for
both mysql client and mysqld then why not (I can hear the "volunteers
welcomed" from here...)

Well, Cygwin Ports has MySQL client and server packages so you can use
that if you want.

But in this case MySQL was a red herring, it wouldn't have made a
difference either way since the module itself was built against the
native Win32 ruby. But of course having libmysqlclient-dev (or whatever
the package that contains development headers and import libs is named)
installed would be a prerequisite for properly rebuilding the module.

Brian