我正在尝试开发一个使用 AWS 中的 dynamoDB 作为数据库的应用程序。在过去的两天里,我一直在尝试使用 dynamoid gem,但我正要把我的电脑扔到窗外。
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
它只是不加载本地主机