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