• Posts tagged "os x"

Blog Archives

osx文件权限中的@和+

If the file or directory has extended attributes, the permissions field printed by the -l option is followed by a ‘@’ character.
Otherwise, if the file or directory has extended security information (such as an access control list), the permissions field printed by the -l option is followed by a ‘+’ character.

显示文件[夹]:
chflags nohidden ~/Library
如想隐藏,可以在终端中执行命令:
chflags hidden ~/Library

-rw-------@   1 wingyiu  staff  626164 Aug 12  2013 Bookmarks.bak
drwxr-xr-x+   3 wingyiu  staff     102 Jan  2 20:09 Desktop
drwxr-xr-x+  34 wingyiu  staff    1156 Dec 24 19:11 Documents
drwx------+ 278 wingyiu  staff    9452 Jan  5 20:20 Downloads
drwxr-xr-x   34 wingyiu  staff    1156 Dec 23 23:40 Git
drwxr-xr-x   87 wingyiu  staff    2958 Dec 30 23:50 Github
drwx------+  70 wingyiu  staff    2380 Jan  3 17:17 Library
drwx------+   4 wingyiu  staff     136 Jan  2 20:57 Movies
drwx------+   7 wingyiu  staff     238 Oct  7  2013 Music
drwx------+ 252 wingyiu  staff    8568 Jan  5 19:57 Pictures
drwxr-xr-x+   4 wingyiu  staff     136 Sep 28  2012 Public

修复cocoapods

在拉下松爷更新的Podfile后,尝试用pod update更新,结果出现下面错误

$pod update
Update all pods
Analyzing dependencies
[!] Unable to satisfy the following requirements:

- `JSQMessagesViewController (~> 6.1.0)` required by `Podfile`

没什么头绪,尝试查一下版本

$pod list | grep JSQM
  JSQMessagesViewController 6.0.0

JSQMessagesViewController主页明明标了已经是6.1.1,是不是版本库有本地缓存,在pod --help加google下,发现命令pod repo update,果断运行一下,卡住,加上–verbose

$pod repo update --verbose
  $ /usr/bin/git rev-parse  >/dev/null 2>&1

Updating spec repo `master`
  $ /usr/bin/git pull --ff-only
  error: Your local changes to the following files would be overwritten by merge:
  	CocoaPods-version.yml
  	Specs/AdMobMediationAdapterMMedia/1.5.0/AdMobMediationAdapterMMedia.podspec.json
  Please, commit your changes or stash them before you can merge.
  error: The following untracked working tree files would be overwritten by merge:
  	Specs/AAShareBubbles/1.1.0/AAShareBubbles.podspec.json
  	...[略去n行]
  	Specs/AQSEvent/0.2.0/AQSE
  Aborting
  Updating da90008..86016e3

[!] CocoaPods was not able to update the `master` repo. If this is an unexpected issue and persists you can inspect it running `pod repo update --verbose`

果然本地有缓存,还是git管理的,更新时冲突,google了一下,找到相关资料:
1.http://stackoverflow.com/questions/19477178/cocoapods-error-during-pod-update
2.http://blog.cocoapods.org/Repairing-Our-Broken-Specs-Repository/

解决方法:删除本地缓存,重新setup

$rm -fr ~/.cocoapods/repos/master
$pod setup

osx升级到10.9以上homebrew不能用

想用homebrew装个maven结果

$ brew install maven
usr/local/bin/brew: /usr/local/Library/brew.rb: /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby: bad interpreter: No such file or directory
/usr/local/bin/brew: line 23: /usr/local/Library/brew.rb: Undefined error: 0

原因是系统升级后ruby的版本升级到到了2.0,而/usr/local/Library/brew.rb里写死了用1.8版本运行brew

#!/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby -W0
# encoding: UTF-8

在osx 10.10 Yosemite里尝试直接修改1.8为2.0结果don’t work!
在github里找到解决方法:

cd /usr/local
git fetch origin
git reset --hard origin/master

brew又可以用啦