thoughtbot / bourbon

A Lightweight Sass Tool Set
https://www.bourbon.io/
MIT License
9.09k stars 878 forks source link

File to import not found or unreadable: bourbon … again #906

Closed morgler closed 8 years ago

morgler commented 8 years ago

I followed the guide for installation on rails (rails 4.2.6 in my case). But when I try to load a page, I get:

File to import not found or unreadable: bourbon

Turning @import "bourbon" into @import "bourbon.css" makes the error go away, but after that it loads no CSS.

I'm building a vanilla gem and have bourbon in my gemspec. The application.css has been renamed to application.scss and includes no sprockets directives:

@import "bourbon";
@import "bitters";
@import "neat"; 

Bourbon version is 5.0.0.beta.5

tysongach commented 8 years ago

@morgler Can you share your Gemfile, Gemfile.lock and application.scss files? Or is this code open-source somewhere I can see?

morgler commented 8 years ago

Gemfile is empty and defers to gemspec, which is:

$:.push File.expand_path("../lib", __FILE__)

# Maintain your gem's version:
require "rucksack/version"

# Describe your gem and declare its dependencies:
Gem::Specification.new do |s|
  s.name        = "rucksack"
  s.version     = Rucksack::VERSION
  s.authors     = ["***"]
  s.email       = ["***"]
  s.homepage    = "***"
  s.summary     = "***"
  s.description = "***"
  s.license     = "MIT"

  s.files = Dir["{app,config,db,lib}/**/*", "MIT-LICENSE", "Rakefile", "README.rdoc"]
  s.test_files = Dir["test/**/*"]

  s.add_dependency "rails", "~> 4.2.6"

  ## Views
  s.add_dependency "bitters"
  s.add_dependency "bourbon"
  s.add_dependency "haml-rails"
  s.add_dependency "neat"
  s.add_dependency "sass-rails"

  s.add_development_dependency "pg"
  s.add_development_dependency "rspec-rails"
  s.add_development_dependency "guard-rspec"
end

