I had a lot of trouble getting Omega Sass to compile properly without gem dependency errors. Below is a quick guide to getting your Windows Development Environment up and running quickly for the Omega 4 Theme using Pik (an RVM alternative), and Bundler.

  1. Download and install Ruby 1.9.3 and DevKit from 

    http://rubyinstaller.org/downloads/

    1. Ruby 1.9.3-p484
      1. Start the RubyInstaller
      2. check "Add Ruby executables to your PATH"
      3. INSTALL
    2. Ruby DEVELOPMENT KIT

      For use with Ruby 1.8.7 and 1.9.3:

      DevKit-tdm-32-4.5.2-20111229-1559-sfx.exe
      1. Dev Kit install:
        1. Extract Devkit files to C:\Ruby193\DevKit

          (assumes you installed Ruby 193 to C:\Ruby193)
        2. Open the Command Line Console
  2. cd /d C:\Ruby193\DevKit
    ruby dk.rb init
    ruby dk.rb review
    ruby dk.rb install
  3. Install Pik:

    gem install pik
    pik_install C:\Pik
    • (can be any folder other than your Ruby folders)
    1. add Pik to your PATH

      setx path "%path%;C:\Pik"
    2. Close and restart Command Line Console
    3. Add ruby versions to pik as necessary
      pik add C:\Ruby193\bin
    4. Tell Pik to use Ruby 1.9.3
      pik use 193
  4. Bundler:

    You will not have to build a bundle gemfile. It is included in the Omega theme.

    1. To install bundler:

      gem install bundler
    2. To get started using Sass and your sub theme
      1. cd to your Omega sub theme folder
      2. check for your Omega bundle dependencies:

        bundle check
      3. If you are missing any dependencies, have bundler install the missing dependencies.(This command installs all the dependencies in the Omega Sub theme gemfile)

        bundle install
  5. You should now be ready to start using Sass with the Omega 4 subtheme!
    1. To have guard start watching and auto-compile your Sass files as you save them, run:

      bundle exec guard

If you have not yet watched Sebastian's video on Omega 4, I highly recommend watching it. It will save you hours!

Comments

flatfeat’s picture

Great tutorial thanks, saved me lots of time setting Ruby up again on my second computer.

One tip: In Install Pick, after step 2 when you close and restart the command line, I had to first type the command cd C:\Pik before typing pik add C:\Ruby193\bin, or else I got the error "pik not recognized as an internal o external command." If you're getting that error, try to cd into the folder where you installed pik.

leolandotan’s picture

Thanks for the tutorial! This got me started with omega 4 + sass in Windows. I just got one issue, when i change to another page it doesn't finish to load completely and then when i close the Ruby Command Prompt, the page loads. Any thoughts about this?

tiikeri’s picture

thanks a lot for the tutorial, it's quite hard for windows user to do some works which seem simple in linux.
Just for people not very familiar with command line, like me:
In step 1: you need to set manually the path of your Ruby installation. The easiest way to do so is to check this option after running the installer (add ruby to your PATH), else you need to set your path in "Environment Variables" of your system.
then you can enjoy ruby commands

Dave Sandilands’s picture

First, many thanks for this tutorial :)

I've got as far as section 3 (Bundler), part 2 , step 3 (bundle install) and have fallen over , hopefully not too far from the end.

Here's the output :

g:\Themes\gfnp4>bundle install
Fetching gem metadata from https://rubygems.org/..........
Fetching additional metadata from https://rubygems.org/..
Resolving dependencies...
Installing addressable 2.3.6
Installing chunky_png 1.3.0
Installing fssm 0.2.10
Installing sass 3.2.18
Installing compass 0.12.4
Installing breakpoint 2.0.7
Installing timers 1.1.0
Installing celluloid 0.15.2

Gem::InstallError: The 'nio4r' native gem requires installed build tools.

Please update your PATH to include build tools or download the DevKit
from 'http://rubyinstaller.org/downloads' and follow the instructions
at 'http://github.com/oneclick/rubyinstaller/wiki/Development-Kit'
An error occurred while installing nio4r (1.0.0), and Bundler cannot continue.
Make sure that `gem install nio4r -v '1.0.0'` succeeds before bundling.

