user1328342
user1328342

Reputation: 191

rvm-shell command stops executing other commands

I have written a shell script where i wrote one rvm-shell command. The issue is any line after this command will not get executed. The script is as follows:

#!/bin/bash
set x
rvm-shell ruby-1.9.3-p448@global //after this line not anything get executed
echo $?  //not get executed
clear    //not get executed

rails s  //not get executed which i want to run

Upvotes: 1

Views: 494

Answers (1)

mpapis
mpapis

Reputation: 53158

rvm-shell ruby-1.9.3-p448@global

without any parameters is equivalent to running

rvm ruby-1.9.3-p448@global do bash

which will enter shell session and wait for your input.

what you need is:

rvm use ruby-1.9.3-p448@global

or:

source "$( rvm ruby-1.9.3-p448@global do rvm env --path )"

debugging source:

env_file="$( rvm ruby-1.9.3-p448@global do rvm env --path )"
echo "env_file:$env_file:"
source "$env_file"

or use this script:

#!/usr/bin/env rvm-shell ruby-1.9.3-p448@global

rails s

Upvotes: 2

Related Questions