博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
002_网上脚本执行请注意,慎重
阅读量:6422 次
发布时间:2019-06-23

本文共 3092 字,大约阅读时间需要 10 分钟。

一、进坑过程如下

执行ansible遇到这种错误:(1)dyld: Library not loaded: @executable_path/../.Python  Referenced from: /your/home/.virtualenvs/virtualenv_name/bin/python  Reason: image not found[1]    95221 trace trap  python(2)于是从Google查解决方案。看到是之前同事写的,就没细看就执行了,执行关键内容如下#https://gist.github.com/tevino/1a557a0c200d61d4e4fbread -p "‼️  Press Enter if you are not sure (y/N) " -n 1 -rechoif [[ $REPLY =~ ^[Yy]$ ]]; then    echo "♻️  Removing old symbolic links......"    find "$ENV_PATH" -type l -delete -print      #######important########    echo "?  Creating new symbolic links......"    $SYSTEM_VIRTUALENV "$ENV_PATH"    echo "?  Done!"fi(3)执行完就哭了,很多命令都找不到了,原因是删除了/usr/local及/usr/local/bin下的所有软连接(4)粗糙的执行恢复:cd /usr/local/binfor i in `ls ../Cellar/*/*/bin`;do    softlinksrc=`sudo find /usr/local/Cellar  -name $i|sed  's#/usr/local#..#g'`    ln -s $softlinksrc .done
(5)或执行以下恢复Updating Homebrew...Warning: nginx 1.13.12 is already installed, it's just not linkedYou can use `brew link nginx` to link this version.即:brew link custom_software_name➜  nginx brew link --overwrite --dry-run wgetWould remove:/usr/local/bin/wget -> /usr/local/Cellar/wget../Cellar/wget/1.19.1_1/bin/wget(6)for cs in `ls /usr/local/Cellar`;do    brew link --overwrite --dry-run $cs    brew link $csdone

拿wget举例:

这种warning单独处理下吧.已经提示很明显了

二、总结

坑的连接如下:#https://gist.github.com/tevino/1a557a0c200d61d4e4fb其中有个叫laymonk的哥们明确说了这有坑了,所以以后Google和github出的内容一定要看完,谨记!!!laymonk commented on Oct 7, 2016 • I stumbled upon this, and just had to comment.I imagine you reckon you are being helpful, but this a most dangerous thing to ask people to run. Running it could easily delete all links in /usr/local, which is the standard place homebrew installs pip (so, your $ENV_PATH will be /usr/local)The simple fix involves just cd'ing into the virtualenv, and deleting all the stale links to the upgraded python by running:find . -type l -delete.. and then re-installing your virtualenv:mkvirtualenv venv-name or virtualenv venv-nameAn unsuspecting user may not understand the implication of answering yes, and have all symlinks blown away from /usr/local .. I think you should take this down, or amend it. No offence intended.

三、遗留问题处理

(1)diagnosis

➜  ~ brew doctor    #根据brew doctor的建议进行响应的操作,notice warning section.Warning: You have unlinked kegs in your CellarLeaving kegs unlinked can lead to build-trouble and cause brews that depend onthose kegs to fail to run properly once built. Run `brew link` on these:  python  ruby  vimWarning: Homebrew's sbin was not found in your PATH but you have installedformulae that put executables in /usr/local/sbin.Consider setting the PATH for example like so  echo 'export PATH="/usr/local/sbin:$PATH"' >> ~/.zshrcWarning: Broken symlinks were found. Remove them with `brew prune`:  /usr/local/bin/bin  /usr/local/bin/erb  /usr/local/bin/gem  /usr/local/bin/irb  /usr/local/bin/rake  /usr/local/bin/rdoc  /usr/local/bin/ri  /usr/local/bin/ruby  /usr/local/bin/sqlite3

(2)multi-version question

➜  ~ brew ls --versions | grep vimvim 8.0.1250 8.0.1600➜  ~ brew uninstall --force vim➜  ~ brew install vim    #解决

 

转载地址:http://mqrra.baihongyu.com/

你可能感兴趣的文章
TeeChart for vs 2005 破解
查看>>
艾伟_转载:Entity Framework的默认值BUG解决方法
查看>>
一起谈.NET技术,WPF 自定义快捷键命令(Command)
查看>>
一起谈.NET技术,使用 Silverlight Media Framework 构建自定义播放器
查看>>
HTML5 【IE9割绳子】制作教程来袭····
查看>>
C++ md5操作(含源码下载)
查看>>
Android bound service 详解三:使用Messenger
查看>>
系统批量安装
查看>>
android完美解决动态创建spinner点击,错误
查看>>
ASP.NET aspx页面中 写C#脚本; ASP.NET 指令(<%@%>);
查看>>
iOS崩溃日志分析-b
查看>>
更数数据库用户密码
查看>>
jQuery学习笔记
查看>>
ps命令查出来的rss/vsz/size分别是何含义呢
查看>>
【转】js弹出框详解
查看>>
The Big List of What’s New or Improved in Silverlight 5
查看>>
Silverlight开发廋身攻略(一)
查看>>
使用VMware Workstation搭建基于Linux的Oracle 10g RAC
查看>>
Sharepoint学习笔记—Debug&TroubleShooting--工具清单
查看>>
Jenkins FQA
查看>>