如何从 GitHub 安装 Rails 3 master [英] How to install Rails 3 master from GitHub

查看:31
本文介绍了如何从 GitHub 安装 Rails 3 master的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用 rvm(Ruby 版本管理器)并运行 Rails 3 RC.我需要测试一个应用,看看最近在 GitHub 上向 Rails 3 master 提交的提交是否已经解决了一个错误.

如何从 GitHub 安装 Rails 3 master,然后生成新应用程序?

我不能用gem install rails --pre因为我想要边缘版本,而不是候选版本.

你能推荐一篇有用的要点或博文吗?

我只能找到这个:http://weblog.rubyonrails.org/2010/1/1/getting-a-new-app-running-on-edge而且已经过时了.

谢谢!

解决方案

您可以使用 Rails 3 应用 Gemfile 执行此操作.Bundler 可以直接从 github 安装,如果你不指定分支或标签,那么它将使用 master.生成 rails 3 应用程序后,将此添加到您的 Gemfile,然后运行 ​​bundle install 并启动您的应用程序.捆绑安装后,它会显示 Gemfile.lock 中的提交编号.它应该是来自主 rails 存储库的最新提交编号.这是我在 Gemfile 中所做的:

<前>gem 'rails', :git => 'git://github.com/rails/rails.git'#gem 'rails', '3.0.0.rc'

我只是取消注释并注释这两行来切换黑白 RC 和主...并捆绑安装.

或者,您可以克隆存储库,然后在 Gemfile 中使用您的本地源:

我认为它应该看起来像这样(未经测试):

<前>gem 'rails', :require => 'rails', :path => "/path_to/rails"

I'm using rvm (Ruby Version Manager) and running Rails 3 RC. I need to test an app to see if a bug has been resolved with a recent commit to Rails 3 master on GitHub.

How do I install Rails 3 master from GitHub and then generate a new app?

I can't use gem install rails --pre because I want the edge version, not the release candidate.

Can you suggest a helpful gist or blog post?

All I could find was this: http://weblog.rubyonrails.org/2010/1/1/getting-a-new-app-running-on-edge and it is out-of-date.

Thanks!

解决方案

You can do this with your rails 3 app Gemfile. Bundler is able to install directly from github and if you dont specify a branch or tag then it will use master. Add this to your Gemfile after you generate your rails 3 app, and then run bundle install and start up your app. After you bundle install it will show you the commit number in Gemfile.lock.. it should be the latest commit number from the master rails repo. Here is what I do in my Gemfile:

gem 'rails', :git => 'git://github.com/rails/rails.git' 
#gem 'rails', '3.0.0.rc'

I just uncomment and comment these 2 lines to switch b/w RC and master... and bundle install.

Alternately, you can clone the repo and then use your local source in the Gemfile:

I think it should look something like this (untested):

gem 'rails', :require => 'rails', :path => "/path_to/rails"

这篇关于如何从 GitHub 安装 Rails 3 master的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