简体   繁体   English

如何使用 rvm 在 rails 上安装 ruby?

[英]How can I install ruby on rails with rvm?

I've been searching around on how to install it through the terminal on my mac.我一直在寻找如何通过我的 mac 上的终端安装它。 I'm using snow leopard.我正在使用雪豹。 When I use the command: rvm install 1.9.3 I've also followed the other procedures that led me up to this to install, right now the current version is 1.8.3当我使用命令时: rvm install 1.9.3 我还按照导致我安装这个的其他程序进行了安装,现在当前版本是 1.8.3

Error running './configure --prefix="/Users/jose/.rvm/usr" ', please read /Users/jose/.rvm/log/ruby-1.9.3-p125/yaml/configure.log运行 './configure --prefix="/Users/jose/.rvm/usr" ' 时出错,请阅读 /Users/jose/.rvm/log/ruby-1.9.3-p125/yaml/configure.log

Then it mentions something about xcode and autoreconf was not found in the PATH.然后它提到有关 xcode 的内容,并且在 PATH 中找不到 autoreconf。

Error running 'patch -F 25 -p1 -N -f <"/Users/jose/.rvm/patches/ruby/1.9.3/p125/xcode-debugopt-fix-e34840.diff"',please read /Users/jose/.rvm/log/ruby-1.9.3-p125/patch.apply.xcode-debugopt-fix-r34840.log rvm requires autoreconf to install the selected ruby interpreter however autoreconf was not found in the PATH运行'patch -F 25 -p1 -N -f <"/Users/jose/.rvm/patches/ruby/1.9.3/p125/xcode-debugopt-fix-e34840.diff"'时出错,请阅读/Users/ jose/.rvm/log/ruby-1.9.3-p125/patch.apply.xcode-debugopt-fix-r34840.log rvm 需要 autoreconf 来安装选定的 ruby 解释器,但是在 PATH 中找不到 autoreconf

I been trying for awhile now, and found out i need to have Xcode for snow leopard which I cannot find.我已经尝试了一段时间,发现我需要 Xcode 才能找到我找不到的雪豹。 So my last option will be to upgrade to lion but I don't know about upgrading.所以我最后的选择是升级到狮子,但我不知道升级。 Kind of scared to upgrade and everything becomes buggy.有点害怕升级,一切都变得有问题。

Rails 2.3.5轨道 2.3.5
Jose-Gomezs-MacBook-Pro:~ josegomez$ ruby -v Jose-Gomezs-MacBook-Pro:~ josegomez$ ruby -v
ruby 1.8.7 (2009-06-12 patchlevel 174) [universal-darwin10.0] ruby 1.8.7 (2009-06-12 补丁级别 174) [universal-darwin10.0]
Jose-Gomezs-MacBook-Pro:~ josegomez$ gem -v何塞-戈麦斯-MacBook-Pro:~ josegomez$ gem -v
1.8.15 1.8.15
Jose-Gomezs-MacBook-Pro:~ josegomez$ rvm -v何塞-戈麦斯-MacBook-Pro:~ josegomez$ rvm -v

rvm 1.11.6 (stable) by Wayne E. Seguin, Michal Papis > [https://rvm.beginrescueend.com/] rvm 1.11.6(稳定版),作者:Wayne E. Seguin,Michal Papis > [https://rvm.beginrescueend.com/]

Install brew, then:安装 brew,然后:

brew install automake

Will add autoreconf to your path.将 autoreconf 添加到您的路径。

1.9.3 now works with the LLVM compiler in XCode 4.3 so you shouldn't have any issues installing the latest version from the App Store. 1.9.3 现在可以与 XCode 4.3 中的 LLVM 编译器一起使用,因此从 App Store 安装最新版本应该不会有任何问题。

I rebuilt my mac last night and everything was pretty stock standard.我昨晚重建了我的 mac,一切都非常标准。 RVM, Brew, XCode from the App Store, Command Line Tools from XCode, autoreconf from brew, 1.9.3-p125 from rvm. RVM,Brew,来自 App Store 的 XCode,来自 XCode 的命令行工具,来自 brew 的 autoreconf,来自 rvm 的 1.9.3-p125。

For getting patch application problems - use rvm reinstall 1.9.3 .要获取补丁应用程序问题 - 使用rvm reinstall 1.9.3

For installing ruby 1.8.7 you need GCC 4.2 like (gcc-4.2 program) not an LLVM based compiler (like clang), the easiest way to get it is osx-gcc-installer, you could also install Xcode 4.1 - but this is harder.要安装 ruby 1.8.7,您需要 GCC 4.2(gcc-4.2 程序),而不是基于 LLVM 的编译器(如 clang),获取它的最简单方法是 osx-gcc-installer,您也可以安装 Xcode 4.1 - 但这是更难。

Please take a note that 1.9.3-p125 is not fully ready for clang, you still are better with gcc-4.2 form osx-gcc-installer / Xcode 4.1请注意1.9.3-p125还没有为 clang 完全准备好,你仍然可以使用gcc-4.2形式osx-gcc-installer / Xcode 4.1

I did it on my Mac and I remember changing some settings in my.bash_profile.我是在我的 Mac 上做的,我记得在 my.bash_profile 中更改了一些设置。 Here is a link I followed to do it.这是我遵循的链接。 Hope it works for you as well.希望它也对你有用。

http:/.net.tutsplus.com/tutorials/ruby/how-to-install-ruby-on-a-mac/ http:/.net.tutsplus.com/tutorials/ruby/how-to-install-ruby-on-a-mac/

Signing up for a free developer account with Apple will give you access to Xcode for Snow Leopard.在 Apple 注册一个免费的开发者帐户,您就可以访问 Snow Leopard 的 Xcode。 Once you install Xcode and the included Developer Tools, you'll be all set to install Ruby on Rails with RVM.安装 Xcode 和随附的开发人员工具后,您就可以使用 RVM 在 Rails 上安装 Ruby 了。

only tittle related:仅标题相关:

bash -s stable --rails < <(curl -s https://raw.github.com/wayneeseguin/rvm/master/binscripts/rvm-installer)

you can get more details here: https://gist.github.com/2246595 - this will enter guide mode that helps to get it app and running您可以在此处获得更多详细信息: https://gist.github.com/2246595 - 这将进入有助于获取应用程序并运行的引导模式

Try this script by ThoughtBot to automatically configure your system: https://github.com/thoughtbot/laptop试试 ThoughtBot 的这个脚本来自动配置你的系统: https://github.com/thoughtbot/laptop

It does a.lot and generally will take a Lion system, get gcc installed, and get rvm and finally rails.它做了很多,通常会采用 Lion 系统,安装 gcc,然后安装 rvm,最后安装 rails。 highly recommend.极力推荐。

Just to close it off, I found out I had to push back my date on my mac to sometime before January 2012 and install xcode. After installation you can set the time back to normal and you should be good to go. But I got a copy of xcode from my instructor which is pretty cool.只是为了关闭它,我发现我必须将我在 Mac 上的日期推迟到 2012 年 1 月之前的某个时间并安装 xcode。安装后你可以将时间设置回正常,你应该对 go 很好。但我有一个从我的导师那里得到的 xcode 的副本非常酷。

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

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