Skip to content

Instantly share code, notes, and snippets.

@morenoh149
Last active August 29, 2015 14:17
Show Gist options
  • Save morenoh149/a303bb9e823ffc77ac37 to your computer and use it in GitHub Desktop.
Save morenoh149/a303bb9e823ffc77ac37 to your computer and use it in GitHub Desktop.
CarrierWave.configure do |config|
config.fog_credentials = {
provider: 'AWS', # required
aws_access_key_id: ENV["S3_KEY"], # required
aws_secret_access_key: ENV["S3_SECRET"], # required
region: 'us-west-1' # optional, defaults to 'us-east-1'
# host: s3.example.com', # optional, defaults to nil
# endpoint: 'https://s3.example.com:8080' # optional, defaults to nil
}
config.fog_directory = 'yakkedin-rooms' # required
# config.fog_public = false # optional, defaults to true
# the following is optional, defaults to {}
config.fog_attributes = { 'Cache-Control' => "max-age=#{365.day.to_i}" }
end
2015-03-25T09:27:31.876246+00:00 app[web.1]: Detected 512 MB available memory, 512 MB limit per process (WEB_MEMORY)
2015-03-25T09:27:31.876264+00:00 app[web.1]: Recommending WEB_CONCURRENCY=1
2015-03-25T09:27:32.048613+00:00 heroku[worker.1]: State changed from starting to up
2015-03-25T09:27:32.515704+00:00 app[web.1]: I, [2015-03-25T09:27:32.515592 #3] INFO -- : Refreshing Gem list
2015-03-25T09:27:33.325050+00:00 app[worker.1]: Detected 512 MB available memory, 512 MB limit per process (WEB_MEMORY)
2015-03-25T09:27:33.326484+00:00 app[worker.1]: Recommending WEB_CONCURRENCY=1
2015-03-25T09:27:35.240294+00:00 app[web.1]: /app/vendor/bundle/ruby/2.2.0/gems/carrierwave-0.10.0/lib/carrierwave/uploader/configuration.rb:73:in `eval': uninitialized constant CarrierWave::Storage::Fog (NameError)
2015-03-25T09:27:35.240300+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.2.0/gems/carrierwave-0.10.0/lib/carrierwave/uploader/configuration.rb:73:in `eval'
2015-03-25T09:27:35.240320+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.2.0/gems/carrierwave-0.10.0/lib/carrierwave/uploader/configuration.rb:73:in `storage'
2015-03-25T09:27:35.240322+00:00 app[web.1]: from /app/app/uploaders/room_icon_uploader.rb:12:in `<class:RoomIconUploader>'
2015-03-25T09:27:35.240323+00:00 app[web.1]: from /app/app/uploaders/room_icon_uploader.rb:3:in `<top (required)>'
2015-03-25T09:27:35.240325+00:00 app[web.1]: from /app/app/models/room.rb:2:in `<class:Room>'
2015-03-25T09:27:35.240326+00:00 app[web.1]: from /app/app/models/room.rb:1:in `<top (required)>'
2015-03-25T09:27:35.240327+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.2.0/gems/railties-4.2.0/lib/rails/engine.rb:472:in `block (2 levels) in eager_load!'
2015-03-25T09:27:35.240331+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.2.0/gems/railties-4.2.0/lib/rails/engine.rb:471:in `each'
2015-03-25T09:27:35.240332+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.2.0/gems/railties-4.2.0/lib/rails/engine.rb:471:in `block in eager_load!'
2015-03-25T09:27:35.240334+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.2.0/gems/railties-4.2.0/lib/rails/engine.rb:469:in `each'
2015-03-25T09:27:35.240335+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.2.0/gems/railties-4.2.0/lib/rails/engine.rb:469:in `eager_load!'
2015-03-25T09:27:35.240336+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.2.0/gems/railties-4.2.0/lib/rails/engine.rb:346:in `eager_load!'
2015-03-25T09:27:35.240338+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.2.0/gems/railties-4.2.0/lib/rails/application/finisher.rb:56:in `each'
2
GEM
remote: https://rubygems.org/
remote: https://rails-assets.org/
specs:
actionmailer (4.2.0)
actionpack (= 4.2.0)
actionview (= 4.2.0)
activejob (= 4.2.0)
mail (~> 2.5, >= 2.5.4)
rails-dom-testing (~> 1.0, >= 1.0.5)
actionpack (4.2.0)
actionview (= 4.2.0)
activesupport (= 4.2.0)
rack (~> 1.6.0)
rack-test (~> 0.6.2)
rails-dom-testing (~> 1.0, >= 1.0.5)
rails-html-sanitizer (~> 1.0, >= 1.0.1)
actionview (4.2.0)
activesupport (= 4.2.0)
builder (~> 3.1)
erubis (~> 2.7.0)
rails-dom-testing (~> 1.0, >= 1.0.5)
rails-html-sanitizer (~> 1.0, >= 1.0.1)
activejob (4.2.0)
activesupport (= 4.2.0)
globalid (>= 0.3.0)
activemodel (4.2.0)
activesupport (= 4.2.0)
builder (~> 3.1)
activerecord (4.2.0)
activemodel (= 4.2.0)
activesupport (= 4.2.0)
arel (~> 6.0)
activesupport (4.2.0)
i18n (~> 0.7)
json (~> 1.7, >= 1.7.7)
minitest (~> 5.1)
thread_safe (~> 0.3, >= 0.3.4)
tzinfo (~> 1.1)
addressable (2.3.7)
airbrake (4.1.0)
builder
multi_json
arel (6.0.0)
awesome_print (1.6.1)
binding_of_caller (0.7.2)
debug_inspector (>= 0.0.1)
bourbon (4.1.1)
sass (~> 3.3)
thor
browserify-rails (0.8.1)
sprockets (~> 2.0)
builder (3.2.2)
bundler-audit (0.3.1)
bundler (~> 1.2)
thor (~> 0.18)
byebug (4.0.3)
columnize (= 0.9.0)
capybara (2.4.4)
mime-types (>= 1.16)
nokogiri (>= 1.3.3)
rack (>= 1.0.0)
rack-test (>= 0.5.4)
xpath (~> 2.0)
capybara-webkit (1.4.1)
capybara (>= 2.3.0, < 2.5.0)
json
carrierwave (0.10.0)
activemodel (>= 3.2.0)
activesupport (>= 3.2.0)
json (>= 1.7)
mime-types (>= 1.16)
coderay (1.1.0)
coffee-rails (4.1.0)
coffee-script (>= 2.2.0)
railties (>= 4.0.0, < 5.0)
coffee-script (2.3.0)
coffee-script-source
execjs
coffee-script-source (1.9.1)
columnize (0.9.0)
crack (0.4.2)
safe_yaml (~> 1.0.0)
daemons (1.2.2)
database_cleaner (1.4.1)
debug_inspector (0.0.2)
delayed_job (4.0.6)
activesupport (>= 3.0, < 5.0)
delayed_job_active_record (4.0.3)
activerecord (>= 3.0, < 5.0)
delayed_job (>= 3.0, < 4.1)
diff-lcs (1.2.5)
dotenv (2.0.0)
dotenv-rails (2.0.0)
dotenv (= 2.0.0)
easy_translate (0.5.0)
json
thread
thread_safe
email_validator (1.5.0)
activemodel
erubis (2.7.0)
excon (0.44.4)
execjs (2.4.0)
factory_girl (4.5.0)
activesupport (>= 3.0.0)
factory_girl_rails (4.5.0)
factory_girl (~> 4.5.0)
railties (>= 3.0.0)
faraday (0.9.1)
multipart-post (>= 1.2, < 3)
flutie (2.0.0)
fog-aws (0.1.1)
fog-core (~> 1.27)
fog-json (~> 1.0)
fog-xml (~> 0.1)
ipaddress (~> 0.8)
fog-core (1.29.0)
builder
excon (~> 0.38)
formatador (~> 0.2)
mime-types
net-scp (~> 1.1)
net-ssh (>= 2.1.3)
fog-json (1.0.0)
multi_json (~> 1.0)
fog-xml (0.1.1)
fog-core
nokogiri (~> 1.5, >= 1.5.11)
font-awesome-sass (4.3.2.1)
sass (~> 3.2)
formatador (0.2.5)
formulaic (0.2.0)
activesupport
capybara
i18n
globalid (0.3.3)
activesupport (>= 4.1.0)
hashie (3.4.0)
high_voltage (2.2.1)
highline (1.7.1)
hike (1.2.3)
i18n (0.7.0)
i18n-tasks (0.7.13)
activesupport
easy_translate (>= 0.5.0)
erubis
highline
i18n
slop (~> 3.5)
term-ansicolor
terminal-table
ipaddress (0.8.0)
json (1.8.2)
jwt (1.4.1)
kgio (2.9.3)
launchy (2.4.3)
addressable (~> 2.3)
linkedin-oauth2 (1.0.0)
faraday (~> 0.9)
hashie (~> 3.2)
oauth2 (~> 1.0)
loofah (2.0.1)
nokogiri (>= 1.5.9)
mail (2.6.3)
mime-types (>= 1.16, < 3)
method_source (0.8.2)
mime-types (2.4.3)
mini_portile (0.6.2)
minitest (5.5.1)
multi_json (1.11.0)
multi_xml (0.5.5)
multipart-post (2.0.0)
net-scp (1.2.1)
net-ssh (>= 2.6.5)
net-ssh (2.9.2)
newrelic_rpm (3.11.0.283)
nokogiri (1.6.6.2)
mini_portile (~> 0.6.0)
normalize-rails (3.0.1)
oauth2 (1.0.0)
faraday (>= 0.8, < 0.10)
jwt (~> 1.0)
multi_json (~> 1.3)
multi_xml (~> 0.5)
rack (~> 1.2)
omniauth (1.2.2)
hashie (>= 1.2, < 4)
rack (~> 1.0)
omniauth-linkedin-oauth2 (0.1.5)
omniauth (~> 1.0)
omniauth-oauth2
omniauth-oauth2 (1.2.0)
faraday (>= 0.8, < 0.10)
multi_json (~> 1.3)
oauth2 (~> 1.0)
omniauth (~> 1.2)
pg (0.18.1)
pry (0.10.1)
coderay (~> 1.1.0)
method_source (~> 0.8.1)
slop (~> 3.4)
pry-rails (0.3.3)
pry (>= 0.9.10)
rack (1.6.0)
rack-test (0.6.3)
rack (>= 1.0)
rack-timeout (0.2.1)
rails (4.2.0)
actionmailer (= 4.2.0)
actionpack (= 4.2.0)
actionview (= 4.2.0)
activejob (= 4.2.0)
activemodel (= 4.2.0)
activerecord (= 4.2.0)
activesupport (= 4.2.0)
bundler (>= 1.3.0, < 2.0)
railties (= 4.2.0)
sprockets-rails
rails-assets-bootstrap (3.3.4)
rails-assets-jquery (>= 1.9.1)
rails-assets-jquery (2.1.3)
rails-deprecated_sanitizer (1.0.3)
activesupport (>= 4.2.0.alpha)
rails-dom-testing (1.0.6)
activesupport (>= 4.2.0.beta, < 5.0)
nokogiri (~> 1.6.0)
rails-deprecated_sanitizer (>= 1.0.1)
rails-html-sanitizer (1.0.2)
loofah (~> 2.0)
rails_12factor (0.0.3)
rails_serve_static_assets
rails_stdout_logging
rails_serve_static_assets (0.0.4)
rails_stdout_logging (0.0.3)
railties (4.2.0)
actionpack (= 4.2.0)
activesupport (= 4.2.0)
rake (>= 0.8.7)
thor (>= 0.18.1, < 2.0)
raindrops (0.13.0)
rake (10.4.2)
recipient_interceptor (0.1.2)
mail
rspec-core (3.1.7)
rspec-support (~> 3.1.0)
rspec-expectations (3.1.2)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.1.0)
rspec-mocks (3.1.3)
rspec-support (~> 3.1.0)
rspec-rails (3.1.0)
actionpack (>= 3.0)
activesupport (>= 3.0)
railties (>= 3.0)
rspec-core (~> 3.1.0)
rspec-expectations (~> 3.1.0)
rspec-mocks (~> 3.1.0)
rspec-support (~> 3.1.0)
rspec-support (3.1.2)
safe_yaml (1.0.4)
sass (3.4.13)
sass-rails (5.0.1)
railties (>= 4.0.0, < 5.0)
sass (~> 3.1)
sprockets (>= 2.8, < 4.0)
sprockets-rails (>= 2.0, < 4.0)
tilt (~> 1.1)
shoulda-matchers (2.8.0)
activesupport (>= 3.0.0)
simple_form (3.1.0)
actionpack (~> 4.0)
activemodel (~> 4.0)
slop (3.6.0)
spring (1.3.3)
spring-commands-rspec (1.0.4)
spring (>= 0.9.1)
sprockets (2.12.3)
hike (~> 1.2)
multi_json (~> 1.0)
rack (~> 1.0)
tilt (~> 1.1, != 1.3.0)
sprockets-rails (2.2.4)
actionpack (>= 3.0)
activesupport (>= 3.0)
sprockets (>= 2.8, < 4.0)
term-ansicolor (1.3.0)
tins (~> 1.0)
terminal-table (1.4.5)
thor (0.19.1)
thread (0.1.5)
thread_safe (0.3.5)
tilt (1.4.1)
timecop (0.7.3)
tins (1.3.5)
title (0.0.5)
i18n
rails (>= 3.1)
tzinfo (1.2.2)
thread_safe (~> 0.1)
uglifier (2.7.1)
execjs (>= 0.3.0)
json (>= 1.8.0)
unicorn (4.8.3)
kgio (~> 2.6)
rack
raindrops (~> 0.7)
web-console (2.1.2)
activemodel (>= 4.0)
binding_of_caller (>= 0.7.2)
railties (>= 4.0)
sprockets-rails (>= 2.0, < 4.0)
webmock (1.20.4)
addressable (>= 2.3.6)
crack (>= 0.3.2)
xpath (2.0.0)
nokogiri (~> 1.3)
PLATFORMS
ruby
DEPENDENCIES
airbrake
awesome_print
bourbon (~> 4.1.0)
browserify-rails (~> 0.7)
bundler-audit
byebug
capybara-webkit (>= 1.2.0)
carrierwave
coffee-rails (~> 4.1.0)
daemons
database_cleaner
delayed_job_active_record
dotenv-rails
email_validator
factory_girl_rails
flutie
fog-aws
font-awesome-sass
formulaic
high_voltage
i18n-tasks
launchy
linkedin-oauth2 (~> 1.0)
newrelic_rpm
normalize-rails (~> 3.0.0)
omniauth
omniauth-linkedin-oauth2
pg
pry-rails
rack-timeout
rails (= 4.2.0)
rails-assets-bootstrap!
rails_12factor
recipient_interceptor
rspec-rails (~> 3.1.0)
sass-rails (~> 5.0)
shoulda-matchers
simple_form
spring
spring-commands-rspec
timecop
title
uglifier
unicorn
web-console
webmock
# encoding: utf-8
class RoomIconUploader < CarrierWave::Uploader::Base
# Include RMagick or MiniMagick support:
# include CarrierWave::RMagick
# include CarrierWave::MiniMagick
# Choose what kind of storage to use for this uploader:
if Rails.env.development?
storage :file
else
storage :fog
end
# Override the directory where uploaded files will be stored.
# This is a sensible default for uploaders that are meant to be mounted:
def store_dir
"uploads/#{model.class.to_s.underscore}/#{mounted_as}/#{model.id}"
end
# Provide a default URL as a default if there hasn't been a file uploaded:
# def default_url
# # For Rails 3.1+ asset pipeline compatibility:
# # ActionController::Base.helpers.asset_path("fallback/" +
# [version_name, "default.png"].compact.join('_'))
#
# "/images/fallback/" + [version_name, "default.png"].compact.join('_')
# end
# Process files as they are uploaded:
# process :scale => [200, 300]
#
# def scale(width, height)
# # do something
# end
# Create different versions of your uploaded files:
# version :thumb do
# process :resize_to_fit => [50, 50]
# end
# Add a white list of extensions which are allowed to be uploaded.
# For images you might use something like this:
def extension_white_list
%w(jpg jpeg gif png svg)
end
# Override the filename of the uploaded files:
# Avoid using model.id or version_name here, see uploader/store.rb for details
# def filename
# "something.jpg" if original_filename
# end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment