Remote MySQL server and Ruby on Rails

Discussion in 'Ruby' started by wedix@mac.com, Jun 23, 2008.

  1. Guest

    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
    , Jun 23, 2008
    #1
    1. Advertising

  2. [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
    kranthi reddy, Jun 25, 2008
    #2
    1. Advertising

  3. Roger Pack Guest

    > 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/.
    Roger Pack, Jun 26, 2008
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Randy Lawrence

    mysql-ruby or ruby-mysql?

    Randy Lawrence, May 23, 2004, in forum: Ruby
    Replies:
    3
    Views:
    99
    Randy Lawrence
    May 24, 2004
  2. Josef 'Jupp' SCHUGT
    Replies:
    5
    Views:
    160
    Stephan Kämper
    Jan 24, 2006
  3. Replies:
    2
    Views:
    107
  4. Jason Wong
    Replies:
    0
    Views:
    157
    Jason Wong
    Nov 20, 2007
  5. Luis Lavena
    Replies:
    0
    Views:
    87
    Luis Lavena
    Jul 6, 2009
Loading...

Share This Page