Question

I'm using this gem carrierwave-dropbox and I have an error while trying to upload my file. I have an error "Forbidden". Do I need to place the Carrierwave configuration in application.rb or in a separate file in /config/ ? here is my configuration:

Rails 4.0.2 on local

  1. I have a foo_bar folder in Dropbox (app folder name)

    rake dropbox:authorize APP_KEY=abcMY_APP_KEYcdf APP_SECRET=foo_APP_SECRET_bar ACCESS_TYPE=dropbox
    
  2. I get prompt online with

    foo_bar would like to create a folder in your Dropbox. This app will only have access to files in the new "foo_bar" folder in your Apps folder.

  3. Than on my command line I have

    access_token: abcdefghigklmnop  
    access_token_secret: abcdefghijklmnoo  
    user_id: 123456789
    
  4. On my application.rb :

    CarrierWave.configure do |config|
      config.dropbox_app_key = "abcMY_APP_KEYcdf"
      config.dropbox_app_secret = "foo_APP_SECRET_bar"
      config.dropbox_access_token = "abcdefghigklmnop "
      config.dropbox_access_token_secret = "abcdefghijklmnoo"
      config.dropbox_user_id = 123456789
      config.dropbox_access_type = "dropbox"
    end
    
Was it helpful?

Solution

Create a file in config/initializers directory say carrierwave.rb and place the Carrierwave-dropbox related configurations in it. See the example: in carrierwave-dropbox repo.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top