设为首页 收藏本站
查看: 1068|回复: 0

[经验分享] 在苹果虚拟机上跑 ROR —— Ruby on Rails On Vmware OSX 10.7.3

[复制链接]

尚未签到

发表于 2015-4-4 22:23:24 | 显示全部楼层 |阅读模式
  
1 Get Vmware Image:
  安装苹果虚拟机的过程就略了。从网上也能直接下载到VMWARE OSX 10.7.2的IMAGE。 在线升级成10.7.3即可。
  2 XCODE 4.3  
  通过苹果的下载中心下载安装Xcode 4.3。
  https://developer.apple.com/xcode/
  在这里下载:https://developer.apple.com/downloads/index.action  需要APPLE ID.
  注意连 Command Line Tools For Xcode 也一起下了。 ( Preferences > Downloads > Command Line Tools > Install )
  关于XCODE 4.3的痛苦经历看这里: http://www.iyunv.com/likeyu/archive/2012/02/27/2370639.html
  另外这个文章,有时间要读下: http://www.programmer.com.cn/9436/
  3 homebrew
  https://github.com/mxcl/homebrew/wiki/installation
  /usr/bin/ruby -e "$(curl -fsSL https://raw.github.com/gist/323731)"





4 WGET




Mahmood1s-Mac% brew install wget
==> Downloading http://ftpmirror.gnu.org/wget/wget-1.13.4.tar.bz2
######################################################################## 100.0%
==> ./configure --disable-debug --prefix=/usr/local/Cellar/wget/1.13.4 --sysconf
==> make install
/usr/local/Cellar/wget/1.13.4: 7 files, 552K, built in 2.1 minutes

  
  5 oh-my-zsh



Mahmood1s-Mac% curl -L https://github.com/robbyrussell/oh-my-zsh/raw/master/tools/install.sh | sh
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:--  0:00:01 --:--:--     0
100  1485  100  1485    0     0    230      0  0:00:06  0:00:06 --:--:--   864
Cloning Oh My Zsh...
Cloning into '/Users/mahmood1/.oh-my-zsh'...
remote: Counting objects: 3842, done.
remote: Compressing objects: 100% (1664/1664), done.
remote: Total 3842 (delta 2268), reused 3375 (delta 1964)
Receiving objects: 100% (3842/3842), 498.80 KiB | 27 KiB/s, done.
Resolving deltas: 100% (2268/2268), done.
Looking for an existing zsh config...
Found ~/.zshrc. Backing up to ~/.zshrc.pre-oh-my-zsh
Using the Oh My Zsh template file and adding it to ~/.zshrc
Copying your current PATH and adding it to the end of ~/.zshrc for you.
Time to change your default shell to zsh!
Changing shell for mahmood1.
Password for mahmood1:
chsh: no changes made
         __                                     __   
  ____  / /_     ____ ___  __  __   ____  _____/ /_  
