OSX 上的 Ruby on Rails - 我是否搞砸了安装?

发布于 2024-10-27 16:11:24 字数 726 浏览 3 评论 0原文

我刚刚在 OSX 上安装了 Rails。我使用了 Ruby 的库存版本,并按照以下过程进行操作:

  1. 安装了最新版本的 RubyGems
  2. Ran sudo gem install Rails --include-dependency
  3. 使用 sudo gem install mongrel --include-dependency 安装了 Mongrel

Rails 工作正常,但更多阅读导致我查看此设置指南:

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

这基本上与我执行的安装完全相同,只是他从源代码编译它并安装到 /usr/local ——我真的很喜欢这个想法,因为它保留了 OSX 安装库存并且将我所有的开发内容限制在一个区域。

那么,假设我想遵循这些说明,我需要做什么才能将我的系统恢复为“库存”红宝石?我可以只卸载 Rails 和 Mongrel gems 吗?升级后的 RubyGems 会导致任何问题吗?

基本上,我担心的是与我的开发工作无关的其他一些软件将需要使用 OSX 的原生 Ruby,而我会以某种方式搞砸它。任何有关撤销我上面列出的 3 个步骤并尽可能接近库存的建议将不胜感激。

谢谢!

I just installed Rails on OSX. I used the stock version of Ruby and followed the following procedure:

  1. Installed newest version of RubyGems
  2. Ran sudo gem install rails --include-dependencies
  3. Installed Mongrel using sudo gem install mongrel --include-dependencies

Rails is working just fine, but more reading led me to this setup guide:

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.

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? Will the upgraded RubyGems cause any issues?

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. Any advice to undo the 3 steps I listed above and get as close to stock as possible would be appreciated.

Thanks!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

ˇ宁静的妩媚 2024-11-03 16:11:24

您引用的文章已有三年多了(在 Rails 社区中已经过时)。我的建议是:

  1. 安装XCode
  2. Install Homebrew
  3. 安装MySQL、Postgres、Image Magick等(brew install mysql等)
  4. 安装 RVM
  5. 安装 Ruby 1.9.2 (rvm install 1.9.2)
  6. 切换到默认值 (rvm 1.9.2 --default)
  7. 安装 Rails (gem install Rails)
  8. 安装 Passenger (gem install Passenger)

每个步骤都会有更多子步骤,但您应该能够查找它们或得到提示和他们在一起。

The article you are referring to is over three years old (which is outdated in the Rails community). My recommendation is:

  1. Install XCode
  2. Install Homebrew
  3. Install MySQL, Postgres, Image Magick, etc. (brew install mysql, etc.)
  4. Install RVM
  5. Install Ruby 1.9.2 (rvm install 1.9.2)
  6. Switch to default (rvm 1.9.2 --default)
  7. Install Rails (gem install rails)
  8. 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.

扛起拖把扫天下 2024-11-03 16:11:24

我不记得为什么这样做,但我确实知道它有效并且从那以后没有造成任何问题。我将 /Library/Ruby 移动到 /Library/Ruby.broken,然后将 Ruby 从源代码安装到 /usr/local 中。

OSX 中的原生 Ruby 从根本上缺失了一些东西。我希望我能记得那是什么。

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.

There's something fundamentally missing with the stock Ruby in OSX. I wish I could remember what that was.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文