wget http://pkgconfig.freedesktop.org/releases/pkg-config-0.29.tar.gz . env LDFLAGS="-framework CoreFoundation -framework Carbon" ./configure --with-internal-glib make sudo make install
分类目录归档:mac心路历程
mac安装django1.5.4
1.下载安装程序
打开终端输入以下命令
$ wget http://www.djangoproject.com/m/releases/1.5/Django-1.5.4.tar.gz
2.把刚下载的包解压缩
$ tar zxvf Django-1.5.4.tar.gz
3.打开解压文件,安装
$ cd Django-1.5.4
$ python setup.py install
4. 测试一下安装的django的
$ python
这样就进入了python环境
$ import django
$ django.VERSION
详细的操作过程如下:
angela@angeladeMacBook-Air:/workspace$python
Python 2.7.5 (default, Aug 25 2013, 00:04:04)
[GCC 4.2.1 Compatible Apple LLVM 5.0 (clang-500.0.68)] on darwin
Type “help”, “copyright”, “credits” or “license” for more information.
>>> import django
>>> django.VERSION
(1, 5, 4, ‘final’, 0)
mac安装软件管家homebrew
- 简介
众所周知,Mac的操作系统是基于Unix的,在这个系统上大家可以安装一些专门为mac定制开发的软件。这就带来了一个问题,手工编译每个软件,手动进行依赖管理不是很方便,也不利于管理已安装的软件,所以mac中就诞生了软件管理工具Homebrew,Linux中咱们常用的蕾丝的软件管理工具有apt-get、yum等。
Homebrew安装软件时候,首选系统自带的各种库,减少了使得软件包的编译时间,效率很高;与此同时,也不会带来系统冗余,软件包的管理非常方便灵活。Homebrew的还有一个特点是使用Ruby定义的软件包安装配置(叫做formula),定制非常easy。
homebrew会将软件安装到独立的目录,并将文件地址软链接至/usr/local ,所有文件均会被安装到预定义目录下,所以使用之后无需担心安装位置啦。
开始用homebrew来管理依赖包吧。
2.下面咱们来安装一下homebrew吧,在终端输入以下的代码,回车之后就开始安装啦。
$ ruby -e “$(curl -fsSL https://raw.github.com/Homebrew/homebrew/go/install)”
关于mac安装rails报错clang: error: unknown argument
mac上安装rails的时候报错,
安装rails的在终端执行了一句命令:
$sudo gem install rails
报错了,报错信息为
clang: error: unknown argument: ‘-multiply_definedsuppress’ [-Wunused-command-line-argument-hard-error-in-future]
完整的执行过程及报错信息如下:
angela@angeladeMacBook-Air:~$sudo gem install rails
Password:
Building native extensions. This could take a while…
ERROR: Error installing rails:
ERROR: Failed to build gem native extension.
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/bin/ruby extconf.rb
creating Makefile
make “DESTDIR=”
compiling generator.c
linking shared-object json/ext/generator.bundle
clang: error: unknown argument: ‘-multiply_definedsuppress’ [-Wunused-command-line-argument-hard-error-in-future]
clang: note: this will be a hard error (cannot be downgraded to a warning) in the future
make: *** [generator.bundle] Error 1
Gem files will remain installed in /Library/Ruby/Gems/2.0.0/gems/json-1.8.1 for inspection.
Results logged to /Library/Ruby/Gems/2.0.0/gems/json-1.8.1/ext/json/ext/generator/gem_make.out
原因很简单,
Xcode 5.1中的苹果编译器将不认识的命令行视为错误行为。这类报错常出现在ruby和python的安装过程中,因为这两类程序中,很多编译语句较为特殊。
解决方案就是在安装语句前面加上这句
ARCHFLAGS=-Wno-error=unused-command-line-argument-hard-error-in-future ,
以安装rails为例,使用以下的语句:
$ARCHFLAGS=-Wno-error=unused-command-line-argument-hard-error-in-future gem install rails
在mac上安装nodejs
node.js最初是2009年发布的,目标是为聊实现事件驱动和非阻塞I/O的web服务器,应用的场景非常的广泛,有web服务器、实时应用、分布式应用、游戏、一些工具中,它是基于Chrome的V8引擎开发的。大家可以在github上找到开源代码:
http://github.com/joyent/node.
之前用的电脑是windows系统的,现在换了mac之后需要在mac上重新安装下,let‘s start now
git clone git://github.com/ry/node.git
cd node
./configure
make
sudo make install
mac安装最新版本的git
1.下载一个安装包哦
在mac下安装git,首先下载一个git安装包,这里我选的是git-1.9.3.tar ,
因为这是比较新的一个版本,
网址是 https://www.kernel.org/pub/software/scm/git/
2. 在一个你喜欢的文件夹里解压一下安装包
打开terminal终端,进入安装包所在的文件夹之后执行以下的解压命令
$ tar -xf git-1.9.3.tar
3. 编译安装的命令如下
$ cd git-1.9.3
$ ./configure –prefix=/usr/local
$ make
$ sudo make install
4.查看一下git的安装路径
$which git
这里会得到路径/usr/local/bin/git
祝贺你已经安装完啦。以下来配置ssh连接吧
1.生成ssh的key
$ ssh-keygen -t rsa -C aaaa@163.com (后面的是git上注册的邮件哦)
$ vim id_rsa.pub (用vim命令打开文件可以复制一下啦)
不明白的同学可以看下面完的完整操作记录如下哦
angeladeMacBook-Air:.ssh angela$ ssh-keygen -t rsa -C aaaaa@163.com
Generating public/private rsa key pair.
Enter file in which to save the key (/Users/angela/.ssh/id_rsa): key
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
angeladeMacBook-Air:.ssh angela$ ssh-keygen -t rsa -C aaaaa@163.com
Generating public/private rsa key pair.
Enter file in which to save the key (/Users/angela/.ssh/id_rsa):
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /Users/angela/.ssh/id_rsa.
Your public key has been saved in /Users/angela/.ssh/id_rsa.pub.
The key fingerprint is:
0e:70:c0:67:4b:08:15:b3:37:d9:b9:9a aaaaa@163.com
The key’s randomart image is:
+–[ RSA 2048]—-+
| .+=o |
| o++o |
| o+=.. |
| +.. . |
| o=.. |
| E+o |
+—————–+
2.登录github设置一下账户里的ssh key
在登录后直接点击右上方的工具按钮,也就是页面最上方从右边数第二个按钮(Account settings)
或者直接点击下面的网址
https://github.com/settings/ssh
进入Account setting之后,页面左侧有一列菜单,里面有一项是 SSH keys,点击后页面右侧会有add SSH keys的选项,点击后就可以把之前vim id_rsa.pub之后的内容粘贴过来啦。
3 已经配好啦,现在就可以回终端里测试一下啦。
angeladeMacBook-Air:.ssh angela$ ssh git@github.com
The authenticity of host ‘github.com (192.30.xxx .xxx)’ can’t be established.
RSA key fingerprint is 16:27:ac::63:1b:56:4d:eb:df:a68.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added ‘github.com,192.30.xxx.xxx’ (RSA) to the list of known hosts.
PTY allocation request failed on channel 0
Hi aaaaaa! You’ve successfully authenticated, but GitHub does not provide shell access.
Connection to github.com closed.
完成啦,现在github和本地的git就可以顺利的连接啦,本地的代码就可以上传git仓库啦。
怎样从命令行进入mac桌面
刚买的mac电脑,想在终端进入桌面,可以用下面的方式
点击桌面右上方的放大镜搜索到Terminal并打开,输入
$ cd /Users
这里会显示多个用户,进入自己的用户文件夹就可以啦,
在进入电脑的时候会有自己的用户名,
$ cd <your user name>
$ cd Desktop