Rails 6 and Highcharts - ruby-on-rails

I'm using Rails 6.0.0.rc1 and hoping to implement the lazy_high_charts gem. I installed Highcharts via Yarn but receiving the following error:
ReferenceError: Can't find variable: Highcharts
Which refers to the following line of code:
window.chart = new Highcharts.Chart(options);
I checked to see if Highcharts is present via the DOM, which it is. If i add the <script src="https://code.highcharts.com/highcharts.js"></script> script in my <head> tags it loads fine, which is odd. Any help would be appreciated.
javascript/packs/application.js
require("#rails/ujs").start()
require("turbolinks").start()
require("#rails/activestorage").start()
require("channels")
require('jquery')
require("trix")
require("#rails/actiontext")
import Highcharts from 'highcharts';
import 'bootstrap'
package.json
{
"name": "app_name",
"private": true,
"dependencies": {
"#rails/actioncable": "^6.0.0-alpha",
"#rails/actiontext": "^6.0.0-rc1",
"#rails/activestorage": "^6.0.0-alpha",
"#rails/ujs": "^6.0.0-alpha",
"#rails/webpacker": "^4.0.7",
"bootstrap": "^4.3.1",
"highcharts": "^7.1.2",
"jquery": "^3.4.1",
"popper.js": "^1.15.0",
"trix": "^1.0.0",
"turbolinks": "^5.2.0"
},
"version": "0.1.0",
"devDependencies": {
"webpack-dev-server": "^3.7.1"
}
}
Gemfile
source 'https://rubygems.org'
git_source(:github) { |repo| "https://github.com/#{repo}.git" }
ruby '2.6.3'
gem 'rails', '~> 6.0.0.rc1'
gem 'pg', '>= 0.18', '< 2.0'
gem 'puma', '~> 3.11'
gem 'sass-rails', '~> 5'
gem 'webpacker', '~> 4.0'
gem 'turbolinks', '~> 5'
gem 'jbuilder', '~> 2.5'
gem 'image_processing', '~> 1.2'
gem 'bootsnap', '>= 1.4.2', require: false
gem 'lazy_high_charts'
group :development, :test do
gem 'byebug', platforms: [:mri, :mingw, :x64_mingw]
end
group :development do
gem 'web-console', '>= 3.3.0'
gem 'listen', '>= 3.0.5', '< 3.2'
gem 'spring'
gem 'spring-watcher-listen', '~> 2.0.0'
end
group :test do
gem 'capybara', '>= 2.15'
gem 'selenium-webdriver'
gem 'webdrivers'
end
gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby]

Here is the content of my application.js in Rails 6 with webpacker:
import Highcharts from 'highcharts'
import HighchartsMore from 'highcharts/highcharts-more';
import HighchartsSolidGauge from 'highcharts/modules/solid-gauge';
import HighchartsExporting from 'highcharts/modules/exporting';
window.jQuery = jQuery
window.$ = $
window.Highcharts = Highcharts;
I've added some extensions as an example.

I have found the solution. Adding:
window.Highcharts = Highcharts;
to my application.js worked. My charts are now showing.

In console yarn add highcharts
In app/javascript/packs/application.js for Rails 6 with webpacket:
import Highcharts from 'highcharts';
require("highcharts/modules/data")(Highcharts)
require("highcharts/modules/exporting")(Highcharts)
require("highcharts/modules/offline-exporting")(Highcharts)
require("highcharts/modules/map")(Highcharts)
window.Highcharts = Highcharts;

Related

Rails cannot fetch application-xxxxxx.js webpack bundle - 404 error

