Skip to content

Commit 551b421

Browse files
committed
Docs for configurable versions
See tjschuck#12
1 parent a127edf commit 551b421

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

‎README.md‎

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,30 @@ All of your gem binaries will be put into `pkg`:
6464

6565
Happy compiling!
6666

67+
### Limiting Target Rubies
68+
69+
Some gems might choose to not support older versions of Ruby (like [Nokogiri](http://nokogiri.org), which no longer supports 1.8).
70+
71+
If you wish to limit the versions of Ruby that your cross-compiled Windows binaries supports, you can use the environment variables `BASE_VERSION` and `RUBY_CC_VERSION`:
72+
73+
*`BASE_VERSION`: the native version of Ruby that will be used as a base for cross-compilation
74+
75+
*`RUBY_CC_VERSION`: a colon-separated list of target versions for cross-compilation
76+
77+
_Note: If you wish to target 1.8.x, your base version must be 1.8.x -- versions 1.9+ cannot cross-build 1.8._
78+
79+
#### Examples:
80+
81+
Use Ruby 1.9.3 to cross-compile a fat binary that includes 1.9 and 2.0 binaries:
82+
83+
vagrant@precise64:/vagrant$ BASE_VERSION=1.9.3 RUBY_CC_VERSION=1.9.3:2.0.0 package_all nokogiri
84+
85+
Use Ruby 2.0.0 to cross-compile a fat binary that includes 2.0 and 2.1 binaries:
86+
87+
vagrant@precise64:/vagrant$ BASE_VERSION=2.0.0 RUBY_CC_VERSION=2.0.0:2.1.3 package_all nokogiri
88+
89+
By default, with no environment variables, rake-compiler-dev-box will try to cross-compile for all available versions, using 1.8 as a base.
90+
6791
## VM Management
6892

6993
Log out of the virtual machine (`exit` or `^D`).

0 commit comments

Comments
(0)