# Mysql.so: Permission denied (Ruby under Cygwin)

**URL:** <https://www.ruby-forum.com/t/mysql-so-permission-denied-ruby-under-cygwin/107131>\
**Category:** Ruby\
**Created:** [June 18, 2007, 2:17pm UTC](https://www.ruby-forum.com/t/mysql-so-permission-denied-ruby-under-cygwin/107131 "2007-06-18T14:17:57Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![ronaldfischer](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/67e7ee/32.png) [@ronaldfischer](https://www.ruby-forum.com/u/ronaldfischer)\
**Post date:** [June 18, 2007, 2:17pm UTC](https://www.ruby-forum.com/t/mysql-so-permission-denied-ruby-under-cygwin/107131/1 "2007-06-18T14:17:57Z")

</div>

[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

---

<div class="post-metadata">

**Author:** ![ronaldfischer](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/67e7ee/32.png) [@ronaldfischer](https://www.ruby-forum.com/u/ronaldfischer)\
**Post date:** [September 25, 2007, 11:11pm UTC](https://www.ruby-forum.com/t/mysql-so-permission-denied-ruby-under-cygwin/107131/2 "2007-09-25T23:11:11Z")

</div>

> > ```
> > from
> > 
> > ```
> > 
> > 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