I'm unsure what folder is being referred to by 'build tools' in the suggestion 'Please update your PATH to include build tools'

My Omega sub theme is built on version 7.x-4.2
The Ruby download version is Ruby 1.9.3-p545
The Ruby DevKit download version is DevKit-tdm-32-4.5.2-20111229-1559-sfx.exe

Edit:
I tried adding the DevKit folder to the Windows PATH variable which produced the same result.
I then repeated this adding DevKit/bin. A mass of new errors was thrown up which lead me to the extconf.rb file which was updated just 10 days ago on Github. I note this error has been reported on Github before when using Ruby 2.0 and the advice then was to go back to 1.9.3 as a solution.
FYI, nio4r is a component of celluloid

Edit 2:

Issue resolved - please note that it is necessary to run devkitvars.bat which is in the DevKit folder. This configures the Command Prompt environment to use the DevKit for compiling native Ruby extensions

regards

Dave Sandilands
http://bristolwebservices.co.uk

theorios’s picture

Great! Thanks for sharing! Very useful

ErikHendrick’s picture

I was successful with the setup instructions. However, LiveReload performance is incredibly slow. It takes 20+ seconds for a single change in the SCSS file to reload the browser.

rvillan’s picture

Worked perfectly! Thanks for explaining what each command was doing as well.

Percept’s picture

Thank you very much for this write-up!

Fulgrim’s picture

Thank you great tutorial !!! :-)

LennyB’s picture

Thanks for the instructions.

