1

I'm using Jekyll to create a static website and want to use the framework Bourbon to build my CSS from.

I've installed Jekyll and want to install Bourbon by adding it to my Gemfile using gem 'bourbon' and running bundle install.

Now when I add the rule @import 'bourbon'; to my SCSS file and start to run Jekyll by jekyll serve -w it starts, but when I modify my SCSS file the Jekyll watcher throws an error saying:

    Regenerating: 1 files at 2014-07-03 10:00:11   `Conversion error: There was an error converting 'css/main.scss'.`
...error:
    Error: File to import not found or unreadable: bourbon. Load path: /Users/mark/Code/markdejong.com/mistermark.github.com.jekyll/_sass
    Error: Run jekyll build --trace for more information.

What can be the problem here? Shouldn't it be possible to import it like this or doesn't Jekyll support this?

Mr.Mark
  • 97
  • 2
  • 14

3 Answers3

9

Assuming you have a Gemfile:

source 'https://rubygems.org'

gem 'jekyll'

gem 'bourbon'
gem 'neat'

Add this line to _config.yml

gems: [bourbon, neat]

Jekyll will require these gems automatically.

Just do for import:

@import 'bourbon';
@import 'neat';

Check Jekyll docs for more information http://jekyllrb.com/docs/plugins/

Lucas Renan
  • 3,787
  • 3
  • 28
  • 35
3

Did you do a

bourbon install

In order to create the bourbon folder ?

Bourbon's doc also says that for non rail app the import rule is :

@import 'bourbon/bourbon';
David Jacquel
  • 51,670
  • 6
  • 121
  • 147
  • These steps are unnecessary when Bourbon is installed from RubyGems. Yeah, it's not documented. Edit: with RubyGems, the `@import` directive is `@import 'bourbon'`. – piouPiouM Jul 04 '14 at 07:46
  • This is how I would do it when I don't want to use RubyGems. But in this particular case I do want to use RubyGems. So this solution (standard use) doesn't apply here. – Mr.Mark Jul 04 '14 at 13:06
0

Did you import Bourbon at the Ruby level, with require 'bourbon?
Or in your Sass configuration?

With Sass, to use Bourbon installed with RubyGems, you have to tell the following command (note the argument -r bourbon):

sass -r bourbon -w css:sass

I do not know Jekyll, but it's perhaps a clue?

piouPiouM
  • 4,937
  • 1
  • 21
  • 22
  • I did try to import with `require 'bourbon'`, but then it doesn't get recognized by **Jekyll**. That's the problem I'm facing now. – Mr.Mark Jul 04 '14 at 13:09