SSH into your EC2 instance. Run the following:
$ sudo yum install gcc This may return an "already installed" message. That's OK.
$ wget http://download.redis.io/redis-stable.tar.gz && tar xvzf redis-stable.tar.gz && cd redis-stable && make
| # Copy and paste this to the rails console to test your email settings | |
| class MyMailer < ActionMailer::Base | |
| def test_email | |
| @recipients = "someone@somewhere.com" | |
| @from = "must_be_same_as_smpt_account_login@gmail.com" | |
| @subject = "test from the Rails Console" | |
| @body = "This is a test email" | |
| end | |
| end |
| # In config/initializers/local_override.rb: | |
| require 'devise/strategies/authenticatable' | |
| module Devise | |
| module Strategies | |
| class LocalOverride < Authenticatable | |
| def valid? | |
| true | |
| end |
| # coding: utf-8 | |
| require 'rubygems' | |
| require 'thinreports' | |
| report = ThinReports::Report.new :layout => 'advanced_list' | |
| report.layout.config.list(:advanced_list) do | |
| # Define the variables used in list. | |
| use_stores :row_count => 0, |
| #!/usr/bin/env bash | |
| mkdir /var/app/ondeck/vendor /var/app/ondeck/public /var/app/support/bundle /var/app/support/assets /var/app/support/cache | |
| ln -s /var/app/support/bundle /var/app/ondeck/vendor | |
| ln -s /var/app/support/assets /var/app/ondeck/public | |
| ln -s /var/app/support/cache /var/app/ondeck/vendor | |
| sed -i 's/"rake/"bundle exec rake/' /opt/elasticbeanstalk/hooks/appdeploy/pre/11_asset_compilation.sh |
| # Support for Rspec / Capybara subdomain integration testing | |
| # Make sure this file is required by spec_helper.rb | |
| # (e.g. save as spec/support/subdomains.rb) | |
| def switch_to_subdomain(subdomain) | |
| # lvh.me always resolves to 127.0.0.1 | |
| hostname = subdomain ? "#{subdomain}.lvh.me" : "lvh.me" | |
| Capybara.app_host = "http://#{hostname}" | |
| end |
| # Main reference was lascarides' post at http://stackoverflow.com/questions/14743447/getting-pdf-from-wickedpdf-for-attachment-via-carrierwave | |
| # estimate.rb | |
| # ... | |
| has_attached_file :pdf, | |
| storage: :s3, | |
| s3_credentials: { | |
| access_key_id: ENV['AWS_ACCESS_KEY_ID'], | |
| secret_access_key: ENV['AWS_SECRET_ACCESS_KEY'], | |
| bucket: ENV['AWS_BUCKET'] |
| module RailsAppName | |
| class Application < Rails::Application | |
| # .... your settings | |
| require "#{Rails.root}/lib/cloud_flare_middleware" | |
| config.middleware.insert_before(0, Rack::CloudFlareMiddleware) | |
| # ... your settings | |
| end | |
| end |
| module LiquidPresenters | |
| class Plan < SimpleDelegator | |
| def to_liquid | |
| @to_liquid ||= HashWithIndifferentAccess.new({ | |
| id: self.id, | |
| name: self.name, | |
| description: self.description, | |
| status: self.status, | |
| class_id: self.plan_class_id | |
| }) |
| # Install Git needed for Git based gems | |
| packages: | |
| yum: | |
| git: [] | |
SSH into your EC2 instance. Run the following:
$ sudo yum install gcc This may return an "already installed" message. That's OK.
$ wget http://download.redis.io/redis-stable.tar.gz && tar xvzf redis-stable.tar.gz && cd redis-stable && make