# Can't connect with MySQL database

**URL:** <https://www.ruby-forum.com/t/cant-connect-with-mysql-database/176435>\
**Category:** Rails\
**Created:** [September 30, 2009, 3:16pm UTC](https://www.ruby-forum.com/t/cant-connect-with-mysql-database/176435 "2009-09-30T15:16:01Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![dangermoose](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/e79b87/32.png) [@dangermoose](https://www.ruby-forum.com/u/dangermoose)\
**Post date:** [September 30, 2009, 3:16pm UTC](https://www.ruby-forum.com/t/cant-connect-with-mysql-database/176435/1 "2009-09-30T15:16:01Z")

</div>

I just installed MySQL and its drivers on a Mac OS X Leopard. When I  
issued my rails command to build a new app, then issued the script/  
server command and connected to my localhost:3000 in the browser, I  
saw the following problem with MySQL.

I changed/updated the PATH in nano, and it can see MySQL fine. So I  
really don’t understand the problem.

Can you tell me what I need to do?

## Thank you.

MissingSourceFile in Rails/infoController#properties

no such file to load – mysql  
RAILS\_ROOT: /Users/pdenlinger/Sites/In\_Development/my\_app1  
Application Trace | Framework Trace | Full Trace  
/Library/Ruby/Site/1.8/rubygems/custom\_require.rb:31:in  
`gem_original_require' /Library/Ruby/Site/1.8/rubygems/custom_require.rb:31:in`require’  
/Library/Ruby/Gems/1.8/gems/activesupport-2.2.2/lib/active\_support/  
dependencies.rb:153:in `require' /Library/Ruby/Gems/1.8/gems/activesupport-2.2.2/lib/active_support/ dependencies.rb:521:in`new\_constants\_in’  
/Library/Ruby/Gems/1.8/gems/activesupport-2.2.2/lib/active\_support/  
dependencies.rb:153:in `require' /Library/Ruby/Gems/1.8/gems/activesupport-2.2.2/lib/active_support/ core_ext/kernel/requires.rb:7:in`require\_library\_or\_gem’  
/Library/Ruby/Gems/1.8/gems/activesupport-2.2.2/lib/active\_support/  
core\_ext/kernel/reporting.rb:11:in `silence_warnings' /Library/Ruby/Gems/1.8/gems/activesupport-2.2.2/lib/active_support/ core_ext/kernel/requires.rb:5:in`require\_library\_or\_gem’  
/Library/Ruby/Gems/1.8/gems/activerecord-2.2.2/lib/active\_record/  
connection\_adapters/mysql\_adapter.rb:63:in `mysql_connection' /Library/Ruby/Gems/1.8/gems/activerecord-2.2.2/lib/active_record/ connection_adapters/abstract/connection_pool.rb:223:in`send’  
/Library/Ruby/Gems/1.8/gems/activerecord-2.2.2/lib/active\_record/  
connection\_adapters/abstract/connection\_pool.rb:223:in  
`new_connection' /Library/Ruby/Gems/1.8/gems/activerecord-2.2.2/lib/active_record/ connection_adapters/abstract/connection_pool.rb:245:in`checkout\_new\_connection’  
/Library/Ruby/Gems/1.8/gems/activerecord-2.2.2/lib/active\_record/  
connection\_adapters/abstract/connection\_pool.rb:188:in `checkout' /Library/Ruby/Gems/1.8/gems/activerecord-2.2.2/lib/active_record/ connection_adapters/abstract/connection_pool.rb:184:in`loop’  
/Library/Ruby/Gems/1.8/gems/activerecord-2.2.2/lib/active\_record/  
connection\_adapters/abstract/connection\_pool.rb:184:in `checkout' /Library/Ruby/Gems/1.8/gems/activerecord-2.2.2/lib/active_record/ connection_adapters/abstract/connection_pool.rb:183:in`checkout’  
/Library/Ruby/Gems/1.8/gems/activerecord-2.2.2/lib/active\_record/  
connection\_adapters/abstract/connection\_pool.rb:98:in `connection' /Library/Ruby/Gems/1.8/gems/activerecord-2.2.2/lib/active_record/ connection_adapters/abstract/connection_pool.rb:326:in`retrieve\_connection’  
/Library/Ruby/Gems/1.8/gems/activerecord-2.2.2/lib/active\_record/  
connection\_adapters/abstract/connection\_specification.rb:121:in  
`retrieve_connection' /Library/Ruby/Gems/1.8/gems/activerecord-2.2.2/lib/active_record/ connection_adapters/abstract/connection_specification.rb:113:in`connection’  
/Library/Ruby/Gems/1.8/gems/activerecord-2.2.2/lib/active\_record/  
query\_cache.rb:8:in `cache' /Library/Ruby/Gems/1.8/gems/actionpack-2.2.2/lib/action_controller/ caching/sql_cache.rb:12:in`perform\_action’  
/Library/Ruby/Gems/1.8/gems/actionpack-2.2.2/lib/action\_controller/  
base.rb:524:in `send' /Library/Ruby/Gems/1.8/gems/actionpack-2.2.2/lib/action_controller/ base.rb:524:in`process\_without\_filters’  
/Library/Ruby/Gems/1.8/gems/actionpack-2.2.2/lib/action\_controller/  
filters.rb:606:in `process_without_session_management_support' /Library/Ruby/Gems/1.8/gems/actionpack-2.2.2/lib/action_controller/ session_management.rb:134:in`process’  
/Library/Ruby/Gems/1.8/gems/actionpack-2.2.2/lib/action\_controller/  
base.rb:392:in `process' /Library/Ruby/Gems/1.8/gems/rails-2.2.2/lib/webrick_server.rb:74:in`service’  
/Library/Ruby/Gems/1.8/gems/rails-2.2.2/lib/commands/servers/  
webrick.rb:66  
/Library/Ruby/Gems/1.8/gems/activesupport-2.2.2/lib/active\_support/  
dependencies.rb:153:in `require' /Library/Ruby/Gems/1.8/gems/activesupport-2.2.2/lib/active_support/ dependencies.rb:521:in`new\_constants\_in’  
/Library/Ruby/Gems/1.8/gems/activesupport-2.2.2/lib/active\_support/  
dependencies.rb:153:in `require’  
/Library/Ruby/Gems/1.8/gems/rails-2.2.2/lib/commands/server.rb:49  
This error occurred while loading the following files:  
mysql

---

<div class="post-metadata">

**Author:** ![dangermoose](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/e79b87/32.png) [@dangermoose](https://www.ruby-forum.com/u/dangermoose)\
**Post date:** [October 1, 2009, 3:27am UTC](https://www.ruby-forum.com/t/cant-connect-with-mysql-database/176435/2 "2009-10-01T03:27:19Z")

</div>

Paul D. wrote:

> I just installed MySQL and its drivers on a Mac OS X Leopard. When I  
> issued my rails command to build a new app, then issued the script/  
> server command and connected to my localhost:3000 in the browser, I  
> saw the following problem with MySQL.
> 
> I changed/updated the PATH in nano, and it can see MySQL fine. So I  
> really don’t understand the problem.
> 
> Can you tell me what I need to do?
> 
> ## Thank you.
> 
> MissingSourceFile in Rails/infoController#properties
> 
> no such file to load – mysql  
> […]

You’ve made the same common mistake that many others on this list have  
made. 🙂 The file that Rails can’t load is not the mySQL app itself,  
but rather the mysql gem (which contains the libraries that tell Ruby  
how to talk to the DB). Install the gem and all should be well.

But you probably should be using PostgreSQL anyway. It’s a _much_  
better DB.

## Best,

Marnen Laibow-Koser  
[http://www.marnen.org](http://www.marnen.org)  
removed\_email\_address@domain.invalid
