rails 4.1.7
ruby-2.1.4
Using bootstrap-sass 3.3.1.0 gem
When I try to push to Heroku I get the following error:
$ git push heroku master
...
-----> Preparing app for Rails asset pipeline
Running: rake assets:precompile
I, [2014-11-21T01:06:34.863128 #1054] INFO -- : Writing /tmp/build_5e094815d056adf463e7c75e987d5e63/public/assets/glyphicons-halflings-regular-3ba17edd9d971727ac7482518167c417.eot
I, [2014-11-21T01:06:34.865429 #1054] INFO -- : Writing /tmp/build_5e094815d056adf463e7c75e987d5e63/public/assets/glyphicons-halflings-regular-9fdfa71474063341410181a0580f8cc9.svg
I, [2014-11-21T01:06:34.867462 #1054] INFO -- : Writing /tmp/build_5e094815d056adf463e7c75e987d5e63/public/assets/glyphicons-halflings-regular-b1be6b5ab502863bf4997057c9e81c47.ttf
I, [2014-11-21T01:06:34.869377 #1054] INFO -- : Writing /tmp/build_5e094815d056adf463e7c75e987d5e63/public/assets/glyphicons-halflings-regular-d1bdcb334cbe33c43cd1644d34c214bc.woff
I, [2014-11-21T01:06:39.656791 #1054] INFO -- : Writing /tmp/build_5e094815d056adf463e7c75e987d5e63/public/assets/application-16641e09fe68375d82a616882c87cd48.js
rake aborted!
ExecJS::ProgramError: /bootstrap-theme.css.map:1:14: Unknown word
...
On my config/application.rb file I have:
require File.expand_path('../boot', __FILE__)
require 'rails/all'
Bundler.require(*Rails.groups)
module Evolution
class Application < Rails::Application
config.assets.initialize_on_precompile = false
end
end
Any idea how to fix this error?
UPDATE #1
If I search for the word "bootstrap-theme" in the App directory, I find:
4 matches across 2 files:
/Users/andreucasadella/rails_projects/evolution/app/assets/stylesheets/bootstrap-theme.css:
468 box-shadow: inset 0 1px 3px rgba(0, 0, 0, .05), 0 1px 0 rgba(255, 255, 255, .1);
469 }
470: /*# sourceMappingURL=bootstrap-theme.css.map */
And
/Users/andreucasadella/rails_projects/evolution/app/assets/stylesheets/bootstrap-theme.css.map:
1: {"version":3,"sources":["less/theme.less","less/mixins/vendor-prefixes.less","bootstrap-theme.css","less/mixins/gradients.less","less/mixins/reset-filter.less"],"names":...
I understand that the "Unknown word" is on the file /bootstrap-theme.css.map and on line 1:14.
How do I identify space 14?
I have not been able to find an answer, therefore I decided to delete both map files:
- bootstrap-theme.css.map
- bootstrap.css.map
I will not be able live-edit my preprocessor source files in the DevTools Sources panel, but at least I can go on. Hope to find a better answer soon.
what are the .map files used for in Bootstrap 3.1?
Related
I try to use the vue-laravel-file-manager in my project. After I use yarn run serve, I get the error below.
https://github.com/alexusmai/vue-laravel-file-manager/
ERROR Failed to compile with 1 errors 7:25:34 PM
error in ./node_modules/laravel-file-manager/src/FileManager.vue?vue&type=style&index=0&lang=scss&
Module build failed (from ./node_modules/sass-loader/lib/loader.js):
$embed-padding: (math.div(100, 16) * 9);
^
Invalid CSS after "...-padding: (math": expected expression (e.g. 1px, bold), was ".div(100, 16) * 9);"
in /node_modules/plyr/src/sass/types/video.scss (line 27, column 22)
# ./node_modules/vue-style-loader??ref--8-oneOf-1-0!./node_modules/css-loader??ref--8-oneOf-1-1!./node_modules/vue-loader/lib/loaders/stylePostLoader.js!./node_modules/postcss-loader/src??ref--8-oneOf-1-2!./node_modules/sass-loader/lib/loader.js??ref--8-oneOf-1-3!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./node_modules/laravel-file-manager/src/FileManager.vue?vue&type=style&index=0&lang=scss& 4:14-363 15:3-20:5 16:22-371
# ./node_modules/laravel-file-manager/src/FileManager.vue?vue&type=style&index=0&lang=scss&
# ./node_modules/laravel-file-manager/src/FileManager.vue
# ./node_modules/laravel-file-manager/src/init.js
# ./src/main.js
# multi (webpack)-dev-server/client?http://10.0.2.15:8080/sockjs-node (webpack)/hot/dev-server.js ./src/main.js
How do I solve this?
I had a similar error, replacing "node-sass" with "sass" fixed it for me.
This error probably occurs due to the depreciation of node-sass.
I'm trying to parse a Unity YAML scene file with Ruby and the Psych gem. The Unity file is supposedly a subset of YAML. Each Unity object is a separate YAML document. Here's a sample:
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!29 &1
OcclusionCullingSettings:
m_ObjectHideFlags: 0
serializedVersion: 2
m_OcclusionBakeSettings:
smallestOccluder: 5
smallestHole: 0.25
backfaceThreshold: 100
m_SceneGUID: 00000000000000000000000000000000
m_OcclusionCullingData: {fileID: 0}
--- !u!104 &2
RenderSettings:
m_ObjectHideFlags: 0
serializedVersion: 9
m_Fog: 0
m_FogColor: {r: 0.5, g: 0.5, b: 0.5, a: 1}
m_FogMode: 3
m_FogDensity: 0.01
I'm parsing it with:
require 'psych'
scene = Psych.load_stream(File.read "./Scene.unity")
Which results in this error message:
Psych::SyntaxError ((<unknown>): found undefined tag handle while parsing a node at line 13 column 5)
After some investigation it appears that Psych is expecting each YAML document to have it's own TAG directive, while Unity's YAML parser must consider the directives at the beginning of the file to be global. So...
Question 1: Who's right? Does the scope of a TAG directive extend from declaration to the end of the file, or only to the end of the document (the next occurrance of ---)?
I'd like to be able to parse the file without having to modify it. This leads to...
Ouestion 2: Is there a clean way to do this? Say a Psych option I've missed or a way to pass a block to File.read so that I can add TAG directives on the fly?
I noticed that sass build fails on color substraction after update to laravel-mix#4.0.12
My code in app.scss
.footer {
background-color: #fefefe - #a0a0a0
}
My webpack.mix.js
const mix = require('laravel-mix');
const resourcesAssets = 'resources/assets/';
const dest = 'public/assets/';
mix
.sass(`${resourcesAssets}scss/app.scss`, `${dest}css`);
On laravel-mix#1.7.2 running npm run prod works properly, but now I got next error
ERROR Failed to compile with 2 errors22:16:34
error in ./resources/sass/app.scss
Module build failed (from ./node_modules/css-loader/index.js):
ModuleBuildError: Module build failed (from ./node_modules/sass-loader/lib/loader.js):
undefined
^
Undefined operation "#fefefe - #a0a0a0".
background-color: #fefefe - #a0a0a0
^^^^^^^^^^^^^^^^^
stdin 2:23 root stylesheet
in C:\xampp\htdocs\laravel-test-mix\resources\sass\app.scss (line 2, column 23)
at runLoaders (C:\xampp\htdocs\laravel-test-mix\node_modules\webpack\lib\NormalModule.js:301:20)
at C:\xampp\htdocs\laravel-test-mix\node_modules\loader-runner\lib\LoaderRunner.js:364:11
at C:\xampp\htdocs\laravel-test-mix\node_modules\loader-runner\lib\LoaderRunner.js:230:18
at context.callback (C:\xampp\htdocs\laravel-test-mix\node_modules\loader-runner\lib\LoaderRunner.js:111:13)
at render (C:\xampp\htdocs\laravel-test-mix\node_modules\sass-loader\lib\loader.js:52:13)
at Function.$2 (C:\xampp\htdocs\laravel-test-mix\node_modules\sass\sass.dart.js:25378:48)
at vB.$2 (C:\xampp\htdocs\laravel-test-mix\node_modules\sass\sass.dart.js:16223:16)
at tz.ve (C:\xampp\htdocs\laravel-test-mix\node_modules\sass\sass.dart.js:9275:42)
at tz.vd (C:\xampp\htdocs\laravel-test-mix\node_modules\sass\sass.dart.js:9277:32)
at ic.uo (C:\xampp\htdocs\laravel-test-mix\node_modules\sass\sass.dart.js:8583:46)
at t6.$0 (C:\xampp\htdocs\laravel-test-mix\node_modules\sass\sass.dart.js:8728:7)
at Object.eu (C:\xampp\htdocs\laravel-test-mix\node_modules\sass\sass.dart.js:1569:80)
at aj.bd (C:\xampp\htdocs\laravel-test-mix\node_modules\sass\sass.dart.js:8646:3)
at is.bd (C:\xampp\htdocs\laravel-test-mix\node_modules\sass\sass.dart.js:8576:25)
at is.cF (C:\xampp\htdocs\laravel-test-mix\node_modules\sass\sass.dart.js:8563:6)
at oy.cF (C:\xampp\htdocs\laravel-test-mix\node_modules\sass\sass.dart.js:8350:35)
at Object.o (C:\xampp\htdocs\laravel-test-mix\node_modules\sass\sass.dart.js:1442:19)
at C:\xampp\htdocs\laravel-test-mix\node_modules\sass\sass.dart.js:5284:51
at w0.a (C:\xampp\htdocs\laravel-test-mix\node_modules\sass\sass.dart.js:1453:71)
at w0.$2 (C:\xampp\htdocs\laravel-test-mix\node_modules\sass\sass.dart.js:8365:23)
at uC.$2 (C:\xampp\htdocs\laravel-test-mix\node_modules\sass\sass.dart.js:8360:25)
at tz.ve (C:\xampp\htdocs\laravel-test-mix\node_modules\sass\sass.dart.js:9275:42)
at tz.vd (C:\xampp\htdocs\laravel-test-mix\node_modules\sass\sass.dart.js:9277:32)
at ic.uo (C:\xampp\htdocs\laravel-test-mix\node_modules\sass\sass.dart.js:8583:46)
at t6.$0 (C:\xampp\htdocs\laravel-test-mix\node_modules\sass\sass.dart.js:8728:7)
at Object.eu (C:\xampp\htdocs\laravel-test-mix\node_modules\sass\sass.dart.js:1569:80)
at aj.bd (C:\xampp\htdocs\laravel-test-mix\node_modules\sass\sass.dart.js:8646:3)
at is.bd (C:\xampp\htdocs\laravel-test-mix\node_modules\sass\sass.dart.js:8576:25)
at is.cF (C:\xampp\htdocs\laravel-test-mix\node_modules\sass\sass.dart.js:8563:6)
at oy.cF (C:\xampp\htdocs\laravel-test-mix\node_modules\sass\sass.dart.js:8350:35)
at Object.o (C:\xampp\htdocs\laravel-test-mix\node_modules\sass\sass.dart.js:1442:19)
at C:\xampp\htdocs\laravel-test-mix\node_modules\sass\sass.dart.js:5835:52
at w0.a (C:\xampp\htdocs\laravel-test-mix\node_modules\sass\sass.dart.js:1453:71)
at w0.$2 (C:\xampp\htdocs\laravel-test-mix\node_modules\sass\sass.dart.js:8365:23)
at uC.$2 (C:\xampp\htdocs\laravel-test-mix\node_modules\sass\sass.dart.js:8360:25)
at tz.ve (C:\xampp\htdocs\laravel-test-mix\node_modules\sass\sass.dart.js:9275:42)
How can I fix this problem without setting up previously calculated value?
Color arithmetic was deprecated in dart-sass 4.
They recommend you (in a harsh way) to use color functions.
I rather like this color functions visual summary. You are probably looking for darken(color,%) in your code.
When I deploy my RoR (4.2.6) application to ElasticBeanstalk, it appears that the initialization process is getting run four times. This is impacting the way I rely on a singleton instance of a job Scheduler object (using Rufus Scheduler).
In a couple of initializer files and in application.rb, I added a few log statements:
Here:
# /config/initializers/scheduler.rb
require 'rufus-scheduler'
::Rufus_lockfile = "/tmp/.rufus-scheduler.lock"
::Scheduler = Rufus::Scheduler.singleton(
:lockfile => Rufus_lockfile
)
Rails.logger.info "1: started Scheduler #{Scheduler.object_id}"
And here:
# /config/initializers/cookies_serializer.rb
Rails.logger.info "2: some other initializer"
And here:
# /config/application.rb
require File.expand_path('../boot', __FILE__)
require 'rails/all'
Bundler.require(*Rails.groups)
module MyApp
class Application < Rails::Application
...
config.after_initialize do
Rails.logger.info "3: after app is initialized"
end
end
end
After I run eb deploy and it completes, this is what I see at the top of app/log/production.log:
I, [2016-05-31T10:31:08.756302 #18753] INFO -- : 2: some other initializer
I, [2016-05-31T10:31:08.757252 #18753] INFO -- : 1: started Scheduler 47235057343600
I, [2016-05-31T10:31:08.896353 #18753] INFO -- : 3: after app is initialized
I, [2016-05-31T10:31:23.669517 #18817] INFO -- : 2: some other initializer
I, [2016-05-31T10:31:23.670380 #18817] INFO -- : 1: started Scheduler 46989489069800
I, [2016-05-31T10:31:23.806154 #18817] INFO -- : 3: after app is initialized
D, [2016-05-31T10:31:23.969103 #18817] DEBUG -- : ^[[1m^[[36mActiveRecord::SchemaMigration Load (1.3ms)^[[0m ^[[1mSELECT "schema_migrations".* FROM "schema_migrations"^[[0m
I, [2016-05-31T10:31:33.108449 #18897] INFO -- : 2: some other initializer
I, [2016-05-31T10:31:33.109513 #18897] INFO -- : 1: started Scheduler 47156425207060
I, [2016-05-31T10:31:33.116500 #18901] INFO -- : 2: some other initializer
I, [2016-05-31T10:31:33.117374 #18901] INFO -- : 1: started Scheduler 47156425216940
I, [2016-05-31T10:31:33.790266 #18901] INFO -- : 3: after app is initialized
I, [2016-05-31T10:31:33.844517 #18897] INFO -- : 3: after app is initialized
So it looks like the initializer files and even the code in my after_initializer block are getting run four times... and I can't figure out why.
Question got asked on rufus-scheduler issue system, answered there: https://github.com/jmettraux/rufus-scheduler/issues/208
I have a file _content-sidebar.scss at this location:
C:\Users\user\Downloads\livemath\sass\layout\_content-sidebar.scss
Which contains the following code:
#import "//variables-site/structure";
.content-area {
float: left;
margin: 0 (-$size__site-sidebar) 0 0;
width: $size__site-main;
}
And I have another file called _structure.scss at this location:
C:\Users\user\Downloads\livemath\sass\variables-site\_structure.scss
Which contains the following code:
$size__site-main: 960px;
$size__site-sidebar: 25%;
And when I'm trying to compile the scss file using the command line I'm getting this error:
Change detected to: sass/layout/_content-sidebar.scss
error sass/layout/_content-sidebar.scss (Line 5: Undefined variable: "$size__site-sidebar".)
You used double slashes for resources, that are not located at external locations:
C:\Users\user\Downloads\livemath\sass\layout\_content-sidebar.scss
and
C:\Users\user\Downloads\livemath\sass\variables-site\_structure.scss
You could write it with a dot #import "./variables-site/structure"; if it's in the root or maybe #import "../variables-site/structure"; to get into the other folder!
I tested the double slashes for internal resources in my project and it spitted out the same error (that the first occurrence of a variable is undefined)!
Normally it would state that the file couldn't be imported, but unfortunately this is not the case when using double slashes...