“missing required :bucket option” for Paperclip/S3

前端 未结 3 1170
深忆病人
深忆病人 2021-02-05 22:40

In my Rails app I\'m letting users upload an image when they create a \"release\", and it should upload directly to S3. I\'m getting the following error in both development and

3条回答
  •  走了就别回头了
    2021-02-05 22:45

    Add this to your application.rb file inside the module and class. create a local_env.yml file and put your environment variables in there. This code will load your environment variables on server start :

    config.autoload_paths += %W(#{config.root}/lib)
    config.before_configuration do
        env_file = File.join(Rails.root, 'config', 'local_env.yml')
        YAML.load(File.open(env_file)).each do |key, value|
            ENV[key.to_s] = value
        end if File.exists?(env_file)
    end
    

提交回复
热议问题