homebrew

How can I use Homebrew to install both Python 2 and 3 on Mac?

核能气质少年 提交于 2019-12-28 01:39:22
问题 I need to be able to switch back and forth between Python 2 and 3. How do I do that using Homebrew as I don't want to mess with path and get into trouble. Right now I have 2.7 installed through Homebrew. 回答1: I would use pyenv You can install it: $ brew install pyenv To enable pyenv in your Bash shell, you need to run: $ eval "$(pyenv init -)" To do this automatically for Bash upon startup, add that line to your ~/.bash_profile . 1 Usage: Once you have installed pyenv and activated it, you

How to avoid “cannot load such file — utils/popen” from homebrew on OSX

旧巷老猫 提交于 2019-12-28 01:39:13
问题 I'm getting an error when I run brew in the terminal: /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:55:in `require': cannot load such file -- utils/popen (LoadError) from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:55:in `require' from /usr/local/Library/Homebrew/utils.rb:6:in `<top (required)>' from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib

搭建开发环境(React Native)

匆匆过客 提交于 2019-12-28 00:15:25
来源: http://reactnative.cn/docs/0.31/getting-started.html 在GitHub上修改这篇文档 欢迎使用React Native!这篇文档会帮助你搭建基本的React Native开发环境。如果你已经搭好了环境,那么可以尝试一下 编写Hello World 。 根本你所使用的操作系统、针对的目标平台不同,具体步骤有所不同。如果想同时开发iOS和Android也没问题,你只需要先选一个平台开始,另一个平台的环境搭建只是稍有不同。 目标平台: iOS Android 开发平台: Mac Linux Windows 译注:如果 阅读完本文档 后还碰到很多环境搭建的问题,我们建议你还可以再看看由本站提供的 环境搭建视频教程 、 windows环境搭建文字教程 、以及 常见问题 。 安装 必需的软件 Homebrew Homebrew , Mac系统的包管理器,用于安装NodeJS和一些其他必需的工具软件。 /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" 译注:在Max OS X 10.11(El Capitan)版本中,homebrew在安装软件时可能会碰到 /usr/local

计算git存储库中的行数

不羁岁月 提交于 2019-12-27 16:16:20
【推荐】2019 Java 开发者跳槽指南.pdf(吐血整理) >>> 我如何计算git存储库中所有文件中存在的总行数? git ls-files 为我提供了git跟踪的文件列表。 我正在寻找一个命令来 cat 所有这些文件。 就像是 git ls-files | [cat all these files] | wc -l #1楼 我遇到了 git ls-files | xargs wc -l 批处理问题 git ls-files | xargs wc -l 在处理大量文件时,其中行计数将被分成多个 total 。 从问题 中获取 提示 为什么wc实用程序会生成多行“total”? ,我发现以下命令绕过了这个问题: wc -l $(git ls-files) 或者,如果您只想检查一些文件,例如代码: wc -l $(git ls-files | grep '.*\\.cs') #2楼 无论如何,最好的解决方案都埋没在@ ephemient的回答的评论中。 我只是把它拉到这里,以免它被忽视。 这个应该归功于@FRoZeN(和@ephemient)。 git diff --shortstat `git hash-object -t tree /dev/null` 返回repo工作目录中的文件和行总数,没有任何额外的噪音。 作为奖励,只计算源代码 - 从计数器中排除二进制文件。

node 5.5.0 already installed but node -v fetches with “v4.2.1” on OS X & homebrew?

蹲街弑〆低调 提交于 2019-12-27 16:08:07
问题 I'm trying to update my nodejs v4.2.1 to the latest version and successfully got that. But node -v still gives me '-v4.2.1'. 回答1: Probably the older Node is in your PATH before the newer one. You can run in your shell: which node to see where is the Node binary that is run by default (v4.2.1 in your case). You can see what is your PATH by running: echo $PATH It will show something like: /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin Those are directories that are searched in

node 5.5.0 already installed but node -v fetches with “v4.2.1” on OS X & homebrew?

时间秒杀一切 提交于 2019-12-27 16:06:37
问题 I'm trying to update my nodejs v4.2.1 to the latest version and successfully got that. But node -v still gives me '-v4.2.1'. 回答1: Probably the older Node is in your PATH before the newer one. You can run in your shell: which node to see where is the Node binary that is run by default (v4.2.1 in your case). You can see what is your PATH by running: echo $PATH It will show something like: /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin Those are directories that are searched in

