在Raspbian / etc / profile脚本中找不到命令

时间:2012-09-28 01:03:03

标签: linux bash debian raspberry-pi raspbian

我在最后修改了我的/etc/profile脚本以自动加载rvmsudo siriproxy server,但是我收到了一些奇怪的错误:

的/ etc /简档

# /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

前两行用于设置ls颜色别名和目录更改。问题如下:

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$

它的意图如下:

pi@raspberrypi:~/SiriProxy$ rvmsudo siriproxy server
Starting SiriProxy on port 443..

1 个答案:

答案 0 :(得分:2)

  1. which rvmsudo
  2. 修改/ etc / profile以执行以下操作之一:
    • 指定rvmsudo的绝对路径
    • 包括路径中的rvmsudo目录。