So I've installed the bcms_s3 gem and patched the intializer/
browsercms.rb according to this post:
https://github.com/aunderwo/bcms_s3/issues/6
But when I attached a file it still uploads it to the normal local
system file using paperclip, here is a snip from rails output:
[paperclip] Saving attachments.
[paperclip] deleting /var/www/app/public/system/imgs/12/original/
1_cheese.jpg
[paperclip] saving /var/www/app/public/system/imgs/12/original/
1_cheese.jpg
Gemfile added:
gem "bcms_s3"
gem "right"aws"
Here is my initializer:
<---- snip [config/initializers/browsercms.rb]----->
Cms.attachment_file_permission = 0640
# Enable Amazon S3 for Content Storage
Cms::S3.enabled = true
Cms::AttachmentsController.send(:include,
Cms::S3::AttachmentsController)
Cms::ContentController.send(:include, Cms::S3::ContentController)
Attachment.send(:include, Cms::S3::Attachment)
Cms::ApplicationController.send(:include,
Cms::S3::ApplicationController)
# ensure S3 storage disabled by default
Cms::S3.enabled = false if Cms::S3.enabled.nil?
# ensure heroku caching disabled by default
Cms::S3.heroku_caching = false if Cms::S3.heroku_caching.nil?
# function to set domain prefix without url to 'www' is disabled by
default
Cms::S3.www_domain_prefix = false if Cms::S3.www_domain_prefix.nil?
# load s3 options if s3.yml exists
if File.exists?("#{RAILS_ROOT}/config/s3.yml")
yaml_string = IO.read("#{RAILS_ROOT}/config/s3.yml")
Cms::S3.options = YAML::load(ERB.new(yaml_string).result)
Cms::S3.options.symbolize_keys!
end
puts "S3 ENABLED: " + Cms::S3.enabled.to_s
<--- snip ---->
also my S3.yml file is in /config:
<--- snip [S3.yml] ----->
access_key_id: #######################
secret_access_key: ##############################
bucket: testbucket
s3_cname: "https://s3-us-west-1.amazonaws.com/testbucket/"
<---- snip ----->
Any ideas on how I can debug this?
Thanks!
shawn
On Dec 20 2011, 1:55 pm, roboyak <sh...@layer3dev.com> wrote:
> Thats good enough for me. Thanks!
> On Dec 20, 1:53 pm, Patrick Peak <pea...@gmail.com> wrote:
> > I don't know if I would consider it 'endorsed' per se, but its something that we have used for projects.
> > In general, unless some feature is going to be used on nearly ALL projects (like S3) we generally take the approach of leaving things as modules (similar to how Drupal handles them). It also lets the community create and maintain modules at their own pace.
> > - Patrick
> > On Dec 20, 2011, at 4:50 PM, roboyak wrote:
> > > Hi Patrick I saw this but wasn't sure if it was endorsed/recommended
> > > by the BCMS people. Most of the newer CMS's have this feature built
> > > in.
> > > I will check it out though.
> > > Thanks!
> > > On Dec 20, 1:45 pm, Patrick Peak <pea...@gmail.com> wrote:
> > >> Have you looked athttp://rubygems.org/gems/bcms_s3?
> > >> In general, searching Rubygems.org (or github) for bcms_ will turn up a number of modules that the community has worked on.
> > >> - Patrick
> > >> On Dec 20, 2011, at 4:43 PM, roboyak wrote:
> > >>> Its it possible to get BrowserCMS to upload images to Amazon S3 CDN in
> > >>> order to prevent the need to store images across each application
> > >>> instance?
> > >>> Thanks!
> > >>> --
> > >>> You received this message because you are subscribed to the Google Groups "BrowserCMS" group.
> > >>> To post to this group, send email to browsercms@googlegroups.com.
> > >>> To unsubscribe from this group, send email to browsercms+unsubscribe@googlegroups.com.
> > >>> For more options, visit this group athttp://groups.google.com/group/browsercms?hl=en.
> > > --
> > > You received this message because you are subscribed to the Google Groups "BrowserCMS" group.
> > > To post to this group, send email to browsercms@googlegroups.com.
> > > To unsubscribe from this group, send email to browsercms+unsubscribe@googlegroups.com.
> > > For more options, visit this group athttp://groups.google.com/group/browsercms?hl=en.