thoughtbot / suspenders

A Rails template with our standard defaults.
https://thoughtbot.com
MIT License
4.01k stars 529 forks source link

Out-of-the-box SCSS misconfiguration #738

Closed seanpdoyle closed 8 years ago

seanpdoyle commented 8 years ago

After scaffolding out an app from a fresh gem install suspenders -- without any modifications -- my first feature spec is failing to run with the following error:

     Failure/Error: $base-font-family: $helvetica;

     ActionView::Template::Error:
       Undefined variable: "$helvetica".
     # ./app/assets/stylesheets/base/_variables.scss:2
     # ./app/assets/stylesheets/base/_base.scss:6
     # ./app/assets/stylesheets/application.scss:8
seanpdoyle commented 8 years ago

This seems related to https://github.com/thoughtbot/bitters/issues/234#issuecomment-193780015.

Here is a snippet of the out-of-the-box Gemfile.lock, generated via cat Gemfile.lock | grep bourbon:

    bourbon (5.0.0.beta.3)
      bourbon (>= 4.0)
  bourbon (= 5.0.0.beta.3)
joshuaogle commented 8 years ago

@seanpdoyle This is caused by some renaming in Bourbon 5 that isn't in Bitters yet. If you rename $helvetica to $font-stack-helvetica, it should work. Bitters will be updated as soon as Bourbon 5 is out (imminently)

tysongach commented 8 years ago

This is strange because Suspenders should be pulling in Bitters 1.3, which is up to date for Bourbon 5…

@seanpdoyle Inside /app/assets/stylesheets/base/_base, what version of Bitters does it give at the top?

seanpdoyle commented 8 years ago

@tysongach // Bitters 1.2.0

tysongach commented 8 years ago

@seanpdoyle Are you using Suspenders 1.37.0? That’s when Bitters got upgraded to 1.3, so it’s possible you have an ever-so-slightly out of date Suspenders…

seanpdoyle commented 8 years ago

@tysongach

❯ suspenders -v
1.37.0
derekprior commented 8 years ago

Bitters is listed as a development dependency in the Gemspec.

Bitters is not a gemfile dependency in the generated app because it's not required at runtime. It's used only to run bitters install which copies the files to your own assets.

I think what happens is that @seanpdoyle already had bitters 1.2 installed so the suspenders commands used that. Had he no previous version of bitters available, suspenders would have failed.

We either need to add bitters 1.3+ as a runtime dependency of suspenders or add a step that does gem install bitters -v '~>1.3.0' as a step before bitters install in suspenders.

tysongach commented 8 years ago

Aha! That makes sense, @derekprior. Looks like this got changed in 3b7ce010560c965010b9a72f55979720e175362c.

I’ll put up a PR to move Bitters back as a runtime dependency.

ACPK commented 8 years ago

@tute I also hit this issue right after installing suspenders.

I'm using Suspenders v1.41.0 and Bourbon v5.0.0.beta.6.

The error message is:

ActionView::Template::Error (Undefined variable: "$font-stack-system".):
10:     https://github.com/calebthompson/title#usage
tute commented 8 years ago

Thanks @ACPK. This is related with https://github.com/thoughtbot/suspenders/issues/787.