mac下安装和使用brew

眉间皱痕 提交于 2019-12-27 11:27:42
brew 官网: https://brew.sh/index_zh-cn.html 安装homebrew:复制此命令到终端 /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" 安装git,如下图 使用brew list 查看安装成功的git 同理安装jmeter 配置Jmeter中文环境:我的jmeter bin目录如下: /*--> */ /*--> */ /usr/local/Cellar/jmeter/5.1.1/libexec/bin 在bin目录下找到jmeter.properties文件,修改第37行,language = zh_CN,保存即可。 启动Jmeter 终端下,直接输入jmeter命令,启动Jmeter 启动之后我们可以看到终端打印的信息:不要使用GUI模式进行负载测试,GUI只用于创建脚本以及用来debug,执行测试时建议使用非GUI模式运行。后面紧接着的就是命令行模式的命令提示。 下面参考下网友的总结: 查看brew的帮助 brew –help 安装软件 brew install git 卸载软件 brew uninstall git 搜索软件 brew search git 显示已经安装软件列表 brew

brew和brew cask安装

自古美人都是妖i 提交于 2019-12-26 18:55:05
brew 是从下载源码解压然后 ./configure && make install ,同时会包含相关依存库。并自动配置好各种环境变量,而且易于卸载。 这个对程序员来说简直是福音,简单的指令,就能快速安装和升级本地的各种开发环境。 而 brew cask 是 已经编译好了的应用包 (.dmg/.pkg),仅仅是下载解压,放在统一的目录中(/opt/homebrew-cask/Caskroom),省掉了自己去下载、解压、拖拽(安装)等蛋疼步骤,同样,卸载相当容易与干净。这个对一般用户来说会比较方便,包含很多在 AppStore 里没有的常用软件。 作者:墨磊 链接:https://www.zhihu.com/question/22624898/answer/22782144 来源:知乎 著作权归作者所有,转载请联系作者获得授权。 1、安装brew参考官网http://brew.sh/index_zh-cn.html /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"2、安装brew caskbrew install brew-cask错误提示:Could not link caskroom/cask manpages to: /usr

mac攻略(二) -- 简单配置php开发环境

亡梦爱人 提交于 2019-12-26 12:09:14
最简单直接的方式还是使用 Mac 上自带的 Apache 和 PHP。 1.启动 Apache 1>启动apache $sudo apachectl start; 2>启动后,在浏览器中输入 localhost ,可以看到页面上显示 It works。(/Library/WebServer/Documents/ 下的 index.html.en 文件) 3>Apache 的默认根目录是 /Library/WebServer/Documents/ 2.添加apache对php的支持 1>打开 http.conf 配置文件: sudo vim /etc/apache2/httpd.conf 2>找到以下代码并去掉注释(去掉前面的‘#’号), wq 保存退出。 LoadModule php5_module libexec/apache2/ libphp5.so 3.重启 Apache,进行php类型文件的调试 重启: sudo apachectl restart 在 Apache 的根目录 /Library/WebServer/Documents/ 下新建project文件夹并写一个php文件输出'hello world'。此时,在浏览器打开 http://localhost/project/test.php 就可以正常看到hello world 了~ (如果有权限问题, sudo

Mac OS 10.12系统cocoapods安装

Deadly 提交于 2019-12-26 00:15:00
【推荐】2019 Java 开发者跳槽指南.pdf(吐血整理) >>> 从git上下载的项目运行后: The file “Pods.xcconfig” couldn’t be opened because there is no such file. 1、检查当前ruby版本 $gem sources - 成功后提示: *** CURRENT SOURCES *** https://ruby.taobao.org/ 否则,移除现有的ruby:$gem sources --remove https://rubygems.org/;添加使用淘宝镜像:$gem sources -a https://ruby.taobao.org/ 2、开始安装cocoapods $sudo gem install cocoapods 运行后出现错误 2.1检查ruby版本 $ruby -v ruby 2.0.0p648 (2015-12-16 revision 53162) [universal.x86_64-darwin15] 2.2需要升级ruby; 查看目前所有ruby版本:$rvm list known 如果提示command not found $curl -L get.rvm.io | bash -s stable 请先安装rvm:rvm install 2.2.2 ;如果不成功