Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I'm installing RVM for Ruby with the following command: curl -L https://get.rvm.io | sudo su myuser -c "bash -s stable --rails"

I specifically need it to be installed under that user - and it will work, but it requires the user to intervene by pressing "q" to continue once it hits a certain point in the script. How can I set the script to just continue without having to press 'q' to continue?

share|improve this question
    
wrap it with expect. –  Sirex Jul 31 '12 at 3:38
    
@Sirex - Thanks, I responded the issue I'm having to hopelessn00b 's answer. –  TJ Biddle Jul 31 '12 at 4:08
add comment

2 Answers

The installer options --ruby and --rails are intended for humans only, and to allow guided installation.

RVM2 will allow better automation of this process but in RVM1 - you need to do it step by step.

Single user:

curl -L https://get.rvm.io | bash -s stable
apt-get install ... # the steps shown in `rvm requirements`
~/.rvm/bin/rvm install 1.9.3

Multi user:

# create "rvm" group and add users to it
curl -L https://get.rvm.io | sudo bash -s stable
sudo apt-get install ... # the steps shown in `rvm requirements`
/usr/local/rvm/bin/rvm install 1.9.3
share|improve this answer
    
Upvote for developer response: But we needed automation. When I got in this morning I was told we decided against virtual environments, just using system ruby now, everything works fine and dandy. –  TJ Biddle Aug 1 '12 at 1:23
    
automation will come in RVM2 - fixing stuff or adding features to RVM1 only slows down work on RVM2 - sad but true. –  mpapis Aug 1 '12 at 1:33
add comment

Expect homepage.

Seems to be the standard "how do I skip keyboard input" answer on SO and a lot of the Linux forums.

share|improve this answer
    
I'm confused - can I just wrap the entire command in expect or do I need to run this as an expect file with the shebang and all? It seems every time I try to wrap it I run into issues with it thinking I'm passing it a file. I'm setting this up in the postinst file in a debian package and I don't think I can change it from a bash to expect shebang. –  TJ Biddle Jul 31 '12 at 4:08
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.