[英]How do I setup a rails project to use an edge source tree (not an installed gem) version of rails
I would like the rails 3.0 source tree in my project so I can use patches, etc. I don' want to freeze rails. 我想在项目中使用Rails 3.0源代码树,以便可以使用补丁程序等。我不想冻结Rails。 I would like to be able to pull updates from the main repo too. 我也希望能够从主仓库中提取更新。 How do I accomplish this? 我该如何完成?
In particular the getting started guide , has me confused with 特别是入门指南 ,让我感到困惑
As the root user:
# gem install bundler
# bundle install
If I install the bundled gems to my system then I'm not really running with the vendor/rails source tree. 如果我将捆绑的gem安装到我的系统上,那么我不是真的在使用vendor / rails源代码树。 Do rails developers really edit-test-edit-test and then install gems to their system before trying out patches on an actual app? Rails开发人员在尝试在实际应用程序上打补丁之前,是否真的进行了编辑-测试-编辑-测试,然后将gems安装到其系统中?
--- Update --- -更新-
$ cd ~myapp/vendor/rails
$ bundler install
There are a bunch of gems in vendor/rails/vendor/cache. 供应商/铁路/供应商/缓存中有很多宝石。 When I 当我
$ cd ~/myapp
$ bundler install
... Could not find gem 'rails (= 3.0.0.beta1, runtime)' in any of the sources. (Bundler::GemNotFound)
How do I tell my app to get its gems with the bundled rails gems in vendor/rails/vendor/cache? 如何告诉我的应用通过供应商/导轨/供应商/缓存中捆绑的导轨宝石来获取其宝石?
gem "rails", :git => "git://github.com/rails/rails.git"
根据ASCIIcasts第201集 。
After much screwing around, this is how to setup edge rails 3.0 beta. 经过大量的拧紧之后,这就是设置边缘导轨3.0 beta的方法。
mkdir -p myapp/vendor
cd myapp
git init
git submodule add git://github.com/rails/rails.git vendor/rails
git commit -m "Frozen Rails Edge as submodule"
ruby -r'rubygems' vendor/rails/railties/bin/rails .
Then edit myapp/Gemfile and change 然后编辑myapp / Gemfile并进行更改
gem 'rails', '3.0.0.beta1'
to this 对此
gem 'rails', '3.0.0.beta1', :path => 'vendor/rails'
Finally, in myapp/ 最后,在myapp /
bundle check
bundle install
I found that any changes made to the rails source in vendor/rails will appear next time they load. 我发现对供应商/ rails中的rails源所做的任何更改都将在下次加载时显示。 There is no need to 'bundle install' after applying a patch. 应用补丁程序后无需“捆绑安装”。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.