Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

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

/home/ubuntupc/.rvm/rubies/ruby-1.9.2-p320/bin/ruby

$ which rails

/home/ubuntupc/.rvm/gems/ruby-1.9.2-p320/bin/rails

$ which gem

/home/ubuntupc/.rvm/rubies/ruby-1.9.2-p320/bin/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

/home/ubuntupc/.rvm/rubies/ruby-1.9.2-p320/bin/ruby

$ sudo update-alternatives --config ruby

update-alternatives: error: no alternatives for ruby.

$ sudo find / -name "rubygems" -print

/home/ubuntupc/.rvm/rubies/ruby-1.9.2-p320/lib/ruby/site_ruby/1.9.1/rubygems
/home/ubuntupc/.rvm/rubies/ruby-1.9.2-p320/lib/ruby/1.9.1/rubygems
/home/ubuntupc/.rvm/src/ruby-1.9.2-p320/lib/rubygems
/home/ubuntupc/.rvm/src/ruby-1.9.2-p320/test/rubygems
/home/ubuntupc/.rvm/src/ruby-1.9.2-p320/test/rubygems/rubygems
/home/ubuntupc/.rvm/src/ruby-1.9.2-p320/doc/rubygems
/home/ubuntupc/.rvm/src/rubygems-2.2.1/lib/rubygems
/home/ubuntupc/.rvm/src/rubygems-2.2.1/test/rubygems
/home/ubuntupc/.rvm/src/rubygems-2.2.1/test/rubygems/rubygems
/home/ubuntupc/.rvm/src/rvm/scripts/functions/rubygems
/home/ubuntupc/.rvm/src/rvm/scripts/rubygems
/home/ubuntupc/.rvm/scripts/functions/rubygems
/home/ubuntupc/.rvm/scripts/rubygems
/usr/lib/ruby/1.9.1/rubygems
/usr/local/rvm/rubies/ruby-1.9.2-p320/lib/ruby/site_ruby/1.9.1/rubygems
/usr/local/rvm/rubies/ruby-1.9.2-p320/lib/ruby/1.9.1/rubygems
/usr/local/rvm/src/ruby-1.9.2-p320/lib/rubygems
/usr/local/rvm/src/ruby-1.9.2-p320/test/rubygems
/usr/local/rvm/src/ruby-1.9.2-p320/test/rubygems/rubygems
/usr/local/rvm/src/ruby-1.9.2-p320/doc/rubygems
/usr/local/rvm/src/rubygems-2.2.0/lib/rubygems
/usr/local/rvm/src/rubygems-2.2.0/test/rubygems
/usr/local/rvm/src/rubygems-2.2.0/test/rubygems/rubygems
/usr/local/rvm/src/rvm/scripts/functions/rubygems
/usr/local/rvm/src/rvm/scripts/rubygems
/usr/local/rvm/scripts/functions/rubygems
/usr/local/rvm/scripts/rubygems

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

Thanks in advance

share|improve this question

1 Answer 1

up vote 0 down vote accepted

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
share|improve this answer
    
That solved. Now it works fine. –  anjo Jun 2 at 16:44

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.