Posts

Showing posts from February, 2015

Net::ReadTimeout: Net::ReadTimeout issue in sending mails

Net::ReadTimeout: Net::ReadTimeout issue comes when you are trying to outbound a mail. To solve the issue you need to add a key value pair of tls in your mailer configuration in any environment for ex: 1.)development.rb config.action_mailer.smtp_settings = { :user_name => 'user@domain.com' , :password => 'password' , :address => 'user191@gmail.com' , :domain => 'domain.com' , :port => 465 , :authentication => :login , :enable_starttls_auto => true , :tls => true } 2.)UserMailer.rb default from : "user@domain.com"  

Connecting and Associating multiple databases and their tables in rails(Part 1)

Image
There are several steps that needs to follow to connect with multiple database and create association between two different tables of two different databases First you need to modify your database.yml 1.)database.yml: main_development:    # development configuration goes here secondary_development:    # development configuration to external database goes here # same for test and production... 2.)Models: If you have two different databases the you would have multiple tables in each database and off-Course multiple models in each db now the question is how to establish the connection between two models of two different database . But Rails provide it in easy way #Model in main_database To manually connect each model of main_database with secondary database you need to establish a connection to that database like: class Astronaut < ActiveRecord::Base    establish_connection "nasa_#{Rails.env}" end or create a

The server quit without updating PID file in mysql

This is a common issue with mysql faced by many of the user. The solution is related only with permission of user to solve this issue write command    sudo chown -R _mysql:_mysql /usr/local/var/mysql This command will change the ownership of user and -R option does it recursively within a folder mysql to all sub-folders and files.