0

我有一个 Rails 应用程序需要存储工作申请的简历。在本地,附件可以使用 Paperclip 插件正常工作。我想使用回形针盒宝石将它们存储在生产中。我做了以下事情:

1)按照github上的文档设置回形针附件

2) 运行安装 dropbox gem 的命令,在其上 paperclipdropbox

gem install dropbox

3)根据https://github.com/dripster82/paperclipdropbox#readme设置回形针盒 我的回形针盒.yml 文件看起来像这样


development:
  dropbox_key: email_for_dropbox_account
  dropbox_secret: password_for_dropboxaccount
production:
  dropbox_key: email_for_dropbox_account
  dropbox_secret: password_for_dropboxaccount

运行后

rake paperclipdropbox:authorize 

我收到以下错误:


C:\Sites\appname>rake paperclipdropbox:authorize  --trace
rake aborted!
Don't know how to build task 'paperclipdropbox:authorize'
C:/RailsInstaller/Ruby1.9.2/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/task_
manager.rb:49:in `[]'
C:/RailsInstaller/Ruby1.9.2/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/appli
cation.rb:115:in `invoke_task'
C:/RailsInstaller/Ruby1.9.2/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/appli
cation.rb:94:in `block (2 levels) in top_level'
C:/RailsInstaller/Ruby1.9.2/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/appli
cation.rb:94:in `each'
C:/RailsInstaller/Ruby1.9.2/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/appli
cation.rb:94:in `block in top_level'
C:/RailsInstaller/Ruby1.9.2/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/appli
cation.rb:133:in `standard_exception_handling'
C:/RailsInstaller/Ruby1.9.2/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/appli
cation.rb:88:in `top_level'
C:/RailsInstaller/Ruby1.9.2/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/appli
cation.rb:66:in `block in run'
C:/RailsInstaller/Ruby1.9.2/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/appli
cation.rb:133:in `standard_exception_handling'
C:/RailsInstaller/Ruby1.9.2/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/appli
cation.rb:63:in `run'
C:/RailsInstaller/Ruby1.9.2/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/bin/rake:33:in
 `'
C:/RailsInstaller/Ruby1.9.2/bin/rake:19:in `load'
C:/RailsInstaller/Ruby1.9.2/bin/rake:19:in `'

不幸的是,我没有在网上找到太多文档。知道可能导致问题的原因吗?您还有其他免费的存储方式吗?

4

2 回答 2

1

我认为您可能已经安装了 gem,但没有在Gemfile. 确保您的 Gemfile 中有paperclip, dropbox, paperclip-dropboxgem。

gem 'paperclip'
gem 'dropbox'
gem 'paperclipdropbox'

然后运行bundle install,并尝试再次运行该 rake 任务。这是因为默认情况下,Bundler 将隔离并仅使您的宝石Gemfile对您的 Rails 应用程序可见。

于 2012-07-12T01:43:46.950 回答
0

您必须在 Dropbox 中创建项目。这里有链接。

使用后rake paperclipdropbox:authorize

于 2012-10-05T07:18:23.710 回答