msg: [Errno 2] No such file or directory when using bundle

479 views
Skip to first unread message

Derrick Mar

unread,
Aug 19, 2015, 10:02:19 PM8/19/15
to Ansible Project
Hello Ansible community!

I'm just getting started with Ansible, and seem to be not understanding why this happens.

My playbook
- name: bundle install
      command: "bundle install"
      args:
        chdir: "~/ai_grading_production/"

I get the error msg: [Errno 2] No such file or directory when using bundle

When I actually specify the full path it works
    command: "/home/ubuntu/.rvm/gems/ruby-2.2.2/wrappers/bundle install"

When I use the shell module it error with this message
    stderr: /bin/sh: 1: bundle: not found

Does anyone know why I have to specify the full path to use the bundle command. And how can I fix? Thank you!

Brian Coca

unread,
Aug 19, 2015, 11:02:35 PM8/19/15
to Ansible Project
bundle is not in your PATH, changing to a directory does not include
it in your PATH (unless your PATH has ./ which is really not
recommended).



--
Brian Coca

Marcus Franke

unread,
Aug 20, 2015, 12:44:26 AM8/20/15
to Ansible Project

Hi

You are running into a typical rvm error. I assume you have some special rvm ruby version with a custom gemset.

The problem is, Ansible has to do the same rvm use ruby-2.1.5@gemset like you would do in your shell. Unless you are using the .ruby-(version|gemset) dotfiles.

Ansible does not know about this magick and is running your system ruby's bundler command.

Kind regards
/mf


--
You received this message because you are subscribed to the Google Groups "Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ansible-proje...@googlegroups.com.
To post to this group, send email to ansible...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/da5943e1-1606-4f50-91f8-fd2051882a66%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages