Skip to content
This repository was archived by the owner on Nov 9, 2017. It is now read-only.
This repository was archived by the owner on Nov 9, 2017. It is now read-only.

Replicate does not seem to work with Rails 4.2.3 and Ruby 2.2.2 #40

Description

@ankuriitk

Hi, Replicate gem looks awesome and seems the right thing for selectively copying data from prod to my devel db. However, either I am not following the steps correctly or replicate does not work with Rails 4.2.3. In either case, will appreciate your help. Here is what I did:

  1. Added gem 'replicate' to my Gemfile
  2. Added a config/replicate/dump.rb file that requires 'config/environment' and added simple code to dump Company.find(16)
  3. Ran the following command on my production DB machine:
    RAILS_ENV=prod replicate -r ./config/environment -d config/replicate/dump.rb > dumped_data

When I do this, I get the following error:
/var/www/fbdash/releases/20151124123929/config/application.rb:47:in <class:Application>': undefined method[]' for nil:NilClass (NoMethodError)
from /var/www/fbdash/releases/20151124123929/config/application.rb:17:in <module:AdIQ>' from /var/www/fbdash/releases/20151124123929/config/application.rb:16:in<top (required)>'
from /var/www/fbdash/releases/20151124123929/config/environment.rb:2:in `require'

My application.rb snippet looks like this:
...
LIne 46: redis_config = YAML.load_file(Rails.root + 'config/redis.yml')[Rails.env]
Line 47: url_prefix = redis_config['url_prefix']
db = redis_config['cache_db']

I am not sure why it is not picking redis_config as the prod app works just fine.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions