Jump to content

The ultimate community for Ruby on Rails developers.


Photo

error while running ruby application at system startup in ubuntu

rails ruby shell

  • Please log in to reply
No replies to this topic

#1 anjo

anjo

    Passenger

  • Members
  • 1 posts

Posted 02 June 2014 - 09:35 AM

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
 
$ rvm info
 
    ruby-1.9.2-p320:
 
    system:
    uname:       "Linux Lenovo-G570 3.2.0-61-generic-pae #92-Ubuntu SMP Tue Apr 1 00:10:04 UTC 2014 i686 i686 i386
 
   GNU/Linux"
   system:      "ubuntu/12.04/i386"
   bash:        "/bin/bash => GNU bash, version 4.2.25(1)-release (i686-pc-linux-gnu)"
   zsh:         " => not installed"
 
   rvm:
    version:      "rvm 1.25.22 (stable) by Wayne E. Seguin <wayneeseguin@gmail.com>, Michal Papis <mpapis@gmail.com> [https://rvm.io/]"
    updated:      "2 months 3 days 22 hours 44 minutes 51 seconds ago"
    path:         "/home/ubuntupc/.rvm"
 
  ruby:
    interpreter:  "ruby"
    version:      "1.9.2p320"
    date:         "2012-04-20"
    platform:     "i686-linux"
    patchlevel:   "2012-04-20 revision 35421"
    full_version: "ruby 1.9.2p320 (2012-04-20 revision 35421) [i686-linux]"
 
  homes:
    gem:          "/home/ubuntupc/.rvm/gems/ruby-1.9.2-p320"
    ruby:         "not set"
 
  binaries:
    ruby:         "/home/ubuntupc/.rvm/rubies/ruby-1.9.2-p320/bin/ruby"
    irb:          "/home/ubuntupc/.rvm/rubies/ruby-1.9.2-p320/bin/irb"
    gem:          "/home/ubuntupc/.rvm/rubies/ruby-1.9.2-p320/bin/gem"
    rake:         "/home/ubuntupc/.rvm/gems/ruby-1.9.2-p320/bin/rake"
 
  environment:
    PATH:         "/home/ubuntupc/.rvm/gems/ruby-1.9.2-p320/bin:/home/varun/.rvm/gems/ruby-1.9.2-p320@global/bin:/home/ubuntupc/.rvm/rubies/ruby-1.9.2-p320/bin:/usr/lib/lightdm/lightdm:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/home/ubuntupc/.rvm/bin"
    GEM_HOME:     "/home/ubuntupc/.rvm/gems/ruby-1.9.2-p320"
    GEM_PATH:     "/home/ubuntupc/.rvm/gems/ruby-1.9.2-p320:/home/varun/.rvm/gems/ruby-1.9.2-p320@global"
    MY_RUBY_HOME: ""
    IRBRC:        "/home/ubuntupc/.rvm/rubies/ruby-1.9.2-p320/.irbrc"
    RUBYOPT:      ""
    gemset:       ""
 
Please point out what i am missing as i am new to the ruby applications and to the forum. 
 
Thanks in advance






Also tagged with one or more of these keywords: rails, ruby shell

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users