I recently updated webpacker, babel, and many other packages on my Rails project so that node-sass would work on the heroku-20 stack, and after enough fiddling webpacker is able to compile and start but when attempting to load any of the pages, Rails attempts to fetch /packs/js/application-44959decf6e2f6f8700f.js when Webpacker shows me it is bundled at /packs/application-17d61f0126c1ef6152fd.js. None of my React JS loads, only the Rails-rendered part shows.
My project is Ruby on Rails 5.2.8 (Ruby 2.7) with #rails/webpacker updated to 5.3.0, Webpack updated to 5.1.0, Node updated to 14.18.1. React version is 16.4.1.
Things I have tried:
npx webpack init
bundle exec rails webpacker:install
copying config files from another app with the same Node/webpack versions and resetting them after getting the same errors
Completely stuck on this, any help is appreciated.
package.json:
{
"name": "xxxxxxxx",
"private": true,
"dependencies": {
"#rails/actioncable": "^6.0.5",
"#rails/webpacker": "5.3.0",
"axios": "^0.17.1",
"babel-loader": "8.1.0",
"#babel/preset-react": "^7.18.6",
"babel-plugin-syntax-dynamic-import": "7.0.0-beta.3",
"babel-plugin-transform-object-rest-spread": "7.0.0-beta.3",
"babel-preset-env": "1.7.0",
"babel-preset-react": "6.24.1",
"compression-webpack-plugin": "^1.1.6",
"css-loader": "^5.1.1",
"file-loader": "^6.1.0",
"immutability-helper": "^2.8.1",
"lodash.groupby": "^4.6.0",
"lodash.snakecase": "^4.1.1",
"nanoid": "^2.1.1",
"sass": "^1.56",
"postcss-loader": "^7.0.1",
"prop-types": "^15.6.0",
"react": "^16.4.1",
"react-animate-height": "^2.0.7",
"react-copy-to-clipboard": "^5.0.1",
"react-datepicker": "^2.8.0",
"react-dom": "^16.2.0",
"react-geosuggest": "^2.9.0",
"react-inlinesvg": "^1.1.7",
"react-select": "^2.4.2",
"react-tagsinput": "^3.19.0",
"react-transition-group": "^2.2.1",
"reactstrap": "^6.5.0",
"sass-loader": "^12.6.0",
"uglifyjs-webpack-plugin": "^1.1.8",
"webpack": "^5.1.0",
"webpack-cli": "^4.10.0",
"webpacker-react": "^0.3.2"
},
"devDependencies": {
"babel-plugin-transform-class-properties": "6.24.1",
"#webpack-cli/serve": "^2.0.0",
"eslint": "4.19.1",
"eslint-config-airbnb": "^17.1.0",
"eslint-plugin-import": "^2.14.0",
"eslint-plugin-jsx-a11y": "^6.1.2",
"eslint-plugin-react": "^7.11.1",
"webpack-dev-server": "~3"
},
"scripts": {
"eslint": "./node_modules/.bin/eslint --ext .js,.jsx ./app/javascript"
},
"engines": {
"node": "14.18.x"
}
}
webpack.config.js
const path = require("path");
const isProduction = process.env.NODE_ENV == "production";
const config = {
module: {
rules: [
{
test: /\.s[ac]ss$/i,
use: [
// Creates `style` nodes from JS strings
"style-loader",
// Translates CSS into CommonJS
"css-loader",
// Compiles Sass to CSS
"sass-loader",
],
},
],
},
entry: "./src/index.js",
output: {
path: path.resolve(__dirname, "dist"),
},
devServer: {
open: true,
host: "localhost",
port: 3035
},
};
module.exports = () => {
if (isProduction) {
config.mode = "production";
} else {
config.mode = "development";
}
return config;
};
config/webpacker.yml
# Note: You must restart bin/webpack-dev-server for changes to take effect
default: &default
source_path: app/javascript
source_entry_path: packs
public_root_path: public
public_output_path: packs
cache_path: tmp/cache/webpacker
check_yarn_integrity: false
webpack_compile_output: true
# Additional paths webpack should lookup modules
# ['app/assets', 'engine/foo/app/assets']
resolved_paths: []
# Reload manifest.json on all requests so we reload latest compiled packs
cache_manifest: false
# Extract and emit a css file
extract_css: false
static_assets_extensions:
- .jpg
- .jpeg
- .png
- .gif
- .tiff
- .ico
- .svg
- .eot
- .otf
- .ttf
- .woff
- .woff2
extensions:
- .jsx
- .mjs
- .js
- .sass
- .scss
- .css
- .module.sass
- .module.scss
- .module.css
- .png
- .svg
- .gif
- .jpeg
- .jpg
development:
<<: *default
compile: true
# Verifies that correct packages and versions are installed by inspecting package.json, yarn.lock, and node_modules
check_yarn_integrity: true
# Reference: https://webpack.js.org/configuration/dev-server/
dev_server:
https: false
host: localhost
port: 3035
public: localhost:3035
hmr: false
# Inline should be set to true if using HMR
inline: true
overlay: true
compress: true
disable_host_check: true
use_local_ip: false
quiet: false
pretty: false
headers:
'Access-Control-Allow-Origin': '*'
watch_options:
ignored: '**/node_modules/**'
test:
<<: *default
compile: true
# Compile test packs to a separate directory
public_output_path: packs-test
production:
<<: *default
# Production depends on precompilation of packs prior to booting for performance.
compile: false
# Extract and emit a css file
extract_css: true
# Cache manifest.json for performance
cache_manifest: true
.babelrc
{
"presets": [
"#babel/preset-env",
"#babel/preset-react"
],
"plugins": [
"syntax-dynamic-import",
"transform-object-rest-spread",
"#babel/plugin-proposal-object-rest-spread",
[
"transform-class-properties",
{
"spec": true
}
]
]
}
Gemfile
source 'https://rubygems.org'
ruby '~> 2.7.6'
git_source(:github) do |repo_name|
repo_name = "#{repo_name}/#{repo_name}" unless repo_name.include?("/")
"https://github.com/#{repo_name}.git"
end
# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '~> 5.2.8'
# Use postgresql as the database for Active Record
gem 'pg', '~> 1.2.3'
# Use Puma as the app server
gem 'puma', '~> 3.7'
# Use SCSS for stylesheets
gem 'sass-rails', '~> 5.0'
# Use Uglifier as compressor for JavaScript assets
gem 'uglifier', '>= 1.3.0'
# See https://github.com/rails/execjs#readme for more supported runtimes
# gem 'therubyracer', platforms: :ruby
gem 'letter_opener', '>= 1.8.1'
gem 'coffee-rails', '~> 4.2'
# Turbolinks makes navigating your web application faster. Read more: https://github.com/turbolinks/turbolinks
gem 'turbolinks', '~> 5'
# Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder
gem 'jbuilder', '~> 2.5'
# Use Redis adapter to run Action Cable in production
gem 'redis', '~> 3.0'
# Use ActiveModel has_secure_password
# gem 'bcrypt', '~> 3.1.7'
# Use Capistrano for deployment
# gem 'capistrano-rails', group: :development
gem 'activerecord-import'
gem 'active_model_serializers'
gem 'geocoder'
gem 'searchkick', '~> 5.0.3'
gem 'devise'
gem 'addressable'
gem 'parallel'
gem 'oj'
gem 'webpacker', '~> 4.3.0'
gem 'webpacker-react', '~> 0.3.2'
gem 'bootstrap', '~> 4.0.0'
gem 'kaminari'
gem 'paranoia', '~> 2.2'
gem 'cocoon'
gem 'jquery-rails'
gem 'select2-rails'
# gem 'select2-rails-latest' # update select2 to make dropdowns case-insensitive
gem 'attribute_normalizer'
gem 'aws-sdk-s3', '~> 1'
gem 'aasm'
gem 'bunny'
gem 'kt-paperclip', '~> 6.4.2'
gem 'font-awesome-rails'
gem 'lograge'
gem 'rollbar'
gem 'httparty'
gem 'restforce'
gem 'sidekiq'
gem 'postmark-rails'
gem "mimemagic", path: 'vendor/gems/mimemagic-0.3.2'
gem 'paper_trail'
gem 'pry'
gem 'elasticsearch'
group :test do
gem 'timecop'
gem 'climate_control'
end
group :development, :test do
# Call 'byebug' anywhere in the code to stop execution and get a debugger console
gem 'byebug', platforms: [:mri, :mingw, :x64_mingw]
gem 'rspec-rails'
gem 'foreman'
gem "factory_bot_rails"
gem 'faker'
gem 'capybara'
gem 'database_cleaner-active_record'
gem 'selenium-webdriver', '~> 3.14'
gem 'capybara-screenshot'
gem 'rubocop', '~> 1.29', require: false
gem 'figaro'
gem 'listen', '>= 3.0.5', '< 3.2'
gem 'pry-rails'
end
group :development do
# Access an IRB console on exception pages or by using <%= console %> anywhere in the code.
gem 'web-console', '>= 3.3.0'
# Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring
gem 'spring'
gem 'spring-watcher-listen', '~> 2.0.0'
gem 'rspec_junit_formatter'
end
# Windows does not include zoneinfo files, so bundle the tzinfo-data gem
gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby]
Procfile.dev
web: bin/rails server -p 3002
webpack: yarn run webpack serve --mode=development
worker: bundle exec sidekiq -C config/sidekiq.yml
es: bin/elasticsearch-8.2.3/bin/elasticsearch
Solved by switching to bin/webpack-dev-server instead of yarn run webpack serve in Procfile.dev. I then had to copy some intricate configuration files in config/webpack/ from another project with the same setup, then configure all of the loaders.

