1

AWS の dynamoDB を DB として使用するアプリを開発しようとしています。過去 2 日間、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

これに続いて、2 つの初期化を作成しました: 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