I encountered these 3 compilation errors
*****
error sass/mytheme.no-query.scss (Line 3 of sass/mytheme.styles.scss: File to import not found or unreadable: breakpoint
error sass/mytheme.normalize.scss (Line 8: File to import not found or unreadable: toolkit/border-box
error sass/mytheme.styles.scss (Line 3: File to import not found or unreadable: breakpoint
*****

This was easily fixed by making the changes in comments #7 and #10 here https://www.drupal.org/node/2323235

matsjacobsson’s picture

Thank you for a great tutorial!!

Dharmendra.s’s picture

first of all thanks for this great tutorial,

but i am facing issue to install properly,,,,
when i execute bundle check command in cmd than it gives error, "Could not locate gemfile"
i have created omega subtheme with help of omega tools and in subtheme directory i execute this command.

Please help me, i have stuck here last few days.

pkiff’s picture

The instructions on this page apply to Omega 4.x only. Are you using Omega 3.x or 4.x? When using Omega 4.x, you should never use Omega Tools to create your subtheme. Omega Tools is for Omega 3.x only!

thisisit’s picture

Thanks a LOTfor the tutorial ! Saved a lot of energy.
I got SSL errors in doing bundle install many times and needed to do individual 'gem installs xxx' for dependencies.
On searching further found out I needed to do the following to update
gem update --system 1.8.29
Post that, worked fine .
Thanks again !

tien.nguyen.py’s picture

On my installation:

  1. OS: Windows 7 64 bit
  2. Ruby: installed from rubyinstaller-1.9.3-p551

I encountered the problem on step 2. Install Pik, it took me a day to figure out the problem.
Pik can not installed, because the sources is pointing to "http://rubygems.org/" this address is not available.
Change the source to SSL "https://rubygems.org" resolve the problem.

rajmataj’s picture

First of all, thank you for this detailed explanation on the steps for Omega 4.

Unfortunately, on a Windows 7 64-bit machine using ruby 1.9.3p545, I am running into an error at step 3-3 where it reports Eventmachine cannot be installed. Here is the output I am receiving when running bundle install:

$ bundle install
Fetching gem metadata from https://rubygems.org/...........
Fetching version metadata from https://rubygems.org/...
Fetching dependency metadata from https://rubygems.org/..
Resolving dependencies....
Using addressable 2.3.8
Using sass 3.4.18
Using sassy-maps 0.4.0
Using breakpoint 2.5.0
Using chunky_png 1.3.4
Using coderay 1.1.0
Using multi_json 1.11.2
Using compass-core 1.0.3
Using compass-import-once 1.0.5
Using rb-fsevent 0.9.5
Using ffi 1.9.10
Using rb-inotify 0.9.5
Using compass 1.0.3
Using compass-normalize 1.5
Using compass-rgbapng 0.2.1
Using compass-validator 3.0.1
Using css_parser 1.3.6
Installing eventmachine 1.0.8 with native extensions

Gem::Ext::BuildError: ERROR: Failed to build gem native extension.

    c:/Ruby193/bin/ruby.exe -r ./siteconf20150825-7780-3fr24e.rb extconf.rb
checking for main() in -lssleay32... no
checking for rb_trap_immediate in ruby.h,rubysig.h... no
checking for rb_thread_blocking_region()... yes
checking for ruby/thread.h... no
checking for inotify_init() in sys/inotify.h... no
checking for __NR_inotify_init in sys/syscall.h... no
checking for writev() in sys/uio.h... no
checking for rb_thread_fd_select()... yes
checking for rb_fdset_t in ruby/intern.h... yes
checking for pipe2() in unistd.h... no
checking for accept4() in sys/socket.h... no
checking for SOCK_CLOEXEC in sys/socket.h... no
checking for rb_wait_for_single_fd()... yes
checking for rb_enable_interrupt()... yes
checking for rb_time_new()... yes
checking for windows.h... yes
checking for winsock.h... yes
checking for main() in -lkernel32... yes
checking for main() in -lrpcrt4... yes
checking for main() in -lgdi32... yes
CFLAGS=$(cflags) -Wall -Wextra -Wno-deprecated-declarations -Wno-ignored-qualifiers -Wno-unused-resu
lt
CPPFLAGS=-DFD_SETSIZE=2048 $(DEFS) $(cppflags) -Wall -Wextra -Wno-deprecated-declarations -Wno-ignor
ed-qualifiers -Wno-unused-result
checking for clock_gettime()... no
checking for gethrtime()... no
creating Makefile

make  clean
Makefile:165: *** target pattern contains no `%'.  Stop.

make
Makefile:165: *** target pattern contains no `%'.  Stop.

make failed, exit code 2

Gem files will remain installed in c:/Ruby193/lib/ruby/gems/1.9.1/gems/eventmachine-1.0.8 for inspec
tion.
Results logged to c:/Ruby193/lib/ruby/gems/1.9.1/extensions/x86-mingw32/1.9.1/eventmachine-1.0.8/gem
_make.out
An error occurred while installing eventmachine (1.0.8), and Bundler cannot
continue.
Make sure that `gem install eventmachine -v '1.0.8'` succeeds before bundling.

The problem is, trying gem install eventmachine -v '1.0.8' yields the same errors. On my Mac at home running 10.10, it seems to work fine. Any help is appreciated. Thanks.

Update 2015-08-26
After much searching around, I came across this post which suggested running gem update --system 2.3.0 since this fixed the issue for others. After running this, I was able to successfully run bundle install from within the Omega 4 subtheme and all required gems installed! Great success! I hope this helps others.

cryptocoinplaza’s picture

I have tried and tried to understand where I am going wrong but to no avail. I reach the install bundle step and receive the following:

c:\wamp\www\cryptocoinplaza\sites\all\themes\ccp_plazatheme>bundle install
Fetching gem metadata from https://rubygems.org/...........
Fetching version metadata from https://rubygems.org/...
Fetching dependency metadata from https://rubygems.org/..
Resolving dependencies.....

Gem::RemoteFetcher::FetchError: SSL_connect returned=1 errno=0 state=SSLv3 rea
server certificate B: certificate verify failed (https://rubygems.org/gems/add
ssable-2.3.8.gem)
An error occurred while installing addressable (2.3.8), and Bundler cannot
continue.
Make sure that `gem install addressable -v '2.3.8'` succeeds before bundling.

Any pointers would help. I have tried all the version updates in this thread. Many thanks.

matsjacobsson’s picture

I can confirm rajmataj comment to run gem update --system 2.3.0
before step 3, installing bundle.

Hope someone could make another great guide for using the new default starterkit and LibSass someday.

Cheers! /Mats