简体   繁体   中英

Sass::SyntaxError File to import not found or unreadable: style

Ok so I am trying to bring over a bootstrap theme the theme I am trying to bring over is the Raleway theme and I have brought over my style sheets from my application.html.erb file to my application.scss file like this

@import "bootstrap-sprockets";
@import "bootstrap";


@import "style";
@import "bootstrap-social";
@import "animate.min";
@import "owl.carousel";
@import "jquery.snippet";
@import "buttons";

@import "colors/blue";

@import "width-full";
@import "width-boxed";


@import "ionicons.min";
@import "ionicons";

@import "magnific-popup";
@import "font-awesome-sprockets";
@import "font-awesome";

@import "portfolio_helper";
@import "terms";

my gem file reads as this

gem "font-awesome-rails"
  gem 'bootstrap-sass', '~> 3.3.6'
  gem 'font-awesome-sass'

I keep getting this error thrown in my console and I have no idea how to fix it

ActionView::Template::Error (File to import not found or unreadable: style.
Load paths:
  /Users/Development/style_me/app/assets/images
  /Users/Development/style_me/app/assets/javascripts
  /Users/Development/style_me/app/assets/stylesheets
  /Users/Development/style_me/vendor/assets/javascripts
  /Users/Development/style_me/vendor/assets/stylesheets
  /Users/.rvm/gems/ruby-2.2.2/gems/font-awesome-rails-4.6.1.0/app/assets/fonts
  /Users/.rvm/gems/ruby-2.2.2/gems/font-awesome-rails-4.6.1.0/app/assets/stylesheets
  /Users/.rvm/gems/ruby-2.2.2/gems/turbolinks-2.5.3/lib/assets/javascripts
  /Users/.rvm/gems/ruby-2.2.2/gems/jquery-rails-4.1.1/vendor/assets/javascripts
  /Users/.rvm/gems/ruby-2.2.2/gems/coffee-rails-4.1.1/lib/assets/javascripts
  /Users/.rvm/gems/ruby-2.2.2/gems/bootstrap-sass-3.3.6/assets/stylesheets
  /Users/.rvm/gems/ruby-2.2.2/gems/bootstrap-sass-3.3.6/assets/javascripts
  /Users/.rvm/gems/ruby-2.2.2/gems/bootstrap-sass-3.3.6/assets/fonts
  /Users/.rvm/gems/ruby-2.2.2/gems/bootstrap-sass-3.3.6/assets/images
  /Users/.rvm/gems/ruby-2.2.2/gems/font-awesome-sass-4.5.0/assets/stylesheets
  /Users/.rvm/gems/ruby-2.2.2/gems/font-awesome-sass-4.5.0/assets/fonts
  /Users/.rvm/gems/ruby-2.2.2/gems/bootstrap-sass-3.3.6/assets/stylesheets
  /Users/.rvm/gems/ruby-2.2.2/gems/font-awesome-sass-4.5.0/assets/stylesheets):
    2: <html>
    3: <head>
    4:   <title>StyleMe</title>
    5:   <%= stylesheet_link_tag    'application', media: 'all', 'data-turbolinks-track' => true %>
    6:   <%= javascript_include_tag 'application', 'data-turbolinks-track' => true %>
    7:   <%= csrf_meta_tags %>
    8: </head>
  app/assets/stylesheets/application.scss:5
  app/views/layouts/application.html.erb:5:in `_app_views_layouts_application_html_erb___621181811976196065_70285942571180

What exactly is going wrong here? Hope someone can help out

Rather than trying to import static css into a sass file, let the asset pipeline manage the static files. For things that are jquery plugins, you can put them in vendor/assets/stylesheets, for things that you'll want to edit, like style.css, put it in app/assets/stylesheets

So your application.css.scss would look more like

*= require style
*= require bootstrap-social
*= require animate.min
*= require owl.carousel
*= require jquery.snippet
*= require buttons
*= require colors/blue
*= require width-full
*= require width-boxed
*= require ionicons.min
*= require magnific-popup
*= require portfolio_helper
*= require terms


@import "bootstrap-sprockets";
@import "bootstrap";
@import "font-awesome-sprockets";
@import "font-awesome";

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM