简体   繁体   English

OSX上的Ruby on Rails-我搞砸了安装程序吗?

[英]Ruby on Rails on OSX - did I mess up my install?

I just installed Rails on OSX. 我刚刚在OSX上安装了Rails。 I used the stock version of Ruby and followed the following procedure: 我使用了Ruby的普通版本,并遵循以下步骤:

  1. Installed newest version of RubyGems 已安装最新版本的RubyGems
  2. Ran sudo gem install rails --include-dependencies 跑sudo gem install rails --include-dependencies
  3. Installed Mongrel using sudo gem install mongrel --include-dependencies 使用sudo gem install mongrel --include-dependencies安装了Mongrel

Rails is working just fine, but more reading led me to this setup guide: Rails工作正常,但是更多的阅读使我着手这份设置指南:

http://hivelogic.com/articles/ruby-rails-mongrel-mysql-osx http://hivelogic.com/articles/ruby-rails-mongrel-mysql-osx

This is essentially the exact same install I performed, except he compiles it from source code and installs to /usr/local -- I really like this idea, since it keeps the OSX install stock and confines all my dev stuff to one area. 除了他从源代码编译并安装到/ usr / local之外,这基本上与我执行的安装完全相同-我真的很喜欢这个想法,因为它保留了OSX的安装资源并将所有我的开发人员仅限于一个区域。

So, assuming I want to follow these instructions, what do I need to do to revert my system back to "stock" ruby? 因此,假设我要遵循这些说明,我该怎么做才能将系统恢复为“原厂”红宝石? Can I just uninstall the Rails and Mongrel gems? 我可以只卸载Rails和Mongrel宝石吗? Will the upgraded RubyGems cause any issues? 升级后的RubyGems会引起任何问题吗?

Basically, my concern is that some other software unrelated to my development work will need to use OSX's stock Ruby, and I will have screwed it up somehow. 基本上,我担心的是,与我的开发工作无关的其他软件将需要使用OSX的Ruby,而我将以某种方式对其进行破坏。 Any advice to undo the 3 steps I listed above and get as close to stock as possible would be appreciated. 任何撤消我上面列出的3个步骤并尽可能接近库存的建议,将不胜感激。

Thanks! 谢谢!

The article you are referring to is over three years old (which is outdated in the Rails community). 您所指的文章已有3年以上的历史(在Rails社区中已过时)。 My recommendation is: 我的建议是:

  1. Install XCode 安装XCode
  2. Install Homebrew 安装自制软件
    1. Install MySQL, Postgres, Image Magick, etc. (brew install mysql, etc.) 安装MySQL,Postgres,Image Magick等(旧安装mysql等)
  3. Install RVM 安装RVM
    1. Install Ruby 1.9.2 (rvm install 1.9.2) 安装Ruby 1.9.2(rvm安装1.9.2)
    2. Switch to default (rvm 1.9.2 --default) 切换为默认值(rvm 1.9.2 --default)
    3. Install Rails (gem install rails) 安装导轨(宝石安装导轨)
    4. Install Passenger (gem install passenger) 安装乘客(宝石安装乘客)

Each step will have a few more substeps but you should be able to look them up or be promted with them. 每个步骤都会有几个子步骤,但是您应该可以查找它们或将其提示。

I can't remember why I did this but I do know that it worked and has caused no problems since. 我不记得为什么要这么做,但我确实知道它有效,并且此后没有造成任何问题。 I moved /Library/Ruby to /Library/Ruby.broken and then installed Ruby from source into /usr/local. 我将/ Library / Ruby移至/Library/Ruby.broken,然后将Ruby从源代码安装到/ usr / local。

There's something fundamentally missing with the stock Ruby in OSX. OSX中的Ruby根本缺少一些东西。 I wish I could remember what that was. 我希望我能记住那是什么。

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

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