I am on Ubuntu 12.04 machine. Have a script file which runs when entered manually in terminal

gnome-terminal -e /home/precise/Desktop/cartodb/script.sh

The content of script file is

cd /home/ubuntupc/Desktop/cartodb20/
sh /home/ubuntupc/.rvm/scripts/rvm
bundle exec foreman start -p 3000

So what i tried to do is to run this script at every system start up. So on Startup Applications

command: gnome-terminal -e /home/precise/Desktop/cartodb/script.sh

On terminal Edit -> Profile Preferences -> Title and Command

Checked the "Run command as a login shell"

But this seems to be not working. When restarted the machine found these error in terminal

The child process exited normally with status 127.
ERROR: RVM Ruby not used, run `rvm use ruby` first.

Some info regarding the installed packages and system.

$ which ruby


$ which rails


$ which gem


$ cat ~/.bash_profile

[[ -s "$HOME/.profile" ]] && source "$HOME/.profile" # Load the default .profile

[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm" # Load RVM into a shell session *as a function*

$ which -a ruby


$ sudo update-alternatives --config ruby

update-alternatives: error: no alternatives for ruby.

$ sudo find / -name "rubygems" -print


Please point out what i am missing as i am new to the ruby applications.

Thanks in advance


Your code does

sh /home/ubuntupc/.rvm/scripts/rvm

Which will run rvm with no arguments. What you actually want to do is to include the rvm code in your current script, so replace that line with

source $HOME/.rvm/scripts/rvm
  • That solved. Now it works fine. – anjo Jun 2 '14 at 16:44

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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