Dieses Thema hat mich schon eine Weile verrückt gemacht und ich würde gerne herausfinden, was falsch läuft. Ich benutze zsh
mit screen
in meinem Terminal, und habe für eine Weile gewesen. Aus irgendeinem Grund wird meine Installation von RVM
jedoch beim Anmelden nicht standardmäßig geladen. Ruby ist korrekt auf die von RVM (1.9.3) installierte Version eingestellt, der Rest der Umgebung wird jedoch nicht geladen:
~/Desktop => ruby -v
ruby 1.9.3p0 (2011-10-30 revision 33570) [x86_64-darwin11.2.0]
~/Desktop => rails -v
Rails is not currently installed on this system. To get the latest version, simply type:
$ sudo gem install rails
You can then rerun your "rails" command.
~/Desktop => rvm reload
RVM reloaded!
~/Desktop => rails -v
Rails 3.2.1
Ich habe keine Ahnung, was schief geht, und nach allem, was ich weiß, sollte nichts schief gehen. Meine screenrc
Datei verwendet die Login-Shell korrekt mit shell -$SHELL
, scheint jedoch keine Auswirkung zu haben (leider ist dies das einzige, was anscheinend die RVM-Installationen anderer Leute repariert hat screen
, und es ist das, was in den Dokumenten vorgeschlagen wird, um sicherzustellen, dass Sie festgelegt haben , aber es scheint keinen Unterschied für mich zu machen).
Ich arbeite unter Mac OS X 10.7.3 und meine Anmeldeshell ist auf eingestellt /bin/zsh
. Benutze ich nicht oh-my-zsh
. Meine zshrc
Datei ist wie folgt (sorry über die Länge - ich bin sicher , dass nicht alle davon relevant sind, aber ich will keine potenziell nützliche Informationen verlassen):
# -----------------------------------------------
# Screen
# -----------------------------------------------
if [[ $TERM != 'screen' ]]; then
exec screen -aADRU
fi
# -----------------------------------------------
# Startup Scripts
# -----------------------------------------------
[[ -s ~/.rvm/scripts/rvm ]] && source ~/.rvm/scripts/rvm
cd ~/Desktop
# -----------------------------------------------
# Environment Variables
# -----------------------------------------------
export HISTFILE=~/.zsh_history
export HISTSIZE=10000
export HISTCONTROL=ignoredups
export SAVEHIST=10000
export PATH=.:~/.rvm/bin:/usr/local/bin:/usr/local/sbin:~/Library/Haskell/bin:/usr/local/narwhal/bin:/bin:/sbin:/usr/bin:/usr/local/share:/usr/sbin:/usr/local/texlive/2011/bin/universal-darwin
export CC=/usr/bin/clang
export EDITOR='vim'
export GIT_EDITOR="mate --name 'Git Commit Message' -wd -l 1"
export LC_TYPE=en_US.UTF-8
export CLICOLOR=AxFxcxdxBxegbdHbGgcdBd
export NODE_PATH=/usr/local/lib/node/:$NODE_PATH
export CAPP_BUILD="/Users/itaiferber/Desktop/Cappuccino Build"
export NARWHAL_ENGINE=jsc
# -----------------------------------------------
# Prompt
# -----------------------------------------------
## Root Prompt
[ $UID = 0 ] && export PROMPT="%~ +=> " && export RPROMPT="%*"
## General Prompt
[ $UID != 0 ] && export PROMPT="%~ => " && export RPROMPT="%*"
# -----------------------------------------------
# Aliases
# -----------------------------------------------
## Command Aliases
alias ..='cd ..'
alias ...='cd ../..'
alias internet='lsof -P -i -n | cut -f 1 -d " " | uniq'
alias restart='sudo shutdown -r NOW'
alias ls='ls -AFGp'
alias tree='tree -alCF --charset=UTF-8 --du --si'
alias zshrc='$=EDITOR ~/.zshrc && source ~/.zshrc'
alias rake='noglob rake'
## Root Aliases
[ $UID = 0 ] && \
alias rm='rm -i' && \
alias mv='mv -i' && \
alias cp='cp -i'
# -----------------------------------------------
# User-defined Functions
# -----------------------------------------------
# Usage: rm <file>
# Description: move files to trash instead of deleting them outright.
# Note: this will move files to the trash as long as no flags are set.
# If a flag is encountered, it will rm the files normally.
rm () {
local path
for path in "$@"; do
if [[ "$path" = -* ]]; then
/bin/rm $@
break
else
local dst=${path##*/}
while [ -e ~/.Trash/"$dst" ]; do
dst="$dst "$(/bin/date +%H-%M-%S)
done
/bin/mv "$path" ~/.Trash/"$dst"
fi
done
}
# Usage: extract <file>
# Description: extracts archived files / mounts disk images.
# Note: .dmg/hdiutil is Mac OS X-specific.
extract () {
if [ -f $1 ]; then
case $1 in
*.tar.bz2) tar -jxvf $1 ;;
*.tar.gz) tar -zxvf $1 ;;
*.bz2) bunzip2 $1 ;;
*.dmg) hdiutul mount $1 ;;
*.gz) gunzip $1 ;;
*.tar) tar -xvf $1 ;;
*.tbz2) tar -jxvf $1 ;;
*.tgz) tar -zxvf $1 ;;
*.zip) unzip $1 ;;
*.Z) uncompress $1 ;;
*) echo "'$1' cannot be extracted/mounted via extract()." ;;
esac
else
echo "'$1' is not a valid file."
fi
}
# Usage: pman <manpage>
# Description: opens up the selected man page in Preview.
pman () {
man -t $@ | open -f -a /Applications/Preview.app
}
# Usage: pid <processname>
# Description: returns the pid of the first process with the given name.
pid () {
ps Ao pid,comm | grep -im1 $1 | awk '{match($0,/([0-9]+)/); print substr($0,RSTART,RLENGTH);}'
}
# Usage: relaunch <appname>
# Description: quits and relaunches the app with the given name.
relaunch () {
kill `pid $1`; open -a $1
}
# Usage: inject <processname>
# Description: uses StarInject to inject code into the first process with the given name.
inject () {
StarInject `pid $1`
}
# Usage: fp <name>
# Description: find and list processes matching a case-insensitive partial-match string.
fp () {
ps Ao pid,comm | awk '{match($0,/[^\/]+$/); print substr($0,RSTART,RLENGTH)": "$1}' | grep -i $1 | grep -v grep
}
# Usage: fk <name>
# Description: find and kill a process matching a case-insensitive partial-match string.
fk () {
IFS=$'\n'
PS3='Kill which process? (1 to cancel): '
select OPT in "Cancel" $(fp $1); do
if [ $OPT != "Cancel" ]; then
kill $(echo $OPT|awk '{print $NF}')
fi
break
done
unset IFS
}
# Usage: console <processname>
# Description: get the latest logs for the given process names.
console () {
if [[ $# > 0 ]]; then
query=$(echo "$*"|tr -s ' ' '|')
tail -f /var/log/system.log | grep -i --color=auto -E "$query"
else
tail -f /var/log/system.log
fi
}
# Usage: create <file>
# Description: creates and opens a file for editing.
create () {
touch $1 && $=EDITOR $1
}
# Usage: reset
# Description: 'resets' the terminal by changing the current working directory
# to the desktop and clearing the screen.
reset () {
cd ~/Desktop && clear
}
# -----------------------------------------------
# zsh Options
# -----------------------------------------------
# Directories
setopt \
AUTO_CD \
AUTO_PUSHD \
CD_ABLE_VARS \
CHASE_DOTS \
CHASE_LINKS
# Completion
setopt \
AUTO_LIST \
AUTO_MENU \
AUTO_PARAM_SLASH \
COMPLETE_IN_WORD \
LIST_TYPES \
MENU_COMPLETE \
REC_EXACT
# History
setopt \
APPEND_HISTORY \
EXTENDED_HISTORY
# Input/Output
setopt \
CORRECT
# Scripts and Functions
setopt \
MULTIOS
# Other
setopt \
NO_BEEP \
ZLE
# Key Bindings
bindkey "^[[3~" delete-char
# -----------------------------------------------
# zsh Autocompletion
# -----------------------------------------------
# Turn on auto-completion.
autoload -U compinit && compinit -C && autoload -U zstyle+
# Attempt to complete as much as possible.
zstyle ':completion:*' completer _complete _list _oldlist _expand _ignored _match _correct
zstyle ':completion:*::::' completer _expand _complete _ignored _approximate
# Sort files by name.
zstyle ':completion:*' file-sort name
# Allow for case-insensitive completion.
zstyle ':completion:*' matcher-list 'm:{a-zA-Z}={A-Za-z}'
# Color completions.
zstyle ':completion:*' list-colors ${LSCOLORS}
zstyle ':completion:*:*:kill:*:processes' command 'ps -axco pid,user,command'
zstyle ':completion:*:*:kill:*:processes' list-colors '=(#b) #([0-9]#)*=0=01;31'
# Set the amount of completions that triggers the menu.
zstyle ':completion:*' menu select=long
# Ignore certain patterns.
zstyle ':completion:*:functions' ignored-patterns '_*'
zstyle ':completion:*:complete:-command-::commands' ignored-patterns '*\~'
zstyle ':completion:*:*:(^rm):*:*files' ignored-patterns '*?.(o|c~|old|pro|zwc)'
# Cache completions.
zstyle ':completion::complete:*' use-cache 1
zstyle ':completion::complete:*' cache-path ~/.zcompcache/$HOST
# Allow errors.
zstyle -e ':completion:*:approximate:*' max-errors 'reply=( $(( ($#PREFIX+$#SUFFIX)/2 )) numeric )'
# Insert all expansions for expand completer (eh, don't know what this does).
zstyle ':completion:*:expand:*' tag-order all-expansions
# Formatting and messages.
zstyle ':completion:*' list-prompt '%SAt %p: Hit TAB for more, or the character to insert%s'
zstyle ':completion:*' verbose yes
zstyle ':completion:*:descriptions' format '%B%d%b'
zstyle ':completion:*:messages' format '%d'
zstyle ':completion:*:warnings' format 'No matches for: %d'
zstyle ':completion:*:corrections' format '%B%d (errors: %e)%b'
zstyle ':completion:*' group-name ''
# Offer indexes before parameters in subscripts.
zstyle ':completion:*:*:-subscript-:*' tag-order indexes parameters
Darüber hinaus ist meine screenrc
Datei wie folgt:
# Use login shell.
shell -$SHELL
# Don't display the copyright page.
startup_message off
# Escapes the 'z' character, instead of 'c'.
escape ^Zz
# Set up the tab bar.
caption always "%?%F%{=u ..}%? %h %-024=%{+b}"
hardstatus alwayslastline "%{= ..} %-w%{=b ..} %n* %t %{-}%+w %=%{= ..}"
Am seltsamsten ist jedoch, dass [[ -s ~/.rvm/scripts/rvm ]] && source ~/.rvm/scripts/rvm && rvm reload
die Meldung angezeigt wird, wenn ich meine RVM-Beschaffungslinie auf ändere RVM reloaded!
, die Umgebung jedoch noch nicht eingerichtet ist. rails
wird erst erkannt, wenn ich RVM erneut lade.
Jede Hilfe dabei wäre sehr dankbar. Vielen Dank!
zsh
- Version 4.3.11
. Ich kann versuchen, 4.3.12
über Homebrew zu installieren, wenn es helfen würde.
4.3.12
machte keinen Unterschied.