Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Re-launch assets:precompile task using original $0 if $0 is batch file so it works on Windows #4735

Merged
merged 1 commit into from Jan 31, 2012

Conversation

arton
Copy link

@arton arton commented Jan 28, 2012

MSWin32 version of ruby provides Windows batch file that converted from original script files.
The batch file is not plain ruby script, so the patch provided by #3121 (comment) causes error on Windows.

ex)
C:\tmp\webtest>rake assets:precompile
c:/Users/arton/bin/ruby.exe c:/Users/arton/rake.bat assets:precompile:all RAILS_ENV=production RAILS_GROUPS=assets
c:/Users/arton/bin/rake.bat:1: syntax error, unexpected tIDENTIFIER, expecting $end
rake aborted!
Command failed with status (1): [c:/Users/arton/bin/ruby.exe c:/U... (omitted by the poster)

Tasks: TOP => assets:precompile
(See full trace by running task with --trace)

So, this patch checks $0 is batch file or not. And if $0 is batch file, then run it with Kernel.exec (means Win32 API) instead of ruby.

Thanks.

tenderlove added a commit that referenced this pull request Jan 31, 2012
Re-launch assets:precompile task using original $0 if $0 is batch file so it works on Windows
@tenderlove tenderlove merged commit 77c6706 into rails:master Jan 31, 2012
tenderlove added a commit that referenced this pull request Jan 31, 2012
Re-launch assets:precompile task using original $0 if $0 is batch file so it works on Windows
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants