since 2013-01-13
ruby を Windows 環境で複数使い分けられるツールという話。
http://d.hatena.ne.jp/hackugyo/20110629/1309379196
http://holypp.hatenablog.com/entry/20110407/1302193459
以下、Ruby 1.9.2 は heroku のツール heroku-toolbelt.exe をインストールしたときに入ったもの。
管理者権限でコマンドプロンプトを実行しないと gem install pik に失敗する。
>gem install pik ERROR: While executing gem ... (Errno::EACCES) Permission denied - c:/Program Files (x86)/ruby-1.9.2/lib/ruby/gems/1.9.1/gems/pik-0.2.8/tools/pik.bat
http://stackoverflow.com/questions/5129572/permission-denied-error-while-installing-gem
Gem 使うなという話も。
http://d.hatena.ne.jp/kk_Ataka/20111004/1317660186
管理者権限でコマンドプロンプトで pik.bat したら、いちおう動いた:
C:\Windows\system32>"c:/Program Files (x86)/ruby-1.9.2/lib/ruby/gems/1.9.1/gems/pik-0.2.8/tools/pik.bat" creating C:\Users\nishimotz\.pik ** Adding: 192: ruby 1.9.2p290 (2011-07-09) [i386-mingw32] Located at: C:\Program Files (x86)\ruby-1.9.2\bin Usage: pik command [options] To get help with a command pik help (command) To list all commands and descriptions: pik help commands -V, --version Pik version -d, --debug Outputs debug information
Redmond Path で pik.bat にパスを通す。
コマンド一覧:
c:\work>pik help commands add Adds another ruby location to pik. benchmark|bench Runs bencmarks with all versions that pik is aware of. config Adds/modifies configuration options. default Switches back to the default settings. devkit Configures devkit settings gem Runs the gem command with all versions that pik is aware of. gemsync Synchronizes gems from the version specified to the current ve rsion. help Displays help information. implode Removes your pik configuration. info|checkup|cu Displays information about the current ruby version. install|in Downloads and installs different ruby versions. list|ls Lists ruby versions that pik is aware of. rake Runs the rake command with all versions that pik is aware of. remove|rm Removes a ruby location from pik. ruby|rb Runs ruby with all versions that pik is aware of. run Runs command with all versions of ruby that pik is aware of. tag Adds the given tag to the current version. tags Runs the pik command against the given tags. uninstall|unin Deletes a ruby version from the filesystem and removes it from Pik. update|up updates pik. use|switch|sw Switches ruby versions based on patterns. For help on a particular command, use 'pik help COMMAND'.