vertiginous / pik

Ruby version manager for Windows
830 stars 122 forks source link

C:\Documents: No such file or directory using git bash #125

Closed pke closed 12 years ago

pke commented 12 years ago

On Windows XP SP3 using git bash I get the following errors:

PhilK@DONNYMOB ~ $ pik use Select which Ruby you want:

  1. 187: ruby 1.8.7 (2010-01-10 patchlevel 249) [i386-mingw32]
  2. 192: ruby 1.9.2dev (2010-05-31) [i386-mingw32] ? 2 sh.exe": C:\Documents: No such file or directory

PhilK@DONNYMOB ~ $ pik use 192 sh.exe": C:\Documents: No such file or directory

My .bashrc looks like this:

[[ -s "$USERPROFILE/.pik/.pikrc" ]] && source "$USERPROFILE/.pik/.pikrc"

I found this solution: http://groups.google.com/group/discuss_pik/browse_thread/thread/f4f7c7b13b6ed000

The code should be updated to display ~ instead of $USERHOME

I am running 0.2.8 pik

luislavena commented 12 years ago

Hello,

Please install Pik in a directory without spaces (e.g. C:\Pik) and set PIK_HOME environment variable to it.

Then adjust .bashrc to use $PIK_HOME/.pik/.pikrc instead.

pke commented 12 years ago

I have installed it into "c:/dev/tools". That's not the problem. The problem is with the bash file as mentioned in the discussion linked above.

On Mon, Sep 12, 2011 at 12:04 PM, Luis Lavena reply@reply.github.com wrote:

Hello,

Please install Pik in a directory without spaces (e.g. C:\Pik) and set PIK_HOME environment variable to it.

Then adjust .bashrc to use $PIK_HOME/.pik/.pikrc instead.

Reply to this email directly or view it on GitHub: https://github.com/vertiginous/pik/issues/125#issuecomment-2069343

luislavena commented 12 years ago

I have installed it into "c:/dev/tools". That's not the problem. The problem is with the bash file as mentioned in the discussion linked above.

But the problem is where pik is looking for .pikrc and where is storing it. Setting (exporting) PIK_HOME and sourcing it from a directory without spaces will solve the issue.

Have you tried that?

pke commented 12 years ago

I got it working with the solution discussed in the link. However, I can not install rails using gem install rails

it installs, but the "rails" command is not available.

On Mon, Sep 12, 2011 at 12:09 PM, Luis Lavena reply@reply.github.com wrote:

I have installed it into "c:/dev/tools". That's not the problem. The problem is with the bash file as mentioned in the discussion linked above.

But the problem is where pik is looking for .pikrc and where is storing it. Setting (exporting) PIK_HOME and sourcing it from a directory without spaces will solve the issue.

Have you tried that?

Reply to this email directly or view it on GitHub: https://github.com/vertiginous/pik/issues/125#issuecomment-2069373

luislavena commented 12 years ago

Damn GitHub, I click the wrong button.

Depending on where you installed Ruby, it will install Rails over there.

Please do:

$ pik use <the version you want>
$ which ruby
$ gem env
$ gem list rails -d

And provide the output for us.

pke commented 12 years ago
PhilK@DONNYMOB /c/dev/projects/winshell/trunk/server
$ pik use 192

PhilK@DONNYMOB /c/dev/projects/winshell/trunk/server
$ which ruby
/c/Documents and Settings/PhilK/.pik/rubies/Ruby-192dev-preview3-1/bin/ruby

PhilK@DONNYMOB /c/dev/projects/winshell/trunk/server
$ gem env
RubyGems Environment:
  - RUBYGEMS VERSION: 1.3.7
  - RUBY VERSION: 1.9.2 (2010-05-31 patchlevel -1) [i386-mingw32]
  - INSTALLATION DIRECTORY:
  - RUBY EXECUTABLE: "c:/Documents and
Settings/PhilK/.pik/rubies/Ruby-192dev-preview3-1/bin/ruby.exe"
  - EXECUTABLE DIRECTORY: /bin
  - RUBYGEMS PLATFORMS:
    - ruby
    - x86-mingw32
  - GEM PATHS:
     -
  - GEM CONFIGURATION:
     - :update_sources => true
     - :verbose => true
     - :benchmark => false
     - :backtrace => false
     - :bulk_threshold => 1000
  - REMOTE SOURCES:
     - http://rubygems.org/

PhilK@DONNYMOB /c/dev/projects/winshell/trunk/server
$ gem list rails -d

*** LOCAL GEMS ***
luislavena commented 12 years ago

So:

$ which ruby /c/Documents and Settings/PhilK/.pik/rubies/Ruby-192dev-preview3-1/bin/ruby

Your ruby seems to be installed in a directory with spaces (something to avoid, you should move and set PIK_HOME)

  • GEM PATHS:

It doesn't list the place gems will be installed

  • INSTALLATION DIRECTORY:

It cannot determine the installation directory (which is used by gem install)

So, my recommendation is:

I recommend you join the list and ask there, issues with path with spaces will not be considered bugs. Is a known and hated limitation. Sorry.