application.scss is as stated above (renamed it to application.sass to try this alternative, but that didn't change a thing):

@import "bourbon"
@import "bitters"
@import "neat"

Gemfile.lock is:

PATH
  remote: .
  specs:
    rucksack (0.0.1)
      bitters
      bourbon
      haml-rails
      neat
      rails (~> 4.2.6)
      sass-rails

GEM
  remote: https://rubygems.org/
  specs:
    actionmailer (4.2.6)
      actionpack (= 4.2.6)
      actionview (= 4.2.6)
      activejob (= 4.2.6)
      mail (~> 2.5, >= 2.5.4)
      rails-dom-testing (~> 1.0, >= 1.0.5)
    actionpack (4.2.6)
      actionview (= 4.2.6)
      activesupport (= 4.2.6)
      rack (~> 1.6)
      rack-test (~> 0.6.2)
      rails-dom-testing (~> 1.0, >= 1.0.5)
      rails-html-sanitizer (~> 1.0, >= 1.0.2)
    actionview (4.2.6)
      activesupport (= 4.2.6)
      builder (~> 3.1)
      erubis (~> 2.7.0)
      rails-dom-testing (~> 1.0, >= 1.0.5)
      rails-html-sanitizer (~> 1.0, >= 1.0.2)
    activejob (4.2.6)
      activesupport (= 4.2.6)
      globalid (>= 0.3.0)
    activemodel (4.2.6)
      activesupport (= 4.2.6)
      builder (~> 3.1)
    activerecord (4.2.6)
      activemodel (= 4.2.6)
      activesupport (= 4.2.6)
      arel (~> 6.0)
    activesupport (4.2.6)
      i18n (~> 0.7)
      json (~> 1.7, >= 1.7.7)
      minitest (~> 5.1)
      thread_safe (~> 0.3, >= 0.3.4)
      tzinfo (~> 1.1)
    arel (6.0.3)
    bitters (1.3.1)
      bourbon (>= 5.0.0.beta.3)
      sass (~> 3.4)
      thor (~> 0.19)
    bourbon (5.0.0.beta.5)
      sass (~> 3.4)
      thor (~> 0.19)
    builder (3.2.2)
    coderay (1.1.1)
    concurrent-ruby (1.0.2)
    diff-lcs (1.2.5)
    erubis (2.7.0)
    ffi (1.9.10)
    formatador (0.2.5)
    globalid (0.3.6)
      activesupport (>= 4.1.0)
    guard (2.14.0)
      formatador (>= 0.2.4)
      listen (>= 2.7, < 4.0)
      lumberjack (~> 1.0)
      nenv (~> 0.1)
      notiffany (~> 0.0)
      pry (>= 0.9.12)
      shellany (~> 0.0)
      thor (>= 0.18.1)
    guard-compat (1.2.1)
    guard-rspec (4.7.2)
      guard (~> 2.1)
      guard-compat (~> 1.1)
      rspec (>= 2.99.0, < 4.0)
    haml (4.0.7)
      tilt
    haml-rails (0.9.0)
      actionpack (>= 4.0.1)
      activesupport (>= 4.0.1)
      haml (>= 4.0.6, < 5.0)
      html2haml (>= 1.0.1)
      railties (>= 4.0.1)
    html2haml (2.0.0)
      erubis (~> 2.7.0)
      haml (~> 4.0.0)
      nokogiri (~> 1.6.0)
      ruby_parser (~> 3.5)
    i18n (0.7.0)
    json (1.8.3)
    listen (3.1.5)
      rb-fsevent (~> 0.9, >= 0.9.4)
      rb-inotify (~> 0.9, >= 0.9.7)
      ruby_dep (~> 1.2)
    loofah (2.0.3)
      nokogiri (>= 1.5.9)
    lumberjack (1.0.10)
    mail (2.6.4)
      mime-types (>= 1.16, < 4)
    method_source (0.8.2)
    mime-types (3.1)
      mime-types-data (~> 3.2015)
    mime-types-data (3.2016.0521)
    mini_portile2 (2.0.0)
    minitest (5.9.0)
    neat (1.7.4)
      bourbon (>= 4.0)
      sass (>= 3.3)
    nenv (0.3.0)
    nokogiri (1.6.7.2)
      mini_portile2 (~> 2.0.0.rc2)
    notiffany (0.1.0)
      nenv (~> 0.1)
      shellany (~> 0.0)
    pg (0.18.4)
    pry (0.10.3)
      coderay (~> 1.1.0)
      method_source (~> 0.8.1)
      slop (~> 3.4)
    rack (1.6.4)
    rack-test (0.6.3)
      rack (>= 1.0)
    rails (4.2.6)
      actionmailer (= 4.2.6)
      actionpack (= 4.2.6)
      actionview (= 4.2.6)
      activejob (= 4.2.6)
      activemodel (= 4.2.6)
      activerecord (= 4.2.6)
      activesupport (= 4.2.6)
      bundler (>= 1.3.0, < 2.0)
      railties (= 4.2.6)
      sprockets-rails
    rails-deprecated_sanitizer (1.0.3)
      activesupport (>= 4.2.0.alpha)
    rails-dom-testing (1.0.7)
      activesupport (>= 4.2.0.beta, < 5.0)
      nokogiri (~> 1.6.0)
      rails-deprecated_sanitizer (>= 1.0.1)
    rails-html-sanitizer (1.0.3)
      loofah (~> 2.0)
    railties (4.2.6)
      actionpack (= 4.2.6)
      activesupport (= 4.2.6)
      rake (>= 0.8.7)
      thor (>= 0.18.1, < 2.0)
    rake (11.1.2)
    rb-fsevent (0.9.7)
    rb-inotify (0.9.7)
      ffi (>= 0.5.0)
    rspec (3.4.0)
      rspec-core (~> 3.4.0)
      rspec-expectations (~> 3.4.0)
      rspec-mocks (~> 3.4.0)
    rspec-core (3.4.4)
      rspec-support (~> 3.4.0)
    rspec-expectations (3.4.0)
      diff-lcs (>= 1.2.0, < 2.0)
      rspec-support (~> 3.4.0)
    rspec-mocks (3.4.1)
      diff-lcs (>= 1.2.0, < 2.0)
      rspec-support (~> 3.4.0)
    rspec-rails (3.4.2)
      actionpack (>= 3.0, < 4.3)
      activesupport (>= 3.0, < 4.3)
      railties (>= 3.0, < 4.3)
      rspec-core (~> 3.4.0)
      rspec-expectations (~> 3.4.0)
      rspec-mocks (~> 3.4.0)
      rspec-support (~> 3.4.0)
    rspec-support (3.4.1)
    ruby_dep (1.3.1)
    ruby_parser (3.8.2)
      sexp_processor (~> 4.1)
    sass (3.4.22)
    sass-rails (5.0.4)
      railties (>= 4.0.0, < 5.0)
      sass (~> 3.1)
      sprockets (>= 2.8, < 4.0)
      sprockets-rails (>= 2.0, < 4.0)
      tilt (>= 1.1, < 3)
    sexp_processor (4.7.0)
    shellany (0.0.1)
    slop (3.6.0)
    sprockets (3.6.0)
      concurrent-ruby (~> 1.0)
      rack (> 1, < 3)
    sprockets-rails (3.0.4)
      actionpack (>= 4.0)
      activesupport (>= 4.0)
      sprockets (>= 3.0.0)
    thor (0.19.1)
    thread_safe (0.3.5)
    tilt (2.0.5)
    tzinfo (1.2.2)
      thread_safe (~> 0.1)

PLATFORMS
  ruby

DEPENDENCIES
  guard-rspec
  pg
  rspec-rails
  rucksack!

BUNDLED WITH
   1.12.5
tysongach commented 8 years ago

@morgler That all seems fine. Just to be sure: after you bundle install’d, you restarted your server?

Have you tried locking your gemspec dependency to a specific version?

s.add_dependency "bourbon", "~> 5.0.0.beta.5"
morgler commented 8 years ago

Btw: thanks for your lightning fast response (3min from question to reply!).

Yes, ran bundle install on the gem app and on the host app that uses it. Also restarted the server of the host app. Also tried all these steps after locking the version to 5.0.0.beta.5. I still get the error.

morgler commented 8 years ago

Could it be similar to this with simple_form? After all I'm using bourbon in an engine.

The same error also occurred a few days ago, when I tried to use the Locomotive CMS engine. Only that I tried to use bourbon directly in my host app then.

tysongach commented 8 years ago

Ah, intereststing. I didn’t realize this was an engine; I don’t have a lot of experience with that.

Take a look through issue #42. It may be that Bourbon is fine, but in the context of an engine, sass-rails doesn’t look at the path you need it to, and you’ll have to explicitly define that.

morgler commented 8 years ago

Thanks! It somehow works now (without the hack) with sass-rails 5.0.4 – sadly I don't know what made it work (definitely did NOT do an update for the sass-rails gem). But somehow your link to the sass-rails problem helped fix it for me :).

tysongach commented 8 years ago

@morgler Well, glad you got it working!