SassC::SyntaxError: Error: 2rem/add isn't a valid CSS value

I'm getting this error while compile the assets in production environment. I had been searching it for 2 days and tried solution to fixed it. But haven't got the exact solution. Could you please help me how can we fixed it?
I'm using ruby version - 2.6.3
rails - 6.2.3
And I'm also using webpacker.
Errors
application.css compiled file for development environment
I checked this error and it has been occured in the node_modules/bootstarp/scss/mixins/_form.scss file.
package.json
{
"name": "xxx",
"version": "2.0.0",
"dependencies": {
"#rails/webpacker": "4.3.0",
"#yaireo/tagify": "^3.6.2",
"axios": "^0.21.0",
"bootstrap": "4.5.3",
"bootstrap-datepicker": "^1.9.0",
"bootstrap-vue": "^2.19.0",
"chart.js": "^2.9.3",
"clipboard": "^2.0.4",
"code-prettify-google": "^1.0.1",
"coffee-loader": "1.0.1",
"coffeescript": "^2.5.1",
"datatables.net": "^1.10.20",
"datatables.net-bs4": "^1.10.20",
"datatables.net-responsive-bs4": "^2.2.3",
"dropzone": "^5.5.1",
"jquery": "^3.4.1",
"jquery-timepicker": "^1.3.3",
"jquery-validation": "^1.19.1",
"lib.sass": "^1.0.4",
"magnific-popup": "^1.1.0",
"nouislider": "^14.1.1",
"quill": "^1.3.7",
"sass": "^1.32.11",
"select2": "^4.0.11",
"simplebar": "^5.0.7",
"slick-carousel": "^1.8.1",
"summernote": "^0.8.18",
"sweetalert2": "^9.7.2",
"tinymce": "^5.4.1",
"toastr": "^2.1.4",
"turbolinks": "^5.2.0",
"vue": "^2.6.12",
"vue-loading-overlay": "^3.4.2"
},
"devDependencies": {
"gulp": "^4.0.2",
"gulp-babel": "^8.0.0",
"gulp-file-include": "^2.1.0",
"gulp-html-beautify": "^1.0.1",
"gulp-minifier": "^3.4.0",
"gulp-rename": "^2.0.0",
"gulp-sass": "^4.0.2",
"gulp-sourcemaps": "^2.6.5",
"gulp-strip-comments": "^2.5.2",
"gulp-uglify": "^3.0.2",
"gulp-watch": "^5.0.1",
"resolve-url-loader": "^3.1.3",
"uglify-js": "^3.7.7",
"webpack-dev-server": "^3.11.2"
}
}
And my Gemfile
source 'https://rubygems.org' git_source(:github) do |repo_name| repo_name = "#{repo_name}/#{repo_name}" unless repo_name.include?("/") "https://github.com/#{repo_name}.git" end
ruby '2.6.3'
# Bundle edge Rails instead: gem 'rails', github: 'rails/rails' gem 'rails'
# gem 'bundler', '1.17.1'
# Use sqlite3 as the database for Active Record
# gem 'sqlite3'
# Use SCSS for stylesheets gem 'sassc' gem 'sass-rails', '>= 6'
# gem 'sass', '~> 3.7', '>= 3.7.4'
# Use Uglifier as compressor for JavaScript assets
# gem 'uglifier', '>= 1.3.0'
# Use CoffeeScript for .js.coffee assets and views gem 'coffee-rails'
# See https://github.com/sstephenson/execjs#readme for more supported runtimes
# gem 'therubyracer', platforms: :ruby
# Use jquery as the JavaScript library gem 'jquery-rails'
gem 'webpacker', '~> 4.x'
# Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring
# gem 'spring', group: :development
# Use ActiveModel has_secure_password
# gem 'bcrypt', '~> 3.1.7'
# Use unicorn as the app server gem 'unicorn'
# Use Capistrano for deployment
# gem 'capistrano-rails', group: :development gem 'activeadmin'
# Use debugger
# gem 'debugger', group: [:development, :test] gem 'devise' gem 'execjs' gem 'pg' gem 'therubyracer'
gem 'bootstrap-wysihtml5-rails'
# gem 'cardconnect', '~> 2.3.0' gem 'sparkpost_rails'
gem 'bigdecimal', '1.4.2' gem 'gaffe' gem 'rqrcode' gem 'signalwire' gem 'kaminari'
## fore remote true with file field gem 'remotipart', '~> 1.4', '>= 1.4.4'
gem 'rest-client' gem 'whenever', require: false
# gem 'openssl' gem 'puma'
## for logs gem 'silencer'
## login another user gem 'pretender'
## cors orign gem 'rack-cors', :require => 'rack/cors'
group :development do gem 'byebug' gem 'rails_layout' gem "reline", "0.2.2" end
config/webpack/environment.js
const { environment } = require('#rails/webpacker')
const customConfig = require('./custom')
const coffee = require('./loaders/coffee')
environment.loaders.append('coffee', coffee)
environment.config.merge(customConfig)
const webpack = require('webpack')
environment.plugins.append('Provide', new webpack.ProvidePlugin({
$: 'jquery',
jQuery: 'jquery',
Popper: ['popper.js', 'default'],
// datetimepicker: 'eonasdan-bootstrap-datetimepicker/src/js/bootstrap-datetimepicker.js'
}))
// Get the actual sass-loader config
const sassLoader = environment.loaders.get('sass')
const sassLoaderConfig = sassLoader.use.find(function(element) {
return element.loader == 'sass-loader'
})
// Use Dart-implementation of Sass (default is node-sass)
const options = sassLoaderConfig.options
options.implementation = require('sass')
module.exports = environment

