---
- name: Set local ruby version
  template: src=roles/rbenv/templates/.ruby-version.j2
            dest={{ ansistrano_release_path.stdout }}/.ruby-version

- name: Install the bundle
  shell: "bash -lc 'bundle install --deployment --path {{ ansistrano_shared_path.stdout }}/bundle'
         chdir={{ ansistrano_release_path.stdout }}"
  notify:
    - rbenv rehash

- name: Precompile assets
  shell: "bash -lc 'rake assets:precompile'
         chdir={{ ansistrano_release_path.stdout }}"
  environment:
    RAILS_ENV: production

- name: Migrate the database
  shell: "bash -lc 'rake db:migrate'
         chdir={{ ansistrano_release_path.stdout }}"
  environment:
    RAILS_ENV: production

---
- name: Set local ruby version
  template: src=roles/rbenv/templates/.ruby-version.j2
            dest={{ ansistrano_release_path.stdout }}/.ruby-version

- name: Install the bundle
  shell: "bash -lc 'bundle install --deployment --path {{ ansistrano_shared_path.stdout }}/bundle'
         chdir={{ ansistrano_release_path.stdout }}"
  notify:
    - rbenv rehash

- name: Precompile assets
  shell: "bash -lc 'bundle exec rake assets:precompile'
         chdir={{ ansistrano_release_path.stdout }}"
  environment:
    RAILS_ENV: production

- name: Migrate the database
  shell: "bash -lc 'bundle exec rake db:migrate'
         chdir={{ ansistrano_release_path.stdout }}"
  environment:
    RAILS_ENV: production

Use bundler exec to avoid issues
Use bundler exec to avoid issues
