1

我正在尝试开发一个使用 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

它只是不加载本地主机

4

1 回答 1

0

DynamoDB gem 在 Rails 4 中有一个错误。

  1. 当您键入rails s时,发布您得到的错误。
  2. 您使用的是 Rails 4 还是 Rails 3?

我们的 Rails 项目使用 dynamoid https://github.com/indykish/nilavu​​ 和 fake_dynamo。

我们不使用 aws-sdk.rb,但它适用于 aws.yml

development:

bucket: megam
use_ssl: false
access_key_id: <acess_key>
secret_access_key: <secret> 
#dynamo_db_endpoint: localhost
#dynamo_db_port: 4567
#dynamo_db_endpoint: dynamodb.ap-southeast-1.amazonaws.com # Set the regional endpoint
于 2013-05-24T02:05:25.417 回答