Rails 5.2.1 -> 5.2.2 upgrade on Heroku, deploy crashes with "Could not detect rake tasks"; Solidus 2.7

after upgrading and bundle install, I get this on deploy
Could not detect rake tasks
remote: ! ensure you can run `$ bundle exec rake -P` against your app
remote: ! and using the production group of your Gemfile.
remote: ! rake aborted!
remote: ! LoadError: cannot load such file -- polyamorous/activerecord_5.2.2_ruby_2/join_association
gemfile OLD
source 'https://rubygems.org'
git_source(:github) { |repo| "https://github.com/#{repo}.git" }
ruby '2.2.5'
gem 'rails', '~> 5.2.1'
gem 'mysql2'
gem 'puma', '~> 3.11'
gem 'sass-rails', '~> 5.0'
gem 'uglifier', '>= 1.3.0'
gem 'coffee-rails', '~> 4.2'
gem 'turbolinks', '~> 5'
gem 'jbuilder', '~> 2.5'
gem 'bootsnap', '>= 1.1.0', require: false
gem 'nondestructive_migrations'
gem 'acts_as_paranoid', '~> 0.6.0'
gem 'sendgrid-ruby'
gem 'activerecord-session_store'
group :development, :test do
gem 'byebug', platforms: [:mri, :mingw, :x64_mingw]
end
group :development do
gem 'web-console', '>= 3.3.0'
gem 'listen', '>= 3.0.5', '< 3.2'
# gem 'spring'
# gem 'spring-watcher-listen', '~> 2.0.0'
end
group :test do
# Adds support for Capybara system testing and selenium driver
gem 'capybara', '>= 2.15'
gem 'selenium-webdriver'
gem 'chromedriver-helper'
end
gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby]
gem 'solidus', '2.7.0'
gem 'solidus_auth_devise'
gem 'solidus_print_invoice' , github: 'solidusio-contrib/solidus_print_invoice'
gem 'solidus_gateway'
gemfile NEW (causes crash)
source 'https://rubygems.org'
git_source(:github) { |repo| "https://github.com/#{repo}.git" }
ruby '2.2.5'
gem 'rails', '~> 5.2.2'
gem 'mysql2'
gem 'puma', '~> 3.11'
gem 'sass-rails', '~> 5.0'
gem 'uglifier', '>= 1.3.0'
gem 'coffee-rails', '~> 4.2'
gem 'turbolinks', '~> 5'
gem 'jbuilder', '~> 2.5'
gem 'bootsnap', '>= 1.1.0', require: false
gem 'nondestructive_migrations'
gem 'acts_as_paranoid', '~> 0.6.0'
gem 'sendgrid-ruby'
gem 'activerecord-session_store'
group :development, :test do
gem 'byebug', platforms: [:mri, :mingw, :x64_mingw]
end
group :development do
gem 'web-console', '>= 3.3.0'
gem 'listen', '>= 3.0.5', '< 3.2'
# gem 'spring'
# gem 'spring-watcher-listen', '~> 2.0.0'
end
group :test do
# Adds support for Capybara system testing and selenium driver
gem 'capybara', '>= 2.15'
gem 'selenium-webdriver'
gem 'chromedriver-helper'
end
gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby]
gem 'solidus', '2.7.0'
gem 'solidus_auth_devise'
gem 'solidus_print_invoice' , github: 'solidusio-contrib/solidus_print_invoice'
gem 'solidus_gateway'
this is fixed by bumping Solidus 2.7.0 to Solidus 2.7.1

