Closed victorteokw closed 9 years ago
@cheunghy You can gem 'carrierwave-aliyun', github: "huacnlee/carrierwave-aliyun"
ruby 2.2.0 have removed Digest::HMAC, but rubygems not update. https://github.com/ruby/ruby/blob/v2_2_0/NEWS#L146
I saw the https://github.com/huacnlee/carrierwave-aliyun/commit/b3099aa76d29eee595c13dcb7fa1d7596772f335 , I suggest @huacnlee update version to 0.3.4 to support ruby 2.2.0.
@liwei78 Thanks a lot!
That's not the case. Even though that issue is fixed, this issue still occurs.
Just released 0.3.4
Thanks, Jason.
That's not the same case.
This issue still exists.
Can we find some official help from aliyun?
请在 bundle open carrierwave-aliyun 并在 lib/carrierwave/storage/aliyun.rb#L136 行 h = OpenSSL::HMAC.digest(digest, @aliyun_access_key, string_to_sign)
前面增加一个 puts 打印信息看看
puts "digest: #{digest} aliyun_access_key: #{@aliyun_access_key} string_to_sign: #{string_to_sign}"
h = OpenSSL::HMAC.digest(digest, @aliyun_access_key, string_to_sign)
Thanks.
digest: da39a3xx5e6b4b0d3255bfef95xx1890afd80709 aliyun_access_key: string_to_sign: PUT
My config is fine
CarrierWave.configure do |config|
config.storage = :aliyun
config.aliyun_access_id = "CFbiFxxMxrGugKxx"
config.aliyun_access_key = "L1IH5VhS54xxH7J3dFOxniboIdfQxx"
config.aliyun_bucket = "xxxxdxrt"
end
@cheunghy 这个配置信息你放在哪儿的?
/path/to/my/rails_project/config/carrierwave.rb
放到 rails_project/config/initializes 下面
Oh my bad. Thanks a lot.
@huacnlee 我放在ails_project/config/initializes下面,配置也ok, 在代码中,这样如下使用: connection = CarrierWave::Storage::Aliyun::Connection.new tmp_file = open_tmp_file url = connection.put(filename,tmp_file) 也是出现同样的问题,加了打印纸后,如下: digest: da39a3ee5e6b4b0d3255bfef95601890afd80709 aliyun_access_key: string_to_sign: PUT
@huacnlee @cheunghy 在设置了bucket为private之后,不能够通过connection.get(file_path)能获取么,我get文件时候提示为403 Forbidden,需要做什么配置么
没试过,不确定
在 2015年3月25日,19:08,fronzethrone notifications@github.com 写道:
@huacnlee @cheunghy 在设置了bucket为private之后,不能够通过connection.get(file_path)能获取么,我get文件时候提示为403 Forbidden,需要做什么配置么
— Reply to this email directly or view it on GitHub.
@huacnlee ,两个问题都解决了,第一个是因为代码里面没有设置默认值,需要把配置文件读出来作参数传给connection,第二个问题是因为你的gem里面的get 方法没有经过认证,默认文件是public权限来的。加上认证那段就可以了,非常谢谢你的gem包,嘿嘿!
Thanks for your brilliant gem package.
When I was uploading file, I got an error from this gem package.
no implicit conversion of nil into String
My config is totally correct, and rigidly followed the instruction described in README.md
And my uploader: