$ git clone [email protected]:tonydng/photo_gallery.git
$ cd tasks
$ bundle
$ rake db:migrate
S3 setup must be done first.
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
$ 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
$ heroku create your_app_name
$ git push heroku master
$ heroku run rake db:migrate
$ 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
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 [email protected]
$ heroku config:add GMAIL_SMTP_PASSWORD=your_password
$ 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