My questions is about a file created in the command line not appearing in the project directory

I am currently building a ruby-on-rails app and attempted to create a migration through the command line by using:
rails g migration create_users username:string email:string password_digest:string --no-test-framework
The command line says that it successfully creates the migration and gives me the file name, which is db/migrate/20180907182240_create_users.rb. The problem is, it isn't showing up in my project directory on Atom. I restarted Atom and that didn't seem to do the trick.
I've also tried checking my git status and it comes up blank. There are no new files to commit, which leads me to believe that they may not be getting created to begin with.
If someone could help me find the files and/or if someone knows what is going wrong, I'd really appreciate the help! Thank you.
Here is my Gemfile:
source 'https://rubygems.org'
git_source(:github) { |repo| "https://github.com/#{repo}.git" }
ruby '2.5.1'
gem 'rails', '~> 5.2.1'
gem 'sqlite3'
gem 'puma', '~> 3.11'
gem 'sass-rails', '~> 5.0'
gem 'uglifier', '>= 1.3.0'
gem 'coffee-rails', '~> 4.2'
gem 'turbolinks', '~> 5'
gem 'jbuilder', '~> 2.5'
gem 'bcrypt', '~> 3.1.7'
gem 'bootsnap', '>= 1.1.0', require: false
group :development, :test do
gem 'byebug', platforms: [:mri, :mingw, :x64_mingw]
end
group :development do
gem 'web-console', '>= 3.3.0'
gem 'listen', '>= 3.0.5', '< 3.2'
gem 'spring'
gem 'spring-watcher-listen', '~> 2.0.0'
end
group :test do
gem 'capybara', '>= 2.15'
gem 'selenium-webdriver'
gem 'chromedriver-helper'
end
gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby]

