# Ruby and MySql

**URL:** <https://www.ruby-forum.com/t/ruby-and-mysql/168871>\
**Category:** Rails\
**Created:** [May 26, 2009, 11:04pm UTC](https://www.ruby-forum.com/t/ruby-and-mysql/168871 "2009-05-26T23:04:12Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![wsdickerson](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/w/34f0e0/32.png) [@wsdickerson](https://www.ruby-forum.com/u/wsdickerson)\
**Post date:** [May 26, 2009, 11:04pm UTC](https://www.ruby-forum.com/t/ruby-and-mysql/168871/1 "2009-05-26T23:04:12Z")

</div>

Hi there - new to RoR but very excited about it indeed -

I have just manged to install everything.

However, when I browse to [http://localhost:3000/](http://localhost:3000/) then click the “About  
your applicationâ€™s environment” - from the console I get :

Status: 500 Internal Server Error  
no such file to load – mysql

Perhaps someone can tell from my configuration what is wrong ??? What I  
may be missing ??

My configuration is

```
* Mac OSX 10.4.11
* Ruby - v 1.8.6
* Rails
* Mongrel
* RubyGems 1.3.3
* MYSQL 5.0.27

```

database.yml file =

development:  
adapter: mysql  
encoding: utf8  
database: temp\_development  
username: root  
password:  
socket: /tmp/mysql.sock

# Warning: The database defined as ‘test’ will be erased and

# re-generated from your development database when you run ‘rake’.

# Do not set this db to the same as development or production.

test:  
adapter: mysql  
encoding: utf8  
database: temp\_test  
username: root  
password:  
socket: /tmp/mysql.sock

production:  
adapter: mysql  
encoding: utf8  
database: temp\_production  
username: root  
password:  
socket: /tmp/mysql.sock

Many thanks in advance

Glorifindal

---

<div class="post-metadata">

**Author:** ![wsdickerson](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/w/34f0e0/32.png) [@wsdickerson](https://www.ruby-forum.com/u/wsdickerson)\
**Post date:** [May 26, 2009, 11:16pm UTC](https://www.ruby-forum.com/t/ruby-and-mysql/168871/2 "2009-05-26T23:16:01Z")

</div>

Does the database exist that you are connecting to?  
#\> mysqladmin create temp\_development

also ensure you have the mysql gem installed (current versions of  
rails require the native gem)

#\> sudo gem install mysql

lastly make sure your project can communicate with the database  
rake db:migrate

If all is well the only thing you should have to do in the future is  
ensure the database exists with the mysqladmin command.

On May 26, 2:04 pm, William D. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)

---

<div class="post-metadata">

**Author:** ![wsdickerson](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/w/34f0e0/32.png) [@wsdickerson](https://www.ruby-forum.com/u/wsdickerson)\
**Post date:** [May 26, 2009, 11:17pm UTC](https://www.ruby-forum.com/t/ruby-and-mysql/168871/3 "2009-05-26T23:17:11Z")

</div>

On May 26, 10:04 pm, William D. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
wrote:

> Perhaps someone can tell from my configuration what is wrong ??? What I  
> may be missing ??

looks like you’re missing the mysql gem (ruby bindings for the mysql  
library)

Fred

---

<div class="post-metadata">

**Author:** ![wsdickerson](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/w/34f0e0/32.png) [@wsdickerson](https://www.ruby-forum.com/u/wsdickerson)\
**Post date:** [May 27, 2009, 12:23am UTC](https://www.ruby-forum.com/t/ruby-and-mysql/168871/4 "2009-05-27T00:23:25Z")

</div>

Hey guys - that was a fast answer -

with your help, and with this link

[http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-talk/249986](http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-talk/249986)

I got it running - MANY MANY thanks

Glorifindal