/ __ \/ __ \   / __ `__ \/ / / /  /_  / / ___/ __ \
/ /_/ / / / /  / / / / / / /_/ /    / /_(__  ) / / /
\____/_/ /_/  /_/ /_/ /_/\__, /    /___/____/_/ /_/  
                        /____/                       

....is now installed.

修改MAC OSX 默认的SHELL为zsh
http://www.askdavetaylor.com/how_do_i_change_my_default_shell_in_mac_os_x_panther_from_tcsh_to_bash.html


If you don't want to change the NetInfo database entry for your account, an easier alternative is to go into the Terminal application (Applications -> Utilities -> Terminal) then go to Terminal -> Terminal Preferences and select "Execute this command" and make sure it's the shell you want, as shown here:



  6 macvim 编译
  这里又有BUG,需要 brew edit macvim 加入 "--with-ruby-command=/usr/bin/ruby",



    args = ["--with-features=huge",
"--with-tlib=ncurses",
"--with-ruby-command=/usr/bin/ruby",
"--enable-multibyte",
"--with-macarchs=#{arch}",
"--enable-perlinterp",
"--enable-pythoninterp",
"--enable-rubyinterp",
"--enable-tclinterp"]

  
  
  另外由于xcode 4.3的原因 还需要设置下xcode的环境变量。



sudo xcode-select -switch /Applications/Xcode.app
  
  最后终于安装成功(这里ruby是用的系统的ruby,版本是1.8.7的,先凑合这用)  
  Mahmood1s-Mac% brew install macvim
==> Downloading https://github.com/b4winckler/macvim/tarball/snapshot-64
File already downloaded in /Users/mahmood1/Library/Caches/Homebrew
==> ./configure --with-features=huge --with-tlib=ncurses --with-ruby-command=/usr/bin/ruby --enable-multibyte --with-macarchs=x86_64 --enable-per
==> cd src/MacVim/icons && make getenvy
==> make
==> Caveats
MacVim.app installed to:
/usr/local/Cellar/macvim/7.3-64
  To link the application to a normal Mac OS X location:
brew linkapps
or:
ln -s /usr/local/Cellar/macvim/7.3-64/MacVim.app /Applications
==> Summary
/usr/local/Cellar/macvim/7.3-64: 1733 files, 27M, built in 101 seconds (只用了不到2分钟,真快)
  
  加入系统菜单中:
  Mahmood1s-Mac% brew linkapps
Warning: /Users/mahmood1/Applications does not exist, stopping.
Run `mkdir ~/Applications` first.
Mahmood1s-Mac% mkdir ~/Applications
Mahmood1s-Mac% brew linkapps
Linking /usr/local/Cellar/macvim/7.3-64/MacVim.app
  
  
  8 安装RUBY
  这里有个帖子可以参考,不过那个1step 的shell 没有完善,我这里是不行的。http://dreamhead.blogbus.com/logs/194495277.html
  以下都是手工输代码。



{12-02-28 0:54}Mahmood1s-Mac:~ mahmood1% rvm install 1.9.3 --with-gcc=clang
.............
{12-02-28 1:07}Mahmood1s-Mac:~ mahmood1% rvm gemset create rails3
'rails3' gemset created (/Users/mahmood1/.rvm/gems/ruby-1.9.3-p125@rails3).
{12-02-28 1:08}Mahmood1s-Mac:~ mahmood1% rvm use 1.9.3@rails3
Using /Users/mahmood1/.rvm/gems/ruby-1.9.3-p125 with gemset rails3
{12-02-28 1:08}Mahmood1s-Mac:~ mahmood1% rvm use 1.9.3@rails3 --default
Using /Users/mahmood1/.rvm/gems/ruby-1.9.3-p125 with gemset rails3

  改用淘宝ruby的镜像:



{12-02-28 1:10}Mahmood1s-Mac:~ mahmood1% gem sources --remove http://rubygems.org/
http://rubygems.org/ removed from sources
{12-02-28 1:10}Mahmood1s-Mac:~ mahmood1% gem sources --add http://ruby.taobao.org/
http://ruby.taobao.org/ added to sources
{12-02-28 1:11}Mahmood1s-Mac:~ mahmood1%
{12-02-28 1:11}Mahmood1s-Mac:~ mahmood1% gem sources list
*** CURRENT SOURCES ***

http://ruby.taobao.org/

安装RAILS当前版本。
{12-02-28 1:11}Mahmood1s-Mac:~ mahmood1% gem install rails bundle therubyracer

  
  9 其他待续。主要是安装传说中的TEXTMATE等编辑器。不过我试了下TEXTMATE后感觉,学习成本过高,因为有VIM基础不如直接用VIM好了。
  

运维网声明 1、欢迎大家加入本站运维交流群:群②:261659950 群⑤:202807635 群⑦870801961 群⑧679858003
2、本站所有主题由该帖子作者发表,该帖子作者与运维网享有帖子相关版权
3、所有作品的著作权均归原作者享有,请您和我们一样尊重他人的著作权等合法权益。如果您对作品感到满意,请购买正版
4、禁止制作、复制、发布和传播具有反动、淫秽、色情、暴力、凶杀等内容的信息,一经发现立即删除。若您因此触犯法律,一切后果自负,我们对此不承担任何责任
5、所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其内容的准确性、可靠性、正当性、安全性、合法性等负责,亦不承担任何法律责任
6、所有作品仅供您个人学习、研究或欣赏,不得用于商业或者其他用途,否则,一切后果均由您自己承担,我们对此不承担任何法律责任
7、如涉及侵犯版权等问题,请您及时通知我们,我们将立即采取措施予以解决
8、联系人Email:admin@iyunv.com 网址:www.yunweiku.com

所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其承担任何法律责任,如涉及侵犯版权等问题,请您及时通知我们,我们将立即处理,联系人Email:kefu@iyunv.com,QQ:1061981298 本贴地址:https://www.yunweiku.com/thread-53906-1-1.html 上篇帖子: [vmware]另类解决vmware关闭win10死机或蓝屏问题 下篇帖子: Vmware安装Mac
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

扫码加入运维网微信交流群X

扫码加入运维网微信交流群

扫描二维码加入运维网微信交流群,最新一手资源尽在官方微信交流群!快快加入我们吧...

扫描微信二维码查看详情

客服E-mail:kefu@iyunv.com 客服QQ:1061981298


QQ群⑦:运维网交流群⑦ QQ群⑧:运维网交流群⑧ k8s群:运维网kubernetes交流群


提醒:禁止发布任何违反国家法律、法规的言论与图片等内容;本站内容均来自个人观点与网络等信息,非本站认同之观点.


本站大部分资源是网友从网上搜集分享而来,其版权均归原作者及其网站所有,我们尊重他人的合法权益,如有内容侵犯您的合法权益,请及时与我们联系进行核实删除!



合作伙伴: 青云cloud

快速回复 返回顶部 返回列表