Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7879161
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T03:50:26+00:00 2026-06-03T03:50:26+00:00

Everything works fine on my OS X development laptop. Deploy the app to production

  • 0

Everything works fine on my OS X development laptop.

Deploy the app to production and it runs and displays data as expected.

However, when I try to run the Rails console on the production server I get an error…

$ rails console -e production
/opt/deployed_rails_apps/con_app_rails_3/shared/bundle/ruby/1.9.1/gems/mysql2-0.3.11/lib/mysql2/client.rb:44:
    in `connect': Can't connect to local MySQL server through socket 
        '/tmp/mysql.sock' (2) (Mysql2::Error)

    from /opt/deployed_rails_apps/con_app_rails_3/shared/bundle/ruby/1.9.1/gems/mysql2-0.3.11/lib/mysql2/client.rb:44:in `initialize'
    from /opt/deployed_rails_apps/con_app_rails_3/shared/bundle/ruby/1.9.1/gems/activerecord-3.2.2/lib/active_record/connection_adapters/mysql2_adapter.rb:16:in `new'

I tried removing socket: /tmp/mysql.sock from database.yml — same result.

Although the app runs, I do need to be able to access the console in production as well to perform certain tasks.

I am able to connect to the MySQL server using the MySQL command line client.


ruby 1.9.3p125

Rails 3.2.2

mysql2 gem 0.3.11

MySQL server: 5.1.61

Production host: Linux 2.6.32-220.4.2.el6.x86_64

database.yml

development:
  adapter: mysql2
  encoding: utf8
  reconnect: false
  database: con_app_rails_3_development
  pool: 5
  username: root
  password:
  socket: /tmp/mysql.sock

test:
  adapter: mysql2
  encoding: utf8
  reconnect: false
  database: con_app_rails_3_test
  pool: 5
  username: root
  password:
  socket: /tmp/mysql.sock

production:
  adapter: mysql2
  encoding: utf8
  reconnect: false
  host: dbhost
  database: con_app_rails_3_production
  pool: 5
  username: xxxx
  password: xxxx
  socket: /tmp/mysql.sock
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-03T03:50:27+00:00Added an answer on June 3, 2026 at 3:50 am

    Solved it.

    All I needed to do was…

    $ RAILS_ENV=production bundle exec rails console
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Everything works fine in development mode, but when I try to start my app
In my development environment, which is windows 7, Ruby1.9.2p180, everything works fine. However, in
When I run the app in dev mode (./manage.py runserver 0.0.0.0:9090) everything works fine.
When I run SquishIt in development mode everything works fine. When I put it
I developed an iPhone application using PhoneGap everything works fine, I sent the app
I am trying to do versioning with NHibernate and everything works fine, however right
I have code using JPA and everything works fine in my development environment and
Using the development server, it works with debug=True or False. In production, everything works
Everything works fine in development mode! Fake transactions were successful, and I got receipts
On my development machine everything works fine. On the live server (Godaddy), the AJAX

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.