# How to deal with \_sass converting errors?

**URL:** <https://talk.jekyllrb.com/t/how-to-deal-with--sass-converting-errors/911>\
**Category:** Uncategorized\
**Created:** [August 21, 2017, 8:50am UTC](https://talk.jekyllrb.com/t/how-to-deal-with--sass-converting-errors/911 "2017-08-21T08:50:20Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![lsrdg](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.jekyllrb.com/lsrdg/32/431_2.png) [@lsrdg](https://talk.jekyllrb.com/u/lsrdg)\
**Post date:** [August 21, 2017, 8:50am UTC](https://talk.jekyllrb.com/t/how-to-deal-with--sass-converting-errors/911/1 "2017-08-21T08:50:20Z")

</div>

This is not the first time I’ve seen this kind of error, but it has been a long time since the last time… I cannot remember the solution, but I can’t forget that it takes always ages to find out what is going on. The two main reasons (AFAIK) are that: 1) I’m using gitlab, and not github (and it takes time to find something about), and 2) that the error happens in an imaginary line which I can’t find…

Here is how I got to the error:

- created and published (to gitlab pages) a new blog with Minima. It was working both locally and after being published.
- Minimal Mistakes theme installed and working locally.

Here is the last error I’ve got after pushing:

```auto
Destination: public
 Incremental build: disabled. Enable with --incremental
      Generating... 
  Conversion error: Jekyll::Converters::Scss encountered an error while converting 'assets/css/main.scss':
                    Invalid US-ASCII character "\xE2" on line 54
jekyll 3.5.2 | Error: Invalid US-ASCII character "\xE2" on line 54
ERROR: Job failed: exit code 1

```

