-
-
Save jalcine/3829031 to your computer and use it in GitHub Desktop.
setting-up-a-remote-environment
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ vi ~/.ssh/config | |
# Add the following information | |
Host rails_blog_db | |
HostName 0.0.0.0 # your remote's public facing IP | |
Port 3122 | |
User jjackson # your username | |
LocalForward 3307 192.168.100.1:3306 | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# ~$ touch rails_blog/config/environments/development_remote.rb | |
# ~$ vi config/environments/development_remote.rb | |
# Add this and save! | |
require File.join(File.expand_path(File.dirname(__FILE__)),'development') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# rails_blog/config/database.yml | |
default: &default | |
adapter: mysql | |
username: rails_blog_user | |
password: ENV['your_super_secret_password'] | |
host: 192.168.100.1 | |
development: | |
database: rails_blog_development | |
<<: *default | |
production: | |
database: rails_blog | |
<<: *default | |
# set the database option to your development db and the host to your | |
# ssh forward | |
development_remote: | |
database: rails_blog_development | |
host: 127.0.0.1 | |
port: 3307 # This is where the ssh is forwarding your DB traffic | |
<<: *default |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# rails_blog/config/application.rb | |
require File.expand_path('../boot', __FILE__) | |
require 'rails/all' | |
if defined?(Bundler) | |
# Add your new development_remote environment to the assets hash below | |
Bundler.require(*Rails.groups(:assets => %w(development development_remote test))) | |
end | |
# Rest of file... |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment