gpt4 book ai didi

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

转载 作者:塔克拉玛干 更新时间:2023-11-03 00:25:58 25 4
gpt4 key购买 nike

我在末尾修改了我的 /etc/profile 脚本以自动加载 rvmsudo siriproxy 服务器,但是我遇到了一些奇怪的错误:

/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

前两行用于设置 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. 执行which rvmsudo
  2. 修改/etc/profile 以执行以下操作之一:
    • 指定 rvmsudo 的绝对路径
    • 在路径中包含 rvmsudo 所在的目录。

关于linux - 在 Raspbian/etc/profile 脚本中找不到命令,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12632224/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com