ruby-core@ruby-lang.org archive (unofficial mirror)
 help / color / mirror / Atom feed
From: jekader@gmail.com
To: ruby-core@ruby-lang.org
Subject: [ruby-core:69770] [Ruby trunk - Bug #11316] ruby 2.2 on Windows generates incorrect BAT files for gems
Date: Mon, 29 Jun 2015 09:05:53 +0000	[thread overview]
Message-ID: <redmine.journal-53147.20150629090553.029361e190f4640a@ruby-lang.org> (raw)
In-Reply-To: redmine.issue-11316.20150629090105@ruby-lang.org

Issue #11316 has been updated by Jeka Der.


I forgot to mention that this works fine with ruby 2.1. The bat file there looks like this:

@ECHO OFF
IF NOT "%~f0" == "~f0" GOTO :WinNT
@"ruby.exe" "C:/Program Files/ruby21/bin/rhc" %1 %2 %3 %4 %5 %6 %7 %8 %9
GOTO :EOF
:WinNT
@"ruby.exe" "%~dpn0" %*


----------------------------------------
Bug #11316: ruby 2.2 on Windows generates incorrect BAT files for gems
https://bugs.ruby-lang.org/issues/11316#change-53147

* Author: Jeka Der
* Status: Open
* Priority: Normal
* Assignee: 
* ruby -v: ruby 2.2.2p95 (2015-04-13 revision 50295) [i386-mingw32]
* Backport: 2.0.0: UNKNOWN, 2.1: UNKNOWN, 2.2: UNKNOWN
----------------------------------------
In Ruby 2.2 on Windows it's impossible to install the "rhc" gem since the BAT wrapper has a typo.

steps to reproduce:
1) install ruby 2.2.2 into a directory with spacer (C:\Program Files\ruby22)
2) install git
3) open console and install "rhc" gem:

Microsoft Windows [Version 6.1.7601]
Copyright (c) 2009 Microsoft Corporation.  All rights reserved.

C:\Windows\system32>ruby -v
ruby 2.2.2p95 (2015-04-13 revision 50295) [i386-mingw32]

C:\Windows\system32>gem install rhc
Fetching: open4-1.3.4.gem (100%)
Successfully installed open4-1.3.4
Fetching: httpclient-2.6.0.1.gem (100%)
Successfully installed httpclient-2.6.0.1
Fetching: highline-1.6.21.gem (100%)
Successfully installed highline-1.6.21
Fetching: commander-4.2.1.gem (100%)
Successfully installed commander-4.2.1
Fetching: archive-tar-minitar-0.5.2.gem (100%)
Successfully installed archive-tar-minitar-0.5.2
Fetching: net-ssh-2.9.2.gem (100%)
Successfully installed net-ssh-2.9.2
Fetching: net-ssh-gateway-1.2.0.gem (100%)
Successfully installed net-ssh-gateway-1.2.0
Fetching: net-ssh-multi-1.2.1.gem (100%)
Successfully installed net-ssh-multi-1.2.1
Fetching: net-scp-1.2.1.gem (100%)
Successfully installed net-scp-1.2.1
Fetching: rhc-1.35.4.gem (100%)
===========================================================================

If this is your first time installing the RHC tools, please run 'rhc setup'

===========================================================================
Successfully installed rhc-1.35.4
Parsing documentation for open4-1.3.4
Installing ri documentation for open4-1.3.4
Parsing documentation for httpclient-2.6.0.1
Installing ri documentation for httpclient-2.6.0.1
Parsing documentation for highline-1.6.21
Installing ri documentation for highline-1.6.21
Parsing documentation for commander-4.2.1
Installing ri documentation for commander-4.2.1
Parsing documentation for archive-tar-minitar-0.5.2
Installing ri documentation for archive-tar-minitar-0.5.2
Parsing documentation for net-ssh-2.9.2
Installing ri documentation for net-ssh-2.9.2
Parsing documentation for net-ssh-gateway-1.2.0
Installing ri documentation for net-ssh-gateway-1.2.0
Parsing documentation for net-ssh-multi-1.2.1
Installing ri documentation for net-ssh-multi-1.2.1
Parsing documentation for net-scp-1.2.1
Installing ri documentation for net-scp-1.2.1
Parsing documentation for rhc-1.35.4
Installing ri documentation for rhc-1.35.4
Done installing documentation for open4, httpclient, highline, commander, archiv
e-tar-minitar, net-ssh, net-ssh-gateway, net-ssh-multi, net-scp, rhc after 17 se
conds
10 gems installed


4) try to run it:

C:\Windows\system32>rhc --help
'""C:\My' is not recognized as an internal or external command,
operable program or batch file.



here's rhc.bat:


@ECHO OFF
IF NOT "%~f0" == "~f0" GOTO :WinNT
@""C:\Program Files\ruby22\bin\ruby.exe" "C:/Program Files/ruby22/bin/rhc" %1 %2 %3 %4 %5 %6 %7 %8 %9
GOTO :EOF
:WinNT
@""C:\Program Files\ruby22\bin\ruby.exe" "%~dpn0" %*


To make this work I had to remove the extra double quote in the last line:
@"C:\Program Files\ruby22\bin\ruby.exe" "%~dpn0" %*




-- 
https://bugs.ruby-lang.org/

  parent reply	other threads:[~2015-06-29  8:41 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <redmine.issue-11316.20150629090105@ruby-lang.org>
2015-06-29  9:01 ` [ruby-core:69769] [Ruby trunk - Bug #11316] [Open] ruby 2.2 on Windows generates incorrect BAT files for gems jekader
2015-06-29  9:05 ` jekader [this message]
2015-07-05  2:20 ` [ruby-core:69874] [Ruby trunk - Bug #11316] " leif.eriksen.au
2015-07-05  3:42 ` [ruby-core:69875] [Ruby trunk - Bug #11316] [Third Party's Issue] " nobu
2015-07-05  8:05 ` [ruby-core:69877] [Ruby trunk - Bug #11316] " leif.eriksen.au
2015-07-06  4:48 ` [ruby-core:69879] [Ruby trunk - Bug #11316] [Rejected] " nobu
2015-07-06  4:55 ` [ruby-core:69880] [Ruby trunk - Bug #11316] [Closed] " usa
2015-07-08 10:08 ` [ruby-core:69898] [Ruby trunk - Bug #11316] " jekader
2015-07-08 11:21 ` [ruby-core:69900] " jekader

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.ruby-lang.org/en/community/mailing-lists/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=redmine.journal-53147.20150629090553.029361e190f4640a@ruby-lang.org \
    --to=ruby-core@ruby-lang.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).