Ruby指南针问题在升级到MACOS Catalina后失败。

huangapple go评论136阅读模式
英文:

Ruby compass issue failed since update to MACOS Catalina

问题

I have an old setup for a website using Gulp to compile the SASS files with gulp-sass. Everything has been working without any issues until I updated my Mac to Catalina.

Now when I run the gulp command to compile the SASS I get the following error:-

/.rvm/rubies/ruby-2.3.0/lib/ruby/2.3.0/fileutils.rb: Read-only file system @ dir_s_mkdir - /c
Run with --trace to see the full backtrace
events.js:174
throw er; // Unhandled 'error' event
^
Error: Compass failed

I have searched many forums and tried solutions such as updating Ruby, installing Gems locally etc and nothing has solved the issue.

Any direction would be great.


"devDependencies": {
"@babel/cli": "7.4.4",
"@babel/core": "7.4.5",
"@babel/plugin-syntax-dynamic-import": "^7.2.0",
"@babel/polyfill": "^7.4.4",
"@babel/preset-env": "7.4.5",
"@babel/register": "7.4.4",
"autoprefixer": "^6.3.6",
"babel-jest": "^24.8.0",
"babel-loader": "^8.0.6",
"babel-minify-webpack-plugin": "^0.3.1",
"bower": "^1.7.9",
"bricks.js": "^1.0.1",
"browser-sync": "^2.26.5",
"compression-webpack-plugin": "^3.0.1",
"concurrently": "^4.1.0",
"cssnano": "^3.4.0",
"eslint-loader": "2.1.2",
"eslint-plugin-flowtype": "^2.50.1",
"eslint-plugin-jest": "^23.2.0",
"gulp": "^3.9.1",
"gulp-babel": "^8.0.0",
"gulp-compass": "^2.1.0",
"gulp-concat-util": "^0.5.4",
"gulp-data": "^1.2.1",
"gulp-eslint": "^5.0.0",
"gulp-imagemin": "^4.1.0",
"gulp-plumber": "^1.2.1",
"gulp-postcss": "^6.0.1",
"gulp-print": "^5.0.0",
"gulp-rename": "^1.2.2",
"gulp-sass": "^3.2.1",
"gulp-sass-lint": "^1.4.0",
"gulp-sourcemaps": "^1.6.0",
"gulp-twig": "^0.5.0",
"gulp-uglify": "^1.5.1",
"gulp-util": "^3.0.7",
"jest": "^24.5.0",
"jest-puppeteer": "4.2.0",
"lodash": "^4.17.15",
"node-sass": "^4.13.0",
"path": "^0.12.7",
"postcss-assets": "^4.0.1",
"postcss-cssnext": "^2.4.0",
"puppeteer": "^1.18.0",
"stylelint": "^9.5.0",
"stylelint-order": "^1.0.0",
"uglifyjs-webpack-plugin": "^2.1.3",
"webpack": "^4.32.2",
"webpack-bundle-analyzer": "^3.3.2",
"webpack-cli": "^3.3.2",
"webpack-concat-plugin": "^3.0.0"
},
"dependencies": {
"babel-preset-jest": "^24.6.0",
"chart.js": "^2.8.0",
"jquery": "3.4.1",
"natives": "^1.1.6"
},

英文:

I have an old setup for a website using Gulp to compile the SASS files with gulp-sass. Everything has been working without any issues until I updated my Mac to Catalina.

Now when I run the gulp command to compile the SASS I get the following error:-

/.rvm/rubies/ruby-2.3.0/lib/ruby/2.3.0/fileutils.rb: Read-only file system @ dir_s_mkdir - /c
Run with --trace to see the full backtrace
events.js:174
throw er; // Unhandled 'error' event
^
Error: Compass failed

I have searched many forums and tried solutions such as updating Ruby, installing Gems locally etc and nothing has solved the issue.

Any direction would be great.

