Sass::SyntaxError in Static_pages#contact - ruby-on-rails

I'm following Hartl's tutorial (up to chapter 5 at this point - http://ruby.railstutorial.org/chapters/filling-in-the-layout#code-signup_button) and I feel as though I have followed his instructions but I keep getting this error message when I try and view my sample_app homepage online: Sass::SyntaxError in Static_pages#contact followed by File to import not found or unreadable: bootstrap. I have just added the bootstrap-sass gem to my Gemfile, have created the file app/assets/stylesheets/custom.css.scss and added Bootstrap CSS to that file (#import "bootstrap";). I've looked at a few similar threads searching for a solution and have tried a few options but nothing has worked. Any thoughts? Help would be greatly appreciated...

Pjumble, the point is you don't have to copy exactly what is shown in listings 5.6 and 5.7.
The three dots at the beggining mean you have to keep the previous contents of the file while adding the lines that follow.
So you start up with listing 5.5, then add some lines from listing 5.6, then add the rest of the lines from 5.7.

Related

Fezvrasta material design for bootstrap: how integrate with rails (SASS)

I'm trying to add Fezvrasta material design for bootstrap to my rails app but unfortunately without success.
Can anyone give me some help on how to do this?
Both rails assets and this SO answer didn't work.
On the first I got the following error message:
File to import not found or unreadable: bootstrap-material-design.
And on the second one this one:
'It's not clear which file to import'
EDIT
so for the first link I did this
gemfile
source 'https://rails-assets.org' do
gem 'rails-assets-bootstrap-material-design'
end
application.css.scss
I tried both
#import 'bootstrap-material-design';
and
*= require bootstrap-material-design
on the second one I run the command
bower install bootstrap-material-design
and after on my application.css.scss I did
#import '../../../vendor/bower_components/bootstrap-material-design/sass/bootstrap-material-design';
Any tips on how to solve this?
Thanks

Application.css.scss causing issue with rails 4

So i've been learning ruby on rails and i decided to add some style to my new posts page on a myrubyblog app. Everything was working. After a few days i decided to import scss from the posts.scss file into the application.css.scss and well i get this error
RuntimeError in Home#index
Showing c:/Sites/myrubyblog/app/views/layouts/application.html.erb where line #5 raised:
Current ExecJS runtime does't support ES5. Please install node.js.
(in c:/Sites/myrubyblog/app/assets/stylesheets/application.css.scss)
Extracted source (around line #0):
After removing my application.css.scss file, the pages were working. Upon removing the actual scss code and leaving the application.css.scss the page began to give problems again. I decided to leave the application.css.scss file deleted. This for some reason allows for the styles i set in it to show up even though the stylesheet itself has been deleted.
Installing Node.js seemed to have worked. I just had to reboot.... twice...
Thx guys i guess.

Getting bootstrap-wysihtml5-rails to use font-awesome instead of bootstrap glyphicons

After searching on the Internet for an hour trying to find a simple, how-to write up of how to substitute bootstrap glphicons for font-awesome when using the bootstrap-wysihtml5-rails gem, I came up empty handed. I did find a variety of issues with loading the fonts.
Does anyone have a current write up on how to do this?
Alternatively, perhaps you can help with getting my rails sass app to use both font-awesome and bootstrap icons in parallel so that bootstrap-wysihtml5-rails works. Right now, I am getting an error: "RoutingError (No route matches [GET] "/fonts/bootstrap/glyphicons-halflings-regular.woff")" (localhost - with or without precompiled assets) which many folks have struggled with. I tried the many suggestions here, here, here and others to no avail.
Any and all help is appreciated!

Can't find spree folder in views in rails 4 app. How do i customize it?

I just integrated spree and zurb foundation on a rails 4 app and spree did not add any .html.erb files in views so I am not able to figure out how to customize the default layout of spree.
harriss-air:montrealfixed harrisrobin$ spree install --auto-accept
gemfile spree
gemfile spree_gateway
gemfile spree_auth_devise
run bundle install from "."
identical config/initializers/spree.rb
identical config/spree.yml
remove public/index.html
append public/robots.txt
exist app/assets/javascripts/store
exist app/assets/javascripts/admin
exist app/assets/stylesheets/store
exist app/assets/stylesheets/admin
exist app/assets/images/store
exist app/assets/images/admin
identical app/assets/javascripts/store/all.js
identical app/assets/stylesheets/store/all.css
identical app/assets/javascripts/admin/all.js
identical app/assets/stylesheets/admin/all.css
exist app/overrides
append db/seeds.rb
copying migrations
creating database
running migrations
loading seed data
loading sample data
insert config/routes.rb
**************************************************
We added the following line to your application's config/routes.rb file:
mount Spree::Core::Engine, :at => '/'
**************************************************
Spree has been installed successfully. You're all ready to go!
Everything goes smoothly when i install it.. but my app > views file is still the same, no spree folder. I can only see application.html.erb in layouts. So the question is.. how do i customize spree on rails 4 ? more specifically, how do i do the latter using zurb-foundation.
Spree provides a helpful customization guide located here:
http://guides.spreecommerce.com/developer/view.html
The views are being loaded from the Spree gem. You can type bundle show spree_frontend in order to see where the files are located on your filesystem. It should give you the list of files shown here (depending on your version):
https://github.com/spree/spree/tree/v2.1.2/frontend
Adding zurb-foundation in to Spree is going to be an invasive change. You may want to start with some smaller changes first to get the hang of customizing Spree.
Ok so to find the loaded views you have to use "bundle show spree" as gmacdougall suggested.
Can anyone please point me towards the right direction for integrating the foundation framework on a rails spree project ?
Thank you !
EDIT : while i did not find anything for foundation, i figured out that overriding the views so that it works with the foundation framework can be a lot of work and might not be a good idea for a noob like myself, so i found this
https://github.com/jdutil/spree_bootstrap
This replaces the spree front end with twitter bootstrap. Would have preferred Zurb Foundation but this is good!

Bootstrap-sass gem not loading

Ran into an interesting problem and wondered if anyone else has as well.
I'm doing a Rails tutorial and part of the setup is installing the bootstrap-sass gem. The tutorial recommends for installing bootstrap, to rename the existing application.css file to application.css.scss, removing all the contents in that file, and then adding #import "bootstrap";.
I downloaded the tutorial's source code and ran it on my local machine and it works just fine.
However, when I implemented this in my code, no css stylings appeared. No errors appeared in the logs, either, though I noticed there was no GET request for the css occurring. I even went into the source code, clicked the css file and it appeared empty, while all the bootstrap javascript files were not empty.
After a while, I decided to implement bootstrap in the way that several other tutorials had done - I put the application.css.scss file back to its normal application.css file with all of the default contents that appear there, and then created a new file that I called styles.css.scss and put in the #import "bootstrap"; there and it loads it just fine.
I contacted a mentor of the program teaching the tutorial. He downloaded my source code from my github repo and saw exactly what I saw, though his project was working just fine, and no other students of the program had yet reported an issue doing it the way that the tutorial (and the bootstrap-sass docs) suggested.
Has anyone else ever run into this issue?

Resources