Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Ruby > Remote MySQL server and Ruby on Rails

Reply
Thread Tools

Remote MySQL server and Ruby on Rails

 
 
wedix@mac.com
Guest
Posts: n/a
 
      06-23-2008
Hello,

I have 1 DB server (MySQL) and 1 server with my application. I've
setup the host in my database.yml file to match my DB server. When I
run the application, I get this error:

Errno::ENOENT in TestController#index
No such file or directory - /tmp/mysql.sock

--- Full Trace ---
/usr/local/lib/ruby/gems/1.8/gems/activerecord-2.1.0/lib/active_record/
vendor/mysql.rb:107:in `initialize'
/usr/local/lib/ruby/gems/1.8/gems/activerecord-2.1.0/lib/active_record/
vendor/mysql.rb:107:in `new'
/usr/local/lib/ruby/gems/1.8/gems/activerecord-2.1.0/lib/active_record/
vendor/mysql.rb:107:in `real_connect'
/usr/local/lib/ruby/gems/1.8/gems/activerecord-2.1.0/lib/active_record/
connection_adapters/mysql_adapter.rb:505:in `connect'
/usr/local/lib/ruby/gems/1.8/gems/activerecord-2.1.0/lib/active_record/
connection_adapters/mysql_adapter.rb:183:in `initialize'
/usr/local/lib/ruby/gems/1.8/gems/activerecord-2.1.0/lib/active_record/
connection_adapters/mysql_adapter.rb:88:in `new'
/usr/local/lib/ruby/gems/1.8/gems/activerecord-2.1.0/lib/active_record/
connection_adapters/mysql_adapter.rb:88:in `mysql_connection'
/usr/local/lib/ruby/gems/1.8/gems/activerecord-2.1.0/lib/active_record/
connection_adapters/abstract/connection_specification.rb:292:in `send'
/usr/local/lib/ruby/gems/1.8/gems/activerecord-2.1.0/lib/active_record/
connection_adapters/abstract/connection_specification.rb:292:in
`connection='
/usr/local/lib/ruby/gems/1.8/gems/activerecord-2.1.0/lib/active_record/
connection_adapters/abstract/connection_specification.rb:260:in
`retrieve_connection'
/usr/local/lib/ruby/gems/1.8/gems/activerecord-2.1.0/lib/active_record/
connection_adapters/abstract/connection_specification.rb:78:in
`connection'
/usr/local/lib/ruby/gems/1.8/gems/activerecord-2.1.0/lib/active_record/
query_cache.rb:8:in `cache'
/usr/local/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/
action_controller/caching/sql_cache.rb:12:in `perform_action'
/usr/local/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/
action_controller/base.rb:529:in `send'
/usr/local/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/
action_controller/base.rb:529:in `process_without_filters'
/usr/local/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/
action_controller/filters.rb:569:in
`process_without_session_management_support'
/usr/local/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/
action_controller/session_management.rb:130:in `process'
/usr/local/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/
action_controller/base.rb:389:in `process'
/usr/local/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/
action_controller/dispatcher.rb:149:in `handle_request'
/usr/local/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/
action_controller/dispatcher.rb:107:in `dispatch'
/usr/local/lib/ruby/1.8/thread.rb:135:in `synchronize'
/usr/local/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/
action_controller/dispatcher.rb:104:in `dispatch'
/usr/local/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/
action_controller/dispatcher.rb:120:in `dispatch_cgi'
/usr/local/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/
action_controller/dispatcher.rb:35:in `dispatch'
/usr/local/lib/ruby/gems/1.8/gems/rails-2.1.0/lib/fcgi_handler.rb:
103:in `process_request'
/usr/local/lib/ruby/gems/1.8/gems/rails-2.1.0/lib/fcgi_handler.rb:
153:in `with_signal_handler'
/usr/local/lib/ruby/gems/1.8/gems/rails-2.1.0/lib/fcgi_handler.rb:
101:in `process_request'
/usr/local/lib/ruby/gems/1.8/gems/rails-2.1.0/lib/fcgi_handler.rb:
78:in `process_each_request'
/usr/local/lib/ruby/gems/1.8/gems/fcgi-0.8.7/lib/fcgi.rb:612:in
`each_cgi'
/usr/local/lib/ruby/gems/1.8/gems/fcgi-0.8.7/lib/fcgi.rb:609:in `each'
/usr/local/lib/ruby/gems/1.8/gems/fcgi-0.8.7/lib/fcgi.rb:609:in
`each_cgi'
/usr/local/lib/ruby/gems/1.8/gems/rails-2.1.0/lib/fcgi_handler.rb:
77:in `process_each_request'
/usr/local/lib/ruby/gems/1.8/gems/rails-2.1.0/lib/fcgi_handler.rb:
76:in `catch'
/usr/local/lib/ruby/gems/1.8/gems/rails-2.1.0/lib/fcgi_handler.rb:
76:in `process_each_request'
/usr/local/lib/ruby/gems/1.8/gems/rails-2.1.0/lib/fcgi_handler.rb:
50:in `process!'
/usr/local/lib/ruby/gems/1.8/gems/rails-2.1.0/lib/fcgi_handler.rb:
24:in `process!'
/path/to/my/public_html/public/dispatch.fcgi:26
--- ---

--- database.yml ---
development:
adapter: mysql
encoding: utf8
database: Test_App_development
username: root
password:
host: dbserver

test:
adapter: mysql
encoding: utf8
database: Test_App_test
username: root
password:
host: dbserver

production:
adapter: mysql
encoding: utf8
database: Test_App_production
username: root
password:
host: dbserver
--- ---

The MySQL gem is installed. I'm not sure what's wrong...

Any help is appreciated!

Thank you,


- wedix
 
Reply With Quote
 
 
 
 
kranthi reddy
Guest
Posts: n/a
 
      06-25-2008
[Note: parts of this message were removed to make it a legal post.]

I think the socket on which your remote server is different from
/tmp/mysql.sock.
Just check with the socket and then place the same thing on the database.yml
 
Reply With Quote
 
 
 
 
Roger Pack
Guest
Posts: n/a
 
      06-26-2008
> production:
> adapter: mysql
> encoding: utf8
> database: Test_App_production
> username: root
> password:
> host: dbserver


You may need to specify a port number, and/or protocol: tcp. GL!
-R
--
Posted via http://www.ruby-forum.com/.

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Ruby mysql to remote server John Sayeau Ruby 2 11-10-2010 07:17 PM
Ruby on Rails Developer – London – Upto £55k – Ruby on Rails Jason Wong Ruby 0 11-20-2007 11:01 AM
Ruby on rails and rails are same damod.php@gmail.com Ruby 2 02-24-2007 03:31 PM
Rails and Ruby in Germany -> Rails is Ruby killer application Josef 'Jupp' SCHUGT Ruby 5 01-24-2006 11:13 PM
mysql-ruby or ruby-mysql? Randy Lawrence Ruby 3 05-24-2004 03:30 PM



Advertisments