rvm / rvm1-ansible

The official ansible RVM role to install and manage your Ruby versions.
MIT License
271 stars 136 forks source link

bundle install - bundle not found #132

Closed davemckenna01 closed 7 years ago

davemckenna01 commented 7 years ago

I have successfully installed rvm, but I'm unable to "bundle install" from within my ruby project. The bundle bin is not found.

- name: Install Repo Deps (From Gemfile)
  become: true
  become_user: '{{ ansible_user }}'
  command: bundle install
  args:
    chdir: "{{ code_dir }}/{{ item.name }}"
  with_items: "{{ repos|byattr('lang', 'ruby') }}"

results in:

"[Errno 2] No such file or directory"

- name: Install Repo Deps (From Gemfile)
  become: true
  become_user: '{{ ansible_user }}'
  shell: bundle install
  args:
    chdir: "{{ code_dir }}/{{ item.name }}"
  with_items: "{{ repos|byattr('lang', 'ruby') }}"

results in:

"/bin/sh: 1: bundle: not found"

But when I shell in to my vagrant box, bundle works fine, I can bundle install:

$ which bundle
/home/vagrant/.rvm/gems/ruby-1.9.3-p551@global/bin/bundle

The Ansible bundle module also doesn't work. I have to explicitly specify the executable, and then it errors with this:

- name: Install Repo Deps (From Gemfile)
  bundler:
    state: present
    chdir: "{{ code_dir }}/{{ item.name }}"
    executable: /home/vagrant/.rvm/gems/ruby-1.9.3-p551@global/bin/bundle
  with_items: "{{ repos|byattr('lang', 'ruby') }}"

error: "/usr/bin/env: ruby_executable_hooks: No such file or directory"

Any ideas what's up?

jrgifford commented 7 years ago

(I edited this issue a little to show everything as code blocks instead of misinterpreted markdown)

lpaulmp commented 7 years ago

@davemckenna01 This is duplicate issue https://github.com/rvm/rvm1-ansible/issues/128

lucascj commented 6 years ago

I seem to have this same issue. Root install of rvm when I try to run a gemfile using bundler module it generates the same error. Ansible 2.5.3 and latest rvm_io.ruby.

error: "/usr/bin/env: ruby_executable_hooks: No such file or directory"

ghost commented 6 years ago

i have sam issue,

Pepan commented 5 years ago

Me too ... I did

    - role: rvm.ruby
      vars:
        tags: ruby
        rvm1_rubies: ['ruby-2.5.3']
        rvm1_user: "{{main_user}}"

on Centos 7

marzdgzmn commented 5 years ago

I'm experiencing the same issue on CentOS 7 using v2.1.2. Has anyone found any resolution for this?

Pepan commented 5 years ago

I created hook my self instead


 - name: Link {{app_id}} rvm wrapper
  file:
    src: /home/{{main_user}}/.rvm/gems/ruby-{{ ruby_version }}/wrappers/puma
    dest: /home/{{main_user}}/.rvm/bin/{{app_id}}_puma
    owner: "{{main_user}}"
    group: "{{main_user}}"
    state: link
marzdgzmn commented 5 years ago

I created hook my self instead

 - name: Link {{app_id}} rvm wrapper
  file:
    src: /home/{{main_user}}/.rvm/gems/ruby-{{ ruby_version }}/wrappers/puma
    dest: /home/{{main_user}}/.rvm/bin/{{app_id}}_puma
    owner: "{{main_user}}"
    group: "{{main_user}}"
    state: link

Thanks. I thought I could make this work if I installed it using root, unfortunately, it gives me the same error.