开发者

How can I vendorize Rails 3?

I have a git submodule of git://github.com/rails/rails in vendor/rails of my Rails 3 app. This is where an unpacked/vendorized Rails would go prior to 3.0.

How do I instruct my Gemfile that vendor/rails is the correct location, and not my system-wide rails install?


So, some people have noted that you can do simply:

gem 'rails', :path => "vendor/rails"

You can also include a version number, e.g.,

gem 'rails', '3.0.3', :path => "vendor/rails"

Both of these depend on what you actually have in vendor/rails. For example, if I do git checkout v3.0.3 in vendor/rails, both of these will work fine on their own (3.0.3 is the current).

But if I use a beta instead, I seem to need to add some additional dependencies:

gem 'rails', :path => "vendor/rails"
gem 'arel',  :git => 'git://github.com/rails/arel.git'
gem 'rack',  :git => 'git://github.com/rack/rack.git'

I could also extract these into vendor as git submodules, I suppose, and again use :path.

Do be aware that rack comes from rack/rack on github, not rails/rack. The latter is a fork and hasn't been updated since 2009. I mad开发者_Python百科e this mistake and spent hours fixing it.

If you've got older versions of rails installed on your machine, you may also need to take care to use script/rails instead of the rails command.


Isn't it just gem 'rails', '3.0.3', :path => "vendor/rails" in your Gemfile?


Use this line in your Gemfile:

gem 'rails', :path => "vendor/rails"
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