-
-
Save luislavena/1335240 to your computer and use it in GitHub Desktop.
| ruby 1.8.7 (2011-06-30 patchlevel 352) [i386-mingw32] | |
| rails 3.1.1 | |
| C:\>rails new empty-187 -d sqlite3 | |
| C:\empty-187>timer ruby script\rails runner "puts $LOADED_FEATURES.size" | |
| 705 | |
| real 4.538 | |
| system 2.667 | |
| user 1.794 |
| ruby 1.9.2p290 (2011-07-09) [i386-mingw32] | |
| rails 3.1.1 | |
| C:\>rails new empty-192 -d sqlite3 | |
| C:\empty-192>timer ruby script\rails runner "puts $LOADED_FEATURES.size" | |
| 719 | |
| real 9.083 | |
| system 5.272 | |
| user 3.775 |
| ruby 1.9.3p0 (2011-10-30) [i386-mingw32] | |
| rails 3.1.1 | |
| C:\>rails new empty-193 -d sqlite3 | |
| C:\empty-193>timer ruby script\rails runner "puts $LOADED_FEATURES.size" | |
| 724 | |
| real 4.786 | |
| system 2.808 | |
| user 1.856 |
| tcs-ruby 1.9.3p0 (2011-10-30 revision 33569) [i386-mingw32] | |
| rails 3.1.1 | |
| C:\>rails new empty-tcs -d sqlite3 | |
| C:\empty-tcs>timer ruby script\rails runner "puts $LOADED_FEATURES.size" | |
| 724 | |
| real 3.349 | |
| system 1.918 | |
| user 1.341 |
| ruby 1.9.3p0 (2011-10-30 revision 33569) [i386-mingw32] | |
| rails 3.1.1 | |
| C:\>rails new empty-[redacted] -d sqlite3 | |
| C:\>SET RUBYOPT=[redacted] | |
| C:\empty-[redacted]>timer ruby script\rails runner "puts $LOADED_FEATURES.size" | |
| 726 | |
| real 2.658 | |
| system 0.686 | |
| user 1.903 |
On my small non-rails project this didn't seem to have any effect. Although i have 116 lines in my Gemfile.lock there.
It will not have any effect because Ruby require is using the internal file_expand_path internally and not File.expand_path
You need to patch Ruby:
https://gist.github.com/1258289
You will need to apply that patch to the source code and perhaps compile using RubyInstaller repository, like I do:
rake ruby19 NOGEMS=1 NOTK=1 LOCAL=C:\Path\To\ruby
Where ruby is your clone of ruby/ruby repository and the patch shown in the previous gist.
Again, be careful, the code is just a proof of concept, it might not work for your environment, in which case feedback will be appreciated at the project repository.
Can't add the patch for some reason:
C:\rubyinstaller\ruby>git apply -v 0001-make-load-and-require-use-file-expand_path-and-file-realpath.diff
Checking patch file.c...
error: while searching for:
if (!ext[0]) return 0;
if (f[0] == '~') {
fname = file_expand_path_1(fname);
if (safe_level >= 1 && OBJ_TAINTED(fname)) {
rb_raise(rb_eSecurityError, "loading from unsafe file %s", f);
}
error: patch failed: file.c:5117
error: file.c: patch does not apply
Checking patch load.c...
error: while searching for:
ary = rb_ary_new2(RARRAY_LEN(load_path));
for (i = 0; i < RARRAY_LEN(load_path); ++i) {
VALUE path = rb_file_expand_path(RARRAY_PTR(load_path)[i], Qnil);
rb_str_freeze(path);
rb_ary_push(ary, path);
}
error: patch failed: load.c:43
error: load.c: patch does not apply
Can't add the patch for some reason:
Did you setup your close of ruby as core.autocrlf=false ? if not, patch will fail.
Also, you need to apply against ruby_1_9_3 branch.
C:\Users\Luis\Projects\oss\ruby>git branch
ruby_1_8_6
ruby_1_8_7
ruby_1_9_2
* ruby_1_9_3
trunk
C:\Users\Luis\Projects\oss\ruby>git apply ..\0001-make-load-and-require-use-file-expand_path-and-file-realpath.diff
C:\Users\Luis\Projects\oss\ruby>git status
# On branch ruby_1_9_3
# Changes not staged for commit:
# (use "git add <file>..." to update what will be committed)
# (use "git checkout -- <file>..." to discard changes in working directory)
#
# modified: file.c
# modified: load.c
#
Yup, i was on trunk :/
Trying to build now...
Not much luck:
C:\rubyinstaller>rake ruby19 NOGEMS=1 NOTK=1 LOCAL=ruby --trace
Loading 001_dkcompiler_init.rb
Initializing DevKit compilers
...
** Extracting C:/rubyinstaller/downloads/coreutils-5.97-3-msys-1.0.13-ext.tar.lzma into sandbox/devkit
"C:/rubyinstaller/sandbox/extract_utils/basic-bsdtar.exe" -xf "C:/rubyinstaller/downloads/coreutils-5.97-3-msys-1.0.13-ext.tar.lzma" > NUL 2>&1
rake aborted!
Command failed with status (1): ["C:/rubyinstaller...]
C:/Ruby193/lib/ruby/1.9.1/rake/file_utils.rb:53:in `block in create_shell_runner'
C:/Ruby193/lib/ruby/1.9.1/rake/file_utils.rb:45:in `call'
C:/Ruby193/lib/ruby/1.9.1/rake/file_utils.rb:45:in `sh'
C:/Ruby193/lib/ruby/1.9.1/rake/file_utils_ext.rb:39:in `sh'
C:/rubyinstaller/rake/extracttask.rb:93:in `block in bsd_tar_extract'
C:/rubyinstaller/rake/extracttask.rb:92:in `chdir'
C:/rubyinstaller/rake/extracttask.rb:92:in `bsd_tar_extract'
C:/rubyinstaller/rake/extracttask.rb:27:in `extract'
C:/rubyinstaller/recipes/devkit/msys.rake:32:in `block (4 levels) in <top (required)>'
C:/rubyinstaller/recipes/devkit/msys.rake:30:in `each'
C:/rubyinstaller/recipes/devkit/msys.rake:30:in `block (3 levels) in <top (required)>'
C:/rubyinstaller/rake/checkpoint.rb:6:in `block in checkpoint'
C:/Ruby193/lib/ruby/1.9.1/rake/task.rb:203:in `call'
C:/Ruby193/lib/ruby/1.9.1/rake/task.rb:203:in `block in execute'
C:/Ruby193/lib/ruby/1.9.1/rake/task.rb:200:in `each'
C:/Ruby193/lib/ruby/1.9.1/rake/task.rb:200:in `execute'
C:/Ruby193/lib/ruby/1.9.1/rake/task.rb:158:in `block in invoke_with_call_chain'
C:/Ruby193/lib/ruby/1.9.1/monitor.rb:211:in `mon_synchronize'
C:/Ruby193/lib/ruby/1.9.1/rake/task.rb:151:in `invoke_with_call_chain'
C:/Ruby193/lib/ruby/1.9.1/rake/task.rb:176:in `block in invoke_prerequisites'
C:/Ruby193/lib/ruby/1.9.1/rake/task.rb:174:in `each'
C:/Ruby193/lib/ruby/1.9.1/rake/task.rb:174:in `invoke_prerequisites'
C:/Ruby193/lib/ruby/1.9.1/rake/task.rb:157:in `block in invoke_with_call_chain'
C:/Ruby193/lib/ruby/1.9.1/monitor.rb:211:in `mon_synchronize'
C:/Ruby193/lib/ruby/1.9.1/rake/task.rb:151:in `invoke_with_call_chain'
C:/Ruby193/lib/ruby/1.9.1/rake/task.rb:176:in `block in invoke_prerequisites'
C:/Ruby193/lib/ruby/1.9.1/rake/task.rb:174:in `each'
C:/Ruby193/lib/ruby/1.9.1/rake/task.rb:174:in `invoke_prerequisites'
C:/Ruby193/lib/ruby/1.9.1/rake/task.rb:157:in `block in invoke_with_call_chain'
C:/Ruby193/lib/ruby/1.9.1/monitor.rb:211:in `mon_synchronize'
C:/Ruby193/lib/ruby/1.9.1/rake/task.rb:151:in `invoke_with_call_chain'
C:/Ruby193/lib/ruby/1.9.1/rake/task.rb:176:in `block in invoke_prerequisites'
C:/Ruby193/lib/ruby/1.9.1/rake/task.rb:174:in `each'
C:/Ruby193/lib/ruby/1.9.1/rake/task.rb:174:in `invoke_prerequisites'
C:/Ruby193/lib/ruby/1.9.1/rake/task.rb:157:in `block in invoke_with_call_chain'
C:/Ruby193/lib/ruby/1.9.1/monitor.rb:211:in `mon_synchronize'
C:/Ruby193/lib/ruby/1.9.1/rake/task.rb:151:in `invoke_with_call_chain'
C:/Ruby193/lib/ruby/1.9.1/rake/task.rb:176:in `block in invoke_prerequisites'
C:/Ruby193/lib/ruby/1.9.1/rake/task.rb:174:in `each'
C:/Ruby193/lib/ruby/1.9.1/rake/task.rb:174:in `invoke_prerequisites'
C:/Ruby193/lib/ruby/1.9.1/rake/task.rb:157:in `block in invoke_with_call_chain'
C:/Ruby193/lib/ruby/1.9.1/monitor.rb:211:in `mon_synchronize'
C:/Ruby193/lib/ruby/1.9.1/rake/task.rb:151:in `invoke_with_call_chain'
C:/Ruby193/lib/ruby/1.9.1/rake/task.rb:176:in `block in invoke_prerequisites'
C:/Ruby193/lib/ruby/1.9.1/rake/task.rb:174:in `each'
C:/Ruby193/lib/ruby/1.9.1/rake/task.rb:174:in `invoke_prerequisites'
C:/Ruby193/lib/ruby/1.9.1/rake/task.rb:157:in `block in invoke_with_call_chain'
C:/Ruby193/lib/ruby/1.9.1/monitor.rb:211:in `mon_synchronize'
C:/Ruby193/lib/ruby/1.9.1/rake/task.rb:151:in `invoke_with_call_chain'
C:/Ruby193/lib/ruby/1.9.1/rake/task.rb:176:in `block in invoke_prerequisites'
C:/Ruby193/lib/ruby/1.9.1/rake/task.rb:174:in `each'
C:/Ruby193/lib/ruby/1.9.1/rake/task.rb:174:in `invoke_prerequisites'
C:/Ruby193/lib/ruby/1.9.1/rake/task.rb:157:in `block in invoke_with_call_chain'
C:/Ruby193/lib/ruby/1.9.1/monitor.rb:211:in `mon_synchronize'
C:/Ruby193/lib/ruby/1.9.1/rake/task.rb:151:in `invoke_with_call_chain'
C:/Ruby193/lib/ruby/1.9.1/rake/task.rb:144:in `invoke'
C:/Ruby193/lib/ruby/1.9.1/rake/application.rb:116:in `invoke_task'
C:/Ruby193/lib/ruby/1.9.1/rake/application.rb:94:in `block (2 levels) in top_level'
C:/Ruby193/lib/ruby/1.9.1/rake/application.rb:94:in `each'
C:/Ruby193/lib/ruby/1.9.1/rake/application.rb:94:in `block in top_level'
C:/Ruby193/lib/ruby/1.9.1/rake/application.rb:133:in `standard_exception_handling'
C:/Ruby193/lib/ruby/1.9.1/rake/application.rb:88:in `top_level'
C:/Ruby193/lib/ruby/1.9.1/rake/application.rb:66:in `block in run'
C:/Ruby193/lib/ruby/1.9.1/rake/application.rb:133:in `standard_exception_handling'
C:/Ruby193/lib/ruby/1.9.1/rake/application.rb:63:in `run'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/bin/rake:32:in `<top (required)>'
C:/Ruby193/bin/rake:19:in `load'
C:/Ruby193/bin/rake:19:in `<main>'
Tasks: TOP => ruby19 => interpreter:ruby19:configure => compiler => devkit:activate => devkit:msys => devkit:msys:extract => C:/rubyinstaller/sandbox/.checkpoints/.msys-extract
Can't see any error reasons here either...
If this is the first time you've built with the recipes, go to the RubyInstaller's downloads directory and make sure there are no 0-byte downloads. If there are, delete them and try again.
It's first time and there isn't any 0-byte files in downloads...
is the C:/rubyinstaller/downloads/coreutils-5.97-3-msys-1.0.13-ext.tar.lzma file 270,336 bytes for Size on disk: when you right-click and show properties?
Yes, i have same size. Moving conversation to http://groups.google.com/group/rubyinstaller/browse_thread/thread/d615a6c63f65194c as suggested by Luis.
On my small non-rails project this didn't seem to have any effect. Although i have 116 lines in my Gemfile.lock there.
I also tried it out with Rails without seeing any effect either (since i don't have any timer, i did it differently - maybe that has something to do with the fact also):