Dropbox SDK入门 [英] Getting started with Dropbox SDK
问题描述
我正在寻找用于Ruby平台的Dropbox SDK。 http:// www。 dropbox.com/developers/start/setup#ruby ,试图从我的Mac上的Users / myname目录中找出如何使用API
gem是否安装了dropbox-sdk
应该附带一些示例文件
web_file_browser.rb是一个示例Web应用程序,可让您浏览文件并将其上传到Dropbox。
它还说
为便于兼容,这些示例引用了您安装的库的本地副本
1)我必须是哪个文件夹来测试这些示例文件? / p>
2)获得应用密钥后,如何运行示例文件以测试上传?
3 )我理论上应该能够从Rails应用程序运行此示例文件吗?
解决方案:
1)我必须是哪个文件夹来测试这些示例文件?
Soln: ,您必须位于这些文件所在的目录中。例如,在我的计算机上,是
jatin @ silverSpoon:/media/silverSpoon/dropbox-app/dropbox-ruby-sdk-1.1$ ls
CHANGELOG cli_example.rb dropbox_controller.rb gemspec.rb lib许可自述文件web_file_browser.rb
因此,您必须位于 dropbox-ruby-sdk-1.1
文件夹中来测试这些示例文件。
2)获得应用密钥后,如何运行示例文件来测试上传?
Soln: :浏览此再次使用Dropbox API进行Ruby设置。写道:
要使这些示例运行,您需要将每个脚本(.rb文件)编辑为
在指示的位置输入您的应用密钥和应用秘密。还要确保将
的访问类型设置为:app_folder或:dropbox(为您的应用程序
配置)。之后,只需运行 ruby script.rb 即可。
3)从理论上讲我应该能够从Rails应用程序运行此示例文件吗?
Soln: 是的,为什么不这样做。我建议您试用示例Sinatra应用程序,熟悉API,然后再使用Rails。
I'm looking at the Dropbox SDK for the Ruby platform http://www.dropbox.com/developers/start/setup#ruby, trying to figure out how to use APIs
from my Users/myname directory on my Mac, I did gem install dropbox-sdk
It's supposed to come with some example files to play around with
web_file_browser.rb is an example web app that lets you browse and upload files to Dropbox.
It also says
For ease of compatibility, these examples reference a local copy of the library you installed with RubyGems, located in lib/dropbox_sdk.rb.
1) What folder do I have to be to test these sample files?
2) After I get my app key, how do I run a sample file to test uploading?
3) should I in theory have been able to run this sample file from a Rails application?
Solutions:
1) What folder do I have to be to test these sample files?
Soln: You have to be in the directory where these files are located.e.g On my machine, it is
jatin@silverSpoon:/media/silverSpoon/dropbox-app/dropbox-ruby-sdk-1.1$ ls
CHANGELOG cli_example.rb dropbox_controller.rb gemspec.rb lib LICENSE README web_file_browser.rb
So, you have to be in dropbox-ruby-sdk-1.1
folder to test these sample files.
2) After I get my app key, how do I run a sample file to test uploading?
Soln: Go through this Ruby Setup with Dropbox API again. It's written that:
To get these examples running, you'll need to edit each script(.rb file) to enter your app key and app secret where indicated. Also make sure that the access type is set to :app_folder or :dropbox as configured for your app. After this, simply run ruby script.rb and you are done.
3) should I in theory have been able to run this sample file from a Rails application?
Soln: Yes, why not. I'd advise you to play around with the sample Sinatra app, get used to the API and then move onto Rails.
这篇关于Dropbox SDK入门的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!