Monday, May 28, 2012

Create Ruby on Rails development environment for Windows XP: DOS prompt and pik

This post details a Windows setup for the book Rails 3 in Action.  Having done both an Ubuntu 12.04 and a Windows XP RoR setup, I strongly recommend the former: much quicker and easier.


I was having some issues with my Cygwin/RVM install so I decided to try using the DOS command prompt and pik instead.



http://stackoverflow.com/questions/9189628/install-ruby-on-rails-on-windows
I think the answerer to this post incorrectly uses bundler to try and install gems (at least for me it gave an error, but using pik gem install <gemname> worked).


Note that for the console I'm using the Windows DOS command line instead of cygwin

Installed Ruby via the Ruby installer

    Added Ruby to path as part of the installer option

Installed pik

D:\> gem install pik
D:\> pik_install <directory_in_PATH>

Ran pik

D:\> pik
D:\> pik list ## confirm proper Ruby version



Installed DevKit

Ran installer to %DEVKIT_HOME%

%DEVKIT_HOME%\> ruby dk.rb init
%DEVKIT_HOME%\> ruby dk.rb install

Test the DevKit installation

%DEVKIT_HOME%\> pik gem install rdiscount --platform=ruby
%DEVKIT_HOME%\> ruby -rubygems -e "require 'rdiscount'; puts Discount.new('**Hello there, Eric!**').to_html"
Should output 
<p><strong>Hello there, Eric!</strong></p>

Installed gems using pik

I didn't find a lot of pik usage information, but I decided to install gems with pik.  Using 'gem list' and 'pik gem list' in different consoles leads me to believe that the installation methods acheive the same result.  Pik dosen't appear to have native gemset-like commands, but see this post for a hack.
D:\> pik gem install bundler --pre
D:\> pik gem install rake
D:\> pik gem install activesupport
D:\> pik gem install mysql
D:\> pik gem install libv8
D:\> pik gem install rails
D:\> pik gem install execjs
D:\> pik gem install jquery-rails


Installed locally downloaded gems

D:\> pik gem install linecache19-0.5.13.gem


This one required the source code for my Ruby version
D:\> set RVM_SRC=<path_to_source>
D:\> pik gem install ruby-debug-base19-0.11.26.gem -- --with-ruby-include=%RVM_SRC%




Errors

Gem::RemoteFetcher::FetchError: SSL_connect returned=1 errno=0 state=SSLv3 read
server certificate B: certificate verify failed (https://rubygems.org/gems/<gem_name>)

I got this above error when running bundle install.  See this post for several fixes.  This one worked for me, but I had to create the destination directory before running the script.

No comments:

Post a Comment