简体   繁体   English

在Mac OS X 10.6上卸载Ruby on Rails

[英]Uninstall Ruby on Rails on Mac OS X 10.6

I´m trying to get RoR up and running with mysql data base, but it seems to be impossible to me (i get an error when including the mysql gem). 我试图让RoR运行并运行mysql数据库,但对我来说似乎是不可能的(我在包含mysql gem时会收到错误)。 So i tried to do a lot of things over the console with no results and i don´t remeber what i have done. 所以我试图在控制台上做很多事情没有结果,我不记得我做了什么。

So, i want to delete everything and start again from cero. 所以,我想删除所有内容并从cero重新开始。 How can i delete RoR from my Mac ? 如何从Mac上删除RoR?

Thanks! 谢谢!

The easiest way to get a basic RoR setup is to use Homebrew to install mysql and RVM to manage rails. 获得基本RoR设置的最简单方法是使用Homebrew安装mysql和RVM来管理rails。 If you follow the instructions below, including installation of RVM, you wont need to worry about already failed installations of ruby or rails because they'll basically install everything in it's own location and then repoint your environment to the new ruby and rails installation. 如果你按照下面的说明,包括RVM的安装,你不必担心已经安装的ruby或rails失败了,因为它们基本上将所有东西安装在它自己的位置,然后将你的环境重新命名为新的ruby和rails安装。

  1. Visit https://github.com/mxcl/homebrew and read up on homebrew. 访问https://github.com/mxcl/homebrew并阅读自制软件。 You'll thank me later :) 你以后会感谢我:)

  2. Install homebrew with this: 用这个安装自制软件:

    ruby -e "$(curl -fsSL https://gist.github.com/raw/323731/install_homebrew.rb )" ruby -e“$(curl -fsSL https://gist.github.com/raw/323731/install_homebrew.rb )”

  3. Install XCode if you haven't already. 如果您还没有安装XCode。 Easiest way is to use the disk that came with your Mac. 最简单的方法是使用Mac附带的磁盘。

  4. Install git: 安装git:

    brew install git brew安装git

  5. Install RVM: (Optional, but great if you want to use Ruby on Rails with ruby 1.9.2). 安装RVM :(可选,但如果你想使用带有ruby 1.9.2的Ruby on Rails,那就太棒了)。 Again, read up on RVM: http://rvm.beginrescueend.com/ Follow the instructions here: http://rvm.beginrescueend.com/rvm/install/ AND DONT FORGET TO DO THE POST INSTALL!!! 再次阅读RVM: http ://rvm.beginrescueend.com/按照此处的说明操作: http ://rvm.beginrescueend.com/rvm/install/并且忘记忘记安装POST!

  6. Install 1.9.2 and set it to be the default: 安装1.9.2并将其设置为默认值:

    rvm install 1.9.2 rvm install 1.9.2

    This will take a while 这需要一段时间

    rvm --default use 1.9.2 rvm - 默认使用1.9.2

  7. Install Rails 安装Rails

    gem install rails 宝石安装导轨

  8. Install mysql 安装mysql

    brew install mysql brew安装mysql

    (When this is finished, you will need to initialize your database. The instructions will be given to you when the install finishes. If you skip this, your database won't work. If you closed your terminal and want to see the instructions again you can type "brew info mysql" and it will show them to you.) (完成后,您将需要初始化您的数据库。安装完成后将提供给您的说明。如果您跳过此步骤,您的数据库将无法正常工作。如果您关闭终端并希望再次查看说明你可以输入“brew info mysql”,它会显示给你。)

  9. Create your rails app: 创建rails应用程序:

    rails new my_app rails new my_app

Hi I had the same problem with the mysql gem and they way I succeeded was downgrading from ruby 1.9.2 to 1.8.7. 嗨,我有同样的问题与mysql宝石和他们成功的方式是从红宝石1.9.2降级到1.8.7。 I don't know which one are you using. 我不知道你在用哪一个。

I uninstall ruby using port also. 我也使用端口卸载ruby。

Hope this could help. 希望这可以帮助。

Bye 再见

要完全卸载rails和所有gem,请使用sudo权限: -

gem list | cut -d" " -f1 | xargs gem uninstall -aIx

使用rubygems卸载它

gem uninstall rails

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM