gpt4 book ai didi

ruby - Head 用法未知选项 -1/-n 错误。可能与 ruby 有关

转载 作者:数据小太阳 更新时间:2023-10-29 06:47:35 25 4
gpt4 key购买 nike

我在 OSX 10.9.1 中启动终端时反复出现问题。

每次启动终端时,我都会重复以下至少 30 次

Unknown option: 1
Usage: head [-options] <url>...
-m <method> use method for the request (default is 'HEAD')
-f make request even if head believes method is illegal
-b <base> Use the specified URL as base
-t <timeout> Set timeout value
-i <time> Set the If-Modified-Since header on the request
-c <conttype> use this content-type for POST, PUT, CHECKIN
-a Use text mode for content I/O
-p <proxyurl> use this as a proxy
-P don't load proxy settings from environment
-H <header> 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 <format> 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 certificate problem: self signed certificate in certificate chain

我也试过修复权限(像往常一样)但没有解决方案(像往常一样)

这不是我熟悉的区域,所以我不确定现在该叫哪棵树。谁能帮忙?

这里是请求的.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 没有这个问题)将 headHEAD 混合起来并服务于 $PATHb 中的先到者。

作为解决方案:

  • 从您的 $PATH 中删除 /Applications/XAMPP/xamppfiles/bin(或最后移动它)
  • 或者像我一样,在该文件夹中mv HEAD HTTP_HEAD

附言。后一个选项可能会破坏一些 XAMPP 脚本,但我的路径中仍然需要正确的 XAMPP php 版本。

关于ruby - Head 用法未知选项 -1/-n 错误。可能与 ruby 有关,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21498991/

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