installing ruby with rbenv on OS X fails

116 views
Skip to first unread message

Anthony Green

unread,
Aug 26, 2015, 6:46:43 AM8/26/15
to Ansible Project
This task 

  - name: Install Ruby
    command: /usr/local/bin/rbenv install 2.2.3

fails with a

stderr: rbenv: no such command `install

message

I've tried shell and raw as well and I get the same message.

Any ideas on a fix?





Anthony Green

unread,
Aug 26, 2015, 8:51:30 AM8/26/15
to Ansible Project


On Wednesday, 26 August 2015 11:46:43 UTC+1, Anthony Green wrote:
This task 

  - name: Install Ruby
    command: /usr/local/bin/rbenv install 2.2.3

fails with a

stderr: rbenv: no such command `install

message

I've tried shell and raw as well and I get the same message.


some more information:

 /usr/local/bin/rbenv install 2.2.3

works if I just ssh into the box

 if I prelude the task with another that

git clone https://github.com/sstephenson/ruby-build.git ~/.rbenv/plugins/ruby-build

then rbenv picks up the ruby-build plug and the Install Ruby task starts

However now the task never exits, although the correct version of ruby has been installed

Anyone got this working?

Anthony Green

unread,
Aug 26, 2015, 9:30:55 AM8/26/15
to Ansible Project
On Wednesday, 26 August 2015 11:46:43 UTC+1, Anthony Green wrote:

Eventually settled on 

  - name: Install Ruby
    shell: 'export PATH=/usr/local/bin:$PATH; /usr/local/bin/rbenv install 2.2.3'
    args:
      creates: /Users/jenkins/.rbenv/versions/2.2.3
    become: yes
    become_user: jenkins
Reply all
Reply to author
Forward
0 new messages