How to disable comment generation in the css files when using sass and rails?

I am using a standard rails 4.1.6 'rails new' gemset, with added bootstrap-sass
Here is the Gemfile (comments excluded) for the reference:
gem 'rails', '4.1.6'
gem 'pg'
gem 'sass-rails', '~> 4.0.3'
gem 'uglifier', '>= 1.3.0'
gem 'coffee-rails', '~> 4.0.0'
gem 'therubyracer', platforms: :ruby
gem 'jquery-rails'
gem 'turbolinks'
gem 'jbuilder', '~> 2.0'
gem 'sdoc', '~> 0.4.0', group: :doc
gem 'spring', group: :development
gem 'minitest-reporters', '1.0.6'
gem 'mini_backtrace', '0.1.3'
gem 'slim', '2.1.0'
gem 'slim-rails', '2.1.5'
gem 'bootstrap-sass', '3.2.0.2'
The app/assets/stylesheets/custom.css.scss contains:
#import "bootstrap-sprockets";
#import "bootstrap";
/* my css stuff*/
.
.
.
When I open up the custom.css though for example firefox's view page source I see
something like:
/* line 142, /home/user_name/.rvm/gems/ruby-2.1.3#rails4_1_6/gems/bootstrap-sass-3.2.0.2/assets/stylesheets/bootstrap/_scaffolding.scss */
.sr-only-focusable:active, .sr-only-focusable:focus {
position: static;
width: auto;
height: auto;
margin: 0;
overflow: visible;
clip: auto;
}
My question is how do I disable the comments from generating?
Place config.sass.line_comments = false into application.rb file.
More info: https://github.com/rails/sass-rails 'example' section and http://sass-lang.com/documentation/file.SASS_REFERENCE.html#options

Resources