<code>
"devDependencies": {
"@babel/cli": "7.4.4",
"@babel/core": "7.4.5",
"@babel/plugin-syntax-dynamic-import": "^7.2.0",
"@babel/polyfill": "^7.4.4",
"@babel/preset-env": "7.4.5",
"@babel/register": "7.4.4",
"autoprefixer": "^6.3.6",
"babel-jest": "^24.8.0",
"babel-loader": "^8.0.6",
"babel-minify-webpack-plugin": "^0.3.1",
"bower": "^1.7.9",
"bricks.js": "^1.0.1",
"browser-sync": "^2.26.5",
"compression-webpack-plugin": "^3.0.1",
"concurrently": "^4.1.0",
"cssnano": "^3.4.0",
"eslint-loader": "2.1.2",
"eslint-plugin-flowtype": "^2.50.1",
"eslint-plugin-jest": "^23.2.0",
"gulp": "^3.9.1",
"gulp-babel": "^8.0.0",
"gulp-compass": "^2.1.0",
"gulp-concat-util": "^0.5.4",
"gulp-data": "^1.2.1",
"gulp-eslint": "^5.0.0",
"gulp-imagemin": "^4.1.0",
"gulp-plumber": "^1.2.1",
"gulp-postcss": "^6.0.1",
"gulp-print": "^5.0.0",
"gulp-rename": "^1.2.2",
"gulp-sass": "^3.2.1",
"gulp-sass-lint": "^1.4.0",
"gulp-sourcemaps": "^1.6.0",
"gulp-twig": "^0.5.0",
"gulp-uglify": "^1.5.1",
"gulp-util": "^3.0.7",
"jest": "^24.5.0",
"jest-puppeteer": "4.2.0",
"lodash": "^4.17.15",
"node-sass": "^4.13.0",
"path": "^0.12.7",
"postcss-assets": "^4.0.1",
"postcss-cssnext": "^2.4.0",
"puppeteer": "^1.18.0",
"stylelint": "^9.5.0",
"stylelint-order": "^1.0.0",
"uglifyjs-webpack-plugin": "^2.1.3",
"webpack": "^4.32.2",
"webpack-bundle-analyzer": "^3.3.2",
"webpack-cli": "^3.3.2",
"webpack-concat-plugin": "^3.0.0"
},
"dependencies": {
"babel-preset-jest": "^24.6.0",
"chart.js": "^2.8.0",
"jquery": "3.4.1",
"natives": "^1.1.6"
},
</code>

答案1

得分: 2

感谢大家。我的问题是SASS是用Ruby SASS编写的。node-sass是Lib SASS的包装器。这对这个代码库不起作用。

我要关闭这个问题,因为我认为我已经找到了答案。

MacOS Catalina对Ruby进行了两个重大更改。

1 - 系统Ruby版本从2.3升级到2.6,
2 - 系统Ruby gems目录不再可写 - 不适合安装用户gems。

我认为这就是问题的原因。建议重新使用Homebrew安装Ruby。我在这里找到了一些关于如何做到这一点的信息https://gorails.com/setup/osx/10.15-catalina。

英文:

Thank you to everyone. My issue is the SASS is written in Ruby SASS. node-sass is a wrapper for Lib SASS. Which will not work for this code base.

I am closing the question as I believe I have found the answer.

MacOS Catalina made two big changes with Ruby.

1 -The system Ruby version was upgraded from 2.3 to 2.6, and
2 - The system Ruby gems directory is no longer writable — it is not a place for installing user gems.

This is causing the issues I believe. The suggestion is to re-install Ruby with Homebrew. I have located some information on how to do this here https://gorails.com/setup/osx/10.15-catalina

答案2

得分: 0

尝试不使用 Ruby 并明确指定 node-sass

gulpfile.js

var gulp = require('gulp');
var sass = require('gulp-sass');
 
sass.compiler = require('node-sass');
 
gulp.task('test-gulp-sass', done => {
  sass();
  done();
})
$ npm install --save-dev gulp gulp-sass node-sass
$ npx gulp test-gulp-sass
英文:

Try without Ruby and explicitly specify node-sass.

gulpfile.js

var gulp = require(&#39;gulp&#39;);
var sass = require(&#39;gulp-sass&#39;);
 
sass.compiler = require(&#39;node-sass&#39;);
 
gulp.task(&#39;test-gulp-sass&#39;, done =&gt; {
  sass();
  done();
})
$ npm install --save-dev gulp gulp-sass node-sass
$ npx gulp test-gulp-sass

huangapple
  • 本文由 发表于 2020年1月7日 02:19:23
  • 转载请务必保留本文链接:https://go.coder-hub.com/59617014.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定