I’ve found some issues about this: both on [jekyll](https://github.com/jekyll/jekyll/issues/4268)’s and [minimal mistakes](https://github.com/mmistakes/minimal-mistakes/issues/1183)’s repositories, and also at some other places, but they all fall into to different approaches:

- An US-ASCII invalid character that should be replaced

but which I couldn’t find (neither grepping nor manually checking the files), or:

- or some locale info (`locale-gen en_US.UTF-8` etc) that should be added to docker or maybe `.gitlab-ci.yml`…

and I really don’t have a clue about how/when/where/why…

My main doubt right now is: how to read those error messages about a line that I can’t find (since the it is not compiled yet, and since I couldn’t find anything on `_site/` to give me a clue)? But any help on how to solve the issue is appreciated, as well as a better way to rephrase the topic’s title.

Thanks in advance!

---

<div class="post-metadata">

**Author:** ![rdyar](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.jekyllrb.com/rdyar/32/710_2.png) [@rdyar](https://talk.jekyllrb.com/u/rdyar)\
**Post date:** [August 22, 2017, 4:45am UTC](https://talk.jekyllrb.com/t/how-to-deal-with--sass-converting-errors/911/2 "2017-08-22T04:45:49Z")

</div>

Last year I was playing with GL and the ci stuff - I do not remember that much about it, but in my ci file I do have some locale stuff that I had to put in there to get it to work, under script - do you have anything like that in your ci file?

I am not using the awesome MM theme - just my own stuff.

A lot of what I was trying to accomplish had to do with getting a minify script to work as well as pushing to S3 - that is why this is such a long file I think.

Here it is, definitely do not copy it as is, just see if adding the locale stuff (5-6 lines I think) in the same part helps:

```auto
image: ruby:2.3
test:
  stage: test
  script:
  - gem install jekyll
  - jekyll build -d test
  artifacts:
    paths:
    - test
  except:
  - master
pages:
  stage: deploy
  script:
  - apt-get update -y
  - apt-get install -y openjdk-7-jre-headless
  - apt-get install -y locales
  - echo "en_US UTF-8" > /etc/locale.gen
  - locale-gen en_US.UTF-8
  - export LANG=en_US.UTF-8
  - export LANGUAGE=en_US:en
  - export LC_ALL=en_US.UTF-8
  - gem install therubyracer
  - gem install reduce
  - gem install jekyll
  - jekyll --version
  - gem install s3_website
  - gem install octopress-autoprefixer
  - jekyll build -d public
  - rake minify
  - s3_website push
  artifacts:
    paths:
    - public
  only:
  - master

```

---

<div class="post-metadata">

**Author:** ![lsrdg](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.jekyllrb.com/lsrdg/32/431_2.png) [@lsrdg](https://talk.jekyllrb.com/u/lsrdg)\
**Post date:** [August 22, 2017, 11:15am UTC](https://talk.jekyllrb.com/t/how-to-deal-with--sass-converting-errors/911/3 "2017-08-22T11:15:54Z")

</div>

Thanks again, @rdyar!

I had the kind of “official” [`.gitlab-ci.yml`](https://gitlab.com/pages/jekyll/blob/master/.gitlab-ci.yml) for jekyll. And it has only one line on its `pages: scripts:`, which is: `- bundle exec jekyll build -d public`.

On the issues mentioned on the first post, there are some mentions to adding something about the locale (such as `- export LANG=en_US.UTF-8`), but I wasn’t sure at this should be on the `.gitlab-ci.yml`, and even if it should be there, I didn’t know where exactly. However, thanks to your `.gitlab-ci.yml` it is working now.

I took the first 8 lines of your `pages: script:` section, and added them before the `- bundle exec jekyll build -d public`.

Here is the whole file for reference (in case anyone needs it):

```auto
image: ruby:2.3

variables:
  JEKYLL_ENV: production

before_script:
  - bundle install

test:
  stage: test
  script:
  - bundle exec jekyll build -d test
  artifacts:
    paths:
    - test
  except:
  - master

pages:
  stage: deploy
  script:
  - apt-get update -y
  - apt-get install -y openjdk-7-jre-headless
  - apt-get install -y locales
  - echo "en_US UTF-8" > /etc/locale.gen
  - locale-gen en_US.UTF-8
  - export LANG=en_US.UTF-8
  - export LANGUAGE=en_US:en
  - export LC_ALL=en_US.UTF-8
  - bundle exec jekyll build -d public
  artifacts:
    paths:
    - public
  only:
  - master

```

I’m not sure if this is most effective way to solve the problem, but it does work (but any feedback is welcome). 🙂

If anyone has any idea on how to properly understanding these “\_sass” erros, I would be really thankful. And any suggestion to a better title to this topic would be appreciated as well.

---

<div class="post-metadata">

**Author:** ![rdyar](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.jekyllrb.com/rdyar/32/710_2.png) [@rdyar](https://talk.jekyllrb.com/u/rdyar)\
**Post date:** [August 22, 2017, 4:35pm UTC](https://talk.jekyllrb.com/t/how-to-deal-with--sass-converting-errors/911/4 "2017-08-22T16:35:04Z")

</div>

> [@lsrdg](#):
>
> - apt-get install -y openjdk-7-jre-headless

this line installs java which you should not need so you can probably remove it and it will go a little faster and should still work properly. I was installing java so that the s3\_website gem would work.

Glad it worked!

as for where the error is, from what I saw reading different issues it is probably something in a comment in the sass files. As long as the locale is set I don’t think there is an actual error.

---

<div class="post-metadata">

**Author:** ![lsrdg](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.jekyllrb.com/lsrdg/32/431_2.png) [@lsrdg](https://talk.jekyllrb.com/u/lsrdg)\
**Post date:** [August 28, 2017, 3:56pm UTC](https://talk.jekyllrb.com/t/how-to-deal-with--sass-converting-errors/911/5 "2017-08-28T15:56:05Z")

</div>

Thanks!

In this case, it would be better off with another erro message. Anyway, thanks again . (:

---

<div class="post-metadata">

**Author:** ![justinhartman](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.jekyllrb.com/justinhartman/32/1048_2.png) [@justinhartman](https://talk.jekyllrb.com/u/justinhartman)\
**Post date:** [June 6, 2018, 2:17pm UTC](https://talk.jekyllrb.com/t/how-to-deal-with--sass-converting-errors/911/6 "2018-06-06T14:17:27Z")

</div>

Yeah the `apt-get install -y openjdk-7-jre-headless` isn’t needed for Jekyll on GitLab. I have found the most efficient way to get GitLab CI to build the Jekyll site is with the following `.gitlab-ci.yml` file.

```auto
image: ruby:2.3

cache:
  paths:
  - vendor/

before_script:
  - apt-get update -y
  - apt-get install -y locales
  - echo "en_US UTF-8" > /etc/locale.gen
  - locale-gen en_US.UTF-8
  - export LANG=en_US.UTF-8
  - export LANGUAGE=en_US:en
  - export LC_ALL=en_US.UTF-8
  - gem install jekyll bundler --install-dir vendor/ruby/2.3.0
  - gem install sass --no-user-install --install-dir vendor/ruby/2.3.0
  - bundle install --path vendor

variables:
  JEKYLL_ENV: production

pages:
  stage: deploy
  script:
  - bundle exec jekyll build -d public
  artifacts:
    paths:
    - public
  only:
  - master

test:
  stage: test
  script:
  - bundle exec jekyll build -d test
  artifacts:
    paths:
    - test
  except:
  - master

```

Note that I am installing all the Gems in the locally configured `./vendor/` folder. This just keeps everything neat and tidy. I’ve also added a `before_script:` YAML setting and moved all the installs to this part of the config file. This way, all the dependencies are installed before you run any of the deploy methods.

It took me many many hours to get GitLab CI to build my old GitHub Pages website so I hope that this config file helps other people too!
