Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
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.
-
Download and install Ruby 1.9.3 and DevKit from
http://rubyinstaller.org/downloads/
- Ruby 1.9.3-p484
- Start the RubyInstaller
- check "Add Ruby executables to your PATH"
- INSTALL
- Ruby DEVELOPMENT KIT
For use with Ruby 1.8.7 and 1.9.3:
DevKit-tdm-32-4.5.2-20111229-1559-sfx.exe-
Dev Kit install:
- Extract Devkit files to C:\Ruby193\DevKit
(assumes you installed Ruby 193 to C:\Ruby193) - Open the Command Line Console
- Extract Devkit files to C:\Ruby193\DevKit
-
Dev Kit install:
-
Install Pik:
gem install pik pik_install C:\Pik
- (can be any folder other than your Ruby folders)
- add Pik to your PATH
setx path "%path%;C:\Pik"
- Close and restart Command Line Console
- Add ruby versions to pik as necessary
pik add C:\Ruby193\bin
- Tell Pik to use Ruby 1.9.3
pik use 193
-
Bundler:
You will not have to build a bundle gemfile. It is included in the Omega theme.
- To install bundler:
gem install bundler
- To get started using Sass and your sub theme
- cd to your Omega sub theme folder
- check for your Omega bundle dependencies:
bundle check
- 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
- To install bundler:
- You should now be ready to start using Sass with the Omega 4 subtheme!
- To have guard start watching and auto-compile your Sass files as you save them, run:
bundle exec guard
- To have guard start watching and auto-compile your Sass files as you save them, run:
cd /d C:\Ruby193\DevKit
ruby dk.rb init
ruby dk.rb review
ruby dk.rb install
If you have not yet watched Sebastian's video on Omega 4, I highly recommend watching it. It will save you hours!
Comments
Great tutorial thanks, saved
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 typingpik 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.Site infinite reloading
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?
thanks a lot for the tutorial
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
Nearly there...
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 :
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
Great! Thanks for sharing!
Great! Thanks for sharing! Very useful
LiveReload Extremely Slow
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.Success
Worked perfectly! Thanks for explaining what each command was doing as well.
Thank you very much for this
Thank you very much for this write-up!
Thank you great tutorial !!!
Thank you great tutorial !!! :-)
It works!
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
Awsome!
Thank you for a great tutorial!!
Not working plz help me !
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.
Instructions apply to Omega 4.x only - Don't use Omega Tools!
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!
Thanks a lot !
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 !
Note on Sources of gems file
On my installation:
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.
Eventmachine fails to install
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
: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 runbundle install
from within the Omega 4 subtheme and all required gems installed! Great success! I hope this helps others.bundle install fail
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.
I can confirm rajmataj
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