Closed molipha closed 9 years ago
pik 0.3.0.pre is not very tolerant on names. The following should work pik use ruby-1.8.7-p334
Hello,
Pik 0.3.0 no longer supports regexp for the names, that is to match RVM.
You can:
C:\Users\Luis>pik ls
ruby-1.8.6-p398
ruby-1.8.7-p352
ruby-1.9.2-p290
ruby-1.9.3-dev
ruby-1.9.4-dev
jruby-1.6.3
C:\Users\Luis>pik use 1.8.7-p352
C:\Users\Luis>ruby -v
ruby 1.8.7 (2011-06-30 patchlevel 352) [i386-mingw32]
Hello,
I'm still having trouble after following your example:
D:\workspace\foo>pik ls => ruby-1.8.7-p352 ruby-1.9.2-p136
D:\workspace\foo>pik use 1.9.2-p136
D:\workspace\foo>ruby -v ruby 1.8.7 (2011-06-30 patchlevel 352) [i386-mingw32]
EDIT: I also tried pik refresh, and using the full name ("ruby-1.9.2-p136")... still not working
There is one other big gotcha with Pik 0.3.0.
(With the default install) C:\pik\pik.bat is what (I think) gets called by "pik use". That batch file requires either %HOME or %PIK_HOME environment variables to be set, on my systems neither variable is by default so "pik use" causes absolutely nothing to happen.
Try echo %PIK_HOME and echo %HOME from the command line. One should report C:\Users\Sam.pik or whatever the directory of your pik installation that contains the rubies is.
I set the %PIK_HOME environment variable and then all was golden...
@s01ipsist, thanks but still not working :(
I'm not much of a programmer, I'm actually a front-end guy so I'll just spell out what I tried, maybe there's something I'm doing wrong or skipped:
...after all this, still nothing :(
EDIT: oh, and "echo %PIK_HOME" returns "%PIK_HOME" in all cases?
OK, output is a little different in the standard dos console from the TCC console I was using above. This is what mine reports now (notice that % marks are required on both sides of the environment variable)
Microsoft Windows [Version 6.0.6002]
C:\Users\Sam>echo %PIK_HOME %PIK_HOME
C:\Users\Sam>echo %PIK_HOME% C:\Users\Sam.pik
C:\Users\Sam>echo %HOME% %HOME%
PIK_HOME should be set to the directory where pik_run.bat is located (usually not C:\pik)
You might also need to restart the console session to ensure it gets all the current env vars.
Maybe the only combination I didn't think about trying :) It works, thanks a lot! (echo too)
No problem. Hopefully pik 1.0 will provide some feedback if the required env vars aren't set rather than silent failure.
Setting PIK_HOME in the standard windows console worked, but how about the git bash?
but how about the git bash?
You should be able to add it to ~/.profile
(or .bash_profile
) as export PIK_HOME=...
I have PIK_HOME set in my profile, and I can confirm it with an echo. No dice.
@visoft do you have both PIK_HOME exported and pik function defined? I works for me:
Luis@KEORE ~
$ echo $PIK_HOME
C:/Pik
Luis@KEORE ~
$ pik ls
ruby-1.8.6-p398
ruby-1.8.6-p398@d21
ruby-1.8.7-p352
ruby-1.9.2-p290
=> ruby-1.9.3-dev
ruby-1.9.4-dev
jruby-1.6.3
@luislavena, I do. pik use just doesn't do anything.
dwhite@VISOFT-DWHITE02 /d/Development
$ echo $PIK_HOME
C:\Users\dwhite/.pik
dwhite@VISOFT-DWHITE02 /d/Development
$ pik ls
ruby-1.8.7-p352
=> ruby-1.9.2-p290
dwhite@VISOFT-DWHITE02 /d/Development
$ ruby -v
ruby 1.9.2p290 (2011-07-09) [i386-mingw32]
dwhite@VISOFT-DWHITE02 /d/Development
$ pik use 1.8.7-p352
dwhite@VISOFT-DWHITE02 /d/Development
$ ruby -v
ruby 1.9.2p290 (2011-07-09) [i386-mingw32]
I also tried changing PIK_HOME to not have mixed slashes, but it doesn't make a difference
$ echo $PIK_HOME
C:/Users/dwhite/.pik
Hmn, works for me:
Luis@KEORE ~
$ echo $PIK_HOME
C:/Pik
Luis@KEORE ~
$ pik ls
ruby-1.8.6-p398
ruby-1.8.6-p398@d21
ruby-1.8.7-p352
ruby-1.9.2-p290
ruby-1.9.3-dev
ruby-1.9.4-dev
jruby-1.6.3
Luis@KEORE ~
$ pik use 1.8.7-p352
Luis@KEORE ~
$ pik ls
ruby-1.8.6-p398
ruby-1.8.6-p398@d21
=> ruby-1.8.7-p352
ruby-1.9.2-p290
ruby-1.9.3-dev
ruby-1.9.4-dev
jruby-1.6.3
Luis@KEORE ~
$ ruby -v
ruby 1.8.7 (2011-06-30 patchlevel 352) [i386-mingw32]
Can you confirm that pik.sh
is in your bash-profile?
$ cat .profile
export PIK_HOME=C:/Pik
[[ -s $HOME_TOOLS/bin/pik.sh ]] && source $HOME_TOOLS/bin/pik.sh
@luislavena - I ended up going back to 0.2.8 for now. I used the gist here: https://gist.github.com/1239600 to setup the configuration and all seems to be working well. I'll move to 0.3.0, but there's no pressing reason right now. I'm sure that my configuration was off somewhere along the line. Anyway, thanks for all of your help.
Extremely helpful.. fih
works great after set the user env var to "PIK_HOME" and not "%PIK_HOME%".
you can now add alias to better the workflow: C:\Users\Yotam>pik ls 193: ruby-1.9.3-p545 => 213: ruby-2.1.3-p242
C:\Users\Yotam>ruby -v ruby 2.1.3p242 (2014-09-19 revision 47630) [x64-mingw32]
C:\Users\Yotam>pik use 193 C:\Users\Yotam>ruby -v ruby 1.9.3p545 (2014-02-24) [i386-mingw32]
my config file is at .pik is:
"193: [ruby-]1.9.3-p545": :alias: "193" :path: !ruby/object:Pathname path: C:/dev/Ruby193/bin :version: | ruby 1.9.3p545 (2014-02-24) [i386-mingw32]
"213: [ruby-]2.1.3-p242": :alias: "213" :path: !ruby/object:Pathname path: C:/dev/Ruby21-x64/bin :version: | ruby 2.1.3p242 (2014-09-19 revision 47630) [x64-mingw32]
--- {}
I wonder why everyone talks about the solution yet nobody described the solution step by step. Here is what you should do:
@1dot44mb I might recommend moving from Pik and use of Uru:
C:\dev\apps\pik>pik list ruby-1.8.7-p334 ruby-1.9.2-p180
C:\dev\apps\pik>pik use 187 Nothing matches:
--- config.yml: "[ruby-]1.8.7-p334": :path: !ruby/object:Pathname path: C:/dev/apps/ruby187/bin :version: | ruby 1.8.7 (2011-02-18 patchlevel 334) [i386-mingw32]
Tried imploding and re-adding without further success.
"[ruby-]1.9.2-p180": :path: !ruby/object:Pathname path: C:/dev/apps/ruby192/bin :version: | ruby 1.9.2p180 (2011-02-18) [i386-mingw32]