Skip to content

tonydng/photo_gallery

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

90 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Install

$ git clone git@github.com:tonydng/photo_gallery.git

$ cd tasks

$ bundle

$ rake db:migrate

S3 setup must be done first.

Initial Setup CarrierWave File Upload

Add the following lines to config/initializers/carrierwave.rb

CarrierWave.configure do |config|
  config.fog_credentials = {
    provider: 'AWS',
    aws_access_key_id: ENV['AWS_ACCESS_KEY_ID'],
    aws_secret_access_key: ENV['AWS_SECRET_ACCESS_KEY']
  }
  config.fog_directory = ENV['AWS_S3_BUCKET']
end

Setup AWS to run your application locally

$ sudo gedit ~/.bashrc

Enter these lines at the bottom of .bashrc file

export AWS_ACCESS_KEY_ID=your_access_key_id

export AWS_SECRET_ACCESS_KEY=your_secret_access_key

export AWS_S3_BUCKET=your_bucket_name

$ rails s

From the web browser access the site locally via http://localhost:3000

Deploy the application to Heroku

$ heroku create your_app_name

$ git push heroku master

$ heroku run rake db:migrate

Setup the AWS S3 config vars on Heroku:

$ heroku config:add AWS_S3_BUCKET=your_bucket_name

$ heroku config:add AWS_ACCESS_KEY_ID=your_access_key_id

$ heroku config:add AWS_SECRET_ACCESS_KEY=your_secret_access_key

Setup SMTP Gmail on Heroku:

Create mail.rb in /config/initializes/mail.rb:

ActionMailer::Base.smtp_settings = { 
    user_name: ENV['GMAIL_SMTP_USER'],
    password: ENV['GMAIL_SMTP_PASSWORD'],
    address: "smtp.gmail.com",
    port: 587,
    enable_starttls_auto: true
}

$ heroku config:add GMAIL_SMTP_USER=your_login@gmail.com

$ heroku config:add GMAIL_SMTP_PASSWORD=your_password

Create the first admin on heroku

$ heroku run console

$ >admin = User.create(name: "your name", email: "email", password: "xxxxxxxxx", password_confirmation: "xxxxxx")

$ >admin.confirm!

$ >admin.toggle!(:admin)

View your heroku application

$ heroku open


© created in 2013 by Tony Nguyen

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published