سؤال

I have modified my /etc/profile script at the end to automatically load rvmsudo siriproxy server, however I get some strange errors:

/etc/profile

# /etc/profile: system-wide .profile file for the Bourne shell (sh(1))
# and Bourne compatible shells (bash(1), ksh(1), ash(1), ...).

if [ "`id -u`" -eq 0 ]; then
  PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/home/pi/.rvm/bin:/home/pi/.rvm/gems/ruby-1.9.3-p194@SiriProxy/bin"
else
  PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/local/games:/usr/games:/home/pi/.rvm/bin:/home/pi/.rvm/gems/ruby-1.9.3-p194@SiriProxy/bin"
fi
export PATH

if [ "$PS1" ]; then
  if [ "$BASH" ] && [ "$BASH" != "/bin/sh" ]; then
    # The file bash.bashrc already sets the default PS1.
    # PS1='\h:\w\$ '
    if [ -f /etc/bash.bashrc ]; then
      . /etc/bash.bashrc
    fi
  else
    if [ "`id -u`" -eq 0 ]; then
      PS1='# '
    else
      PS1='$ '
    fi
  fi
fi

# The default umask is now handled by pam_umask.
# See pam_umask(8) and /etc/login.defs.

if [ -d /etc/profile.d ]; then
  for i in /etc/profile.d/*.sh; do
    if [ -r $i ]; then
      . $i
    fi
  done
  unset i
fi

alias ls='ls --color'
cd ~/SiriProxy
rvmsudo siriproxy server

The first two lines work where I'm setting the ls color alias and the directory change. The problem is the following:

Last login: Fri Sep 28 11:42:44 2012 from 192.168.10.94
/usr/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require': cannot load such file -- bundler (LoadError)
        from /usr/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
        from /home/pi/SiriProxy/lib/siriproxy/command_line.rb:177:in `load_code'
        from /home/pi/SiriProxy/lib/siriproxy/command_line.rb:84:in `run_server'
        from /home/pi/SiriProxy/lib/siriproxy/command_line.rb:37:in `initialize'
        from bin/siriproxy:6:in `new'
        from bin/siriproxy:6:in `<main>'
pi@raspberrypi:~/SiriProxy$

What it's meant to do is the following:

pi@raspberrypi:~/SiriProxy$ rvmsudo siriproxy server
Starting SiriProxy on port 443..
هل كانت مفيدة؟

المحلول

  1. Do which rvmsudo
  2. Modify /etc/profile to do one of:
    • specify the absolute path to rvmsudo
    • include the directory rvmsudo is in on the path.
مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top