头部使用未知选项-1 / -n错误。 可能与ruby有关
在OSX 10.9.1中启动终端时,我遇到了一个反复出现的问题。
每次我启动终端时,我都会重复以下至少30次
Unknown option: 1 Usage: head [-options] ... -m use method for the request (default is 'HEAD') -f make request even if head believes method is illegal -b Use the specified URL as base -t Set timeout value -i Set the If-Modified-Since header on the request -c use this content-type for POST, PUT, CHECKIN -a Use text mode for content I/O -p use this as a proxy -P don't load proxy settings from environment -H send this HTTP header (you can specify several) -u Display method and URL before any response -U Display request headers (implies -u) -s Display response status code -S Display response status chain -e Display response headers -d Do not display content -o Process HTML content in various ways -v Show program version -h Print this message -x Extra debugging output
最后是
/usr/local/bin/rbenv: fork: Resource temporarily unavailable /usr/local/bin/rbenv: line 63: rbenv---version: command not found /usr/local/bin/rbenv: line 63: rbenv-help: command not found
这重复了50次
/usr/local/bin/rbenv: line 63: rbenv---version: command not found /usr/local/bin/rbenv: line 63: rbenv-help: command not found
弄清楚与Ruby有关,我试过了
rvm get stable
和
curl -sSL https://get.rvm.io | bash -s stable
但后来得到错误:
SSL证书问题:证书链中的自签名证书
我也尝试修复权限(像往常一样)没有解决方案(像往常一样)
这不是我熟悉的领域,所以我不确定现在哪棵树吠了。 有人可以帮忙吗?
以下是请求的.bashrc和.bash_profile内容
.bashrc内容:
PATH=$PATH:$HOME/.rvm/bin # Add RVM to PATH for scripting
.bash_profile内容:
# Setting PATH for Python 2.7 # The orginal version is saved in .bash_profile.pysave PATH="/Library/Frameworks/Python.framework/Versions/2.7/bin:${PATH}" export PATH export PATH=$PATH:/usr/local/bin:/Library/Frameworks/Python.framework/Versions/2.7/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/Users/stevekirkby/.rvm/bin export PATH=$PATH:/usr/local/bin:/usr/local/bin:/Library/Frameworks/Python.framework/Versions/2.7/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/Users/stevekirkby/.rvm/bin export PATH=$PATH:/usr/local/bin:/usr/local/sbin:/usr/local/mysql/bin export PATH=$PATH:$HOME/.rvm/bin export PATH="/Applications/XAMPP/xamppfiles/bin:$PATH" eval "$(rbenv init -)" [[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm" # Load RVM into a shell session *as a function* alias htdocs='cd /Applications/XAMPP/xamppfiles/htdocs' alias home='cd /Users/stevekirkby'
谢谢,史蒂夫
我有完全相同的问题。 它源于rbenv
尝试在其中一个脚本中使用head -1
,但是失败了。
问题是你(和我的那个) .bash_profile
包含:
export PATH="/Applications/XAMPP/xamppfiles/bin:$PATH"
/Applications/XAMPP/xamppfiles/bin
文件夹包含一个名为HEAD
的脚本(以HTTP方法命名)和一个不区分大小写的文件系统以及bash(因为ZSH没有这个问题)得到head
和HEAD
混合并且以$PATH
b中的第一个为准。
作为解决方案:
- 从
$PATH
移除/Applications/XAMPP/xamppfiles/bin
(或最后移动它) - 或者,正如我所做的那样,
mv HEAD HTTP_HEAD
在该文件夹中。
PS。 后一个选项可能会破坏一些XAMPP脚本,但我仍然需要在我的路径中使用正确的XAMPP php版本。
通过使用解决
rvm implode
删除ruby版本管理器
然后按照卸载程序结束时的说明删除我的用户名文件夹中.bashrc,.bash_profile和.zshrc中对rvm的引用。
- 使用./configure –with-gcc = clang在Xcode 4.2上使用Lion构建Ruby 1.9.3
- rbenv乘客无法加载此类文件 – bundler / setup
- rbenv安装ruby 2.1.2无法在MAC OSX 10.9.2上加载此类文件 – zlib
- rake退出状态:139
- C编译器无法在Mac OS Mountain Lion上创建可执行文件
- 使用$ sudo bundle exec …引发’bundle:command not found’错误
- 在Mac OS上安装Rails失败,出现多个错误
- 如何在vim中使用正确的ruby? 如何在VIM中修改$ PATH?
- rbenv:ruby:命令未找到