Team Lando
Using Compass on a Lando Node Service
Some older node
based frontend build steps rely on ruby
and compass
. If you have such a flow we highly recommend you escape dependency hell and migrate your sass
build steps to use node-sass
which is way faster.
However, if you cannot do this you may run into some issues running compass
inside of your node
container since this pattern is fundamentally at odds with Lando's one-thing-per-container model.
You can, however, get around it by installing ruby
and compose
directly in the node
service that requires them.
Below is an example that installs ruby
and compass
using build-steps.
yaml
services:
myservice:
type: node:12
build_as_root:
- apt-get update -y
- apt-get install ruby-full -y
- gem install compass
tooling:
ruby:
service: myservice
compass:
service: myservice
You can verify with:
bash
lando ruby -v
lando compass -v
You should now be able to run any build steps that require ruby
and compass
as in this example:
yaml
services:
myservice:
type: node:12
globals:
grunt-cli: latest
build_as_root:
- apt-get update -y
- apt-get install ruby-full -y
- gem install compass
build:
- grunt build:sass
tooling:
ruby:
service: myservice
compass:
service: myservice