1
我试图开发一个应用程序,它使用AWS中的dynamoDB作为数据库。我一直在用动力宝石尝试过去的两天,但我正要把我的电脑从窗户外面扔出去。ruby rails dynamo db教程
http://blog.megam.co/archives/201
https://github.com/aws/aws-sdk-ruby
https://github.com/Veraticus/Dynamoid
没有任何人知道一个教程了吗?
我开始了一个新的Rails应用
rails new newApp -O
加入Gemfile中:
gem 'execjs'
gem 'therubyracer'
gem 'aws-sdk'
gem 'dynamoid'
然后我做了
bundle install
以下这一点,我创建了两个初始化: dynamoid.rb :
Dynamoid.configure do |config|
config.adapter = 'aws_sdk' # This adapter establishes a connection to the DynamoDB servers using Amazon's own AWS gem.
config.namespace = "dev" # To namespace tables created by Dynamoid from other tables you might have.
config.warn_on_scan = true # Output a warning to the logger when you perform a scan rather than a query on a table.
config.partitioning = true # Spread writes randomly across the database. See "partitioning" below for more.
config.partition_size = false#200 # Determine the key space size that writes are randomly spread across.
config.read_capacity = 1 # Read capacity for your tables
config.write_capacity = 1 # Write capacity for your tables
end
和AWS-sdk.rb:
require "aws"
AWS.config({
:access_key_id => '##########',
:secret_access_key => '#############################',
})
当我这样做
rails s
它只是不加载
感谢的作品!不幸的是我正在使用rails3。 我刚带走了fake_dynamo。相反,我正在直接开发aws。一旦一切都完美了,我将把命名空间改为“pro”。 – user2376068