简体   繁体   English

在Mac OS X 10.6(SL)上安装Rails

[英]Installing Rails on Mac OS X 10.6 (SL)

I've just gone to installed RoR on my snow leopard mac.. and found the rails gem was already installed.. 我刚去雪豹Mac上安装了RoR,然后发现Rails gem已经安装好了。

is this normal? 这正常吗? Does it need updating? 需要更新吗?

Does this get installed along with textmate? 它会与textmate一起安装吗?

It is installed with the Snow Leopard developer tools. 它与Snow Leopard开发人员工具一起安装。 Version 1.8.7 of Ruby is installed. 已安装Ruby 1.8.7版。

You should be fine for most your development needs. 您应该可以满足大多数开发需求。 If you wish to upgrade just update the gems: 如果要升级,只需更新gem:

$ sudo gem install rubygems-update

$ sudo update_rubygems

$ sudo gem update

$ sudo gem update --system

$ sudo gem install rails

I found an incredibly well written install guide at The Pragmatic Studio called Installing Ruby 1.9 and Rails 3 on Mac OS X . 我在The Pragmatic Studio上找到了一个写得非常好的安装指南,名为Mac OS X上的安装Ruby 1.9和Rails 3 It took about an hour to follow, including installing several prerequisites. 大约花了一个小时,其中包括安装一些必备组件。

I'm hesitant to mess too much with OSX's native installation of ruby/rails, lest things get broken by an Apple system update, so I was very excited to learn about RVM (Ruby Version Manager) which is a cool tool for switching between different ruby/rails installations. 我不愿将OSX的本地安装的ruby / rails弄得一头雾水,以免被Apple系统更新弄坏了,所以我很高兴学习RVM(Ruby Version Manager) ,它是一个在不同版本之间切换的好工具。红宝石/导轨安装。 The Pragmatic Studio tutorial walks you through installing rvm. Pragmatic Studio教程将引导您完成安装rvm。

There are a few glitches with the guide, which I'll list here: 该指南有一些小故障,我将在这里列出:

  • Git: I just installed git itself. Git:我刚刚安装了git本身。 You do not need to set up a github account. 您无需设置github帐户。
  • Git: You may need to manually add /usr/local/git/bin to your PATH. Git:您可能需要手动将/ usr / local / git / bin添加到PATH。 (They don't explicitly tell you to) (他们没有明确告诉您)
  • RVM: The protocol for the rvm-install-head URL should be https, not http RVM:rvm-install-head URL的协议应该是https,而不是http
  • RVM: The installer complained a lot, but it worked anyway. RVM:安装程序抱怨很多,但是仍然可以运行。
  • RVM: The newly installed ruby 1.9.2 didn't activate until I ran 'rvm 1.9.2' in step 8 RVM:直到我在步骤8中运行“ rvm 1.9.2”后,新安装的ruby 1.9.2才激活

All told, this seems like a GREAT approach, and I'm really impressed with their install guide! 总而言之,这似乎是一种很棒的方法,他们的安装指南给我留下了深刻的印象!

很适合我,它的工作这个 ...我有美洲狮,但它的工作就好了... ...

Yes, the rails gem is already installed along with Snow Leopard, because you installed developer tools, it's very normal. 是的,rails gem已经与Snow Leopard一起安装了,因为您安装了开发人员工具,这非常正常。

But it's a little bit old, you need to update it. 但是它有点旧,您需要对其进行更新。

TextMate did not bundle any RoR stuff with this. TextMate对此没有捆绑任何RoR东西。 TextMate just included a lot of bundles which mainly consists of Python and Ruby scripts, if you do not have ruby, textmate will not work. TextMate仅包含了很多捆绑包,这些捆绑包主要由Python和Ruby脚本组成,如果您没有ruby,textmate将无法正常工作。

However, TextMate is originally made on Tiger 10.4, which bundled Ruby 1.8.2, and Snow Leopard bundled Ruby 1.8.7, so TextMate's bundles is not fully compatible with Snow Leopard Refer to this and get some fix for these issues: 但是,TextMate最初是在Tiger 10.4上制造的,该产品捆绑了Ruby 1.8.2,而Snow Leopard捆绑了Ruby 1.8.7,因此TextMate的捆绑软件与Snow Leopard并不完全兼容。请参考此文件并获得针对这些问题的一些修复:

http://wiki.macromates.com/Troubleshooting/SnowLeopard http://wiki.macromates.com/Troubleshooting/SnowLeopard

And also make sure you always keep your RoR bundle to the latest SVN is also a good habit 还要确保您始终将RoR捆绑包保持在最新的SVN上,这也是一个好习惯

TextMate is just a text editor. TextMate只是一个文本编辑器。 It only understands Rails syntax and file structure making it easy to write Rails apps. 它只了解Rails语法和文件结构,因此可以轻松编写Rails应用程序。 That said, you still need to install Rails separately to create Rails apps. 也就是说,您仍然需要单独安装Rails才能创建Rails应用。

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

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