简体   繁体   English

kernel_require.rb:无法加载此类文件

[英]kernel_require.rb: cannot load such file

I used gulp to build a html project. 我用gulp建了一个html项目。 For some css staff,I used compass to build. 对于某些CSS员工,我使用指南针进行构建。 I have task as follow 我有以下任务

gulp.task('compass',function(){
    gulp.src('public_html/app/scss/style.scss')
            //.pipe(plumber())
            .pipe(compass({
                config_file: './config.rb',
                css: 'public_html/app/css',
                sass: 'public_html/app/scss',
                require: ['susy']
            }))
            //.pipe(autoprefixer('last 2 versions'))
            .pipe(gulp.dest('public_html/app/css'))
            .pipe(reload({stream:true}));
});

When I build as gulp compass, I have error as 当我做为大口径罗盘时,出现以下错误

LoadError on line ["55"] of ~/.rbenv/versions/2.3.1/lib/ruby/site_ruby/2.3.0/rubygems/core_ext/kernel_require.rb: cannot load such file -- susy
Run with --trace to see the full backtrace


events.js:72
        throw er; // Unhandled 'error' event
              ^
Error: Compass failed

I have that file kernel_require.rb in the exact folder. 我在确切的文件夹中有该文件kernel_require.rb。 I export PATH as 我将PATH导出为

 export PATH=$PATH:~/.rbenv/versions/2.3.1/lib   
export PATH=$PATH:~/.rbenv/versions/2.3.1/lib/ruby/site_ruby/2.3.0/rubygems/core_ext 

But doesn't work. 但是不起作用。 How to solve this error? 如何解决这个错误?

Thanks 谢谢

EDIT: 编辑:

gem list

*** LOCAL GEMS ***

cairo (1.12.8)
chunky_png (1.3.7)
compass-core (1.0.3)
compass-import-once (1.0.5)
execjs (2.7.0)
gettext (3.0.3)
locale (2.1.0)
multi_json (1.12.1)
rb-fsevent (0.9.7)
rdoc (3.9.4)
sass (3.4.22)
susy (2.2.12)
text (1.2.1)
nyan@nyan-Inspiron-7537:~$ susy -v
susy: command not found

You were mis-interpreting the error message: 您误解了错误消息:

LoadError on line ["55"] of ~/.rbenv/versions/2.3.1/lib/ruby/site_ruby/2.3.0/rubygems/core_ext/kernel_require.rb: cannot load such file -- susy

The first part, LoadError , tells you what type of error you were running into; 第一部分, LoadError ,告诉您您正在遇到的错误类型。 the documentation for LoadError states, 有关LoadError状态的文档

Raised when a file required (a Ruby script, extension library, ...) fails to load. 在所需的文件(Ruby脚本,扩展库等)无法加载时引发。

require 'this/file/does/not/exist'

raises the exception: 引发异常:

LoadError: no such file to load -- this/file/does/not/exist

The next part of the error message, on line ["55"] of ~/.rbenv/versions/2.3.1/lib/ruby/site_ruby/2.3.0/rubygems/core_ext/kernel_require.rb: , tells you where the error occurred , that is, some piece of code called another piece of code which called another piece of code, eventually leading to line 55 of the file 'kernel_require.rb', which is part of the infrastructure of RubyGems. 错误消息的下一部分,位于on line ["55"] of ~/.rbenv/versions/2.3.1/lib/ruby/site_ruby/2.3.0/rubygems/core_ext/kernel_require.rb: ,告诉您在哪里错误发生 ,即某个代码段称为另一段代码,而另一段代码又称为另一段代码,最终导致文件“ kernel_require.rb”的第55行,该文件是RubyGems基础结构的一部分。 That line is, ultimately, what triggered the LoadError. 该行最终是触发LoadError的原因。

The final part of the error message, cannot load such file -- susy , gives you details about the problem; 错误消息的最后一部分, cannot load such file -- susy ,为您提供有关该问题的详细信息; specifically, in the case of a LoadError such as this, it tells you what file it tried to (and failed) to load: 'susy'. 具体来说,在诸如此类的LoadError情况下,它会告诉您它尝试加载(失败)的文件:“ susy”。

This all comes down to the fact that you had a directive in your gulp file, require: ['susy'] , but did not have the 'susy' gem installed. 这全都归结为您在gulp文件中有一个指令, require: ['susy'] ,但没有安装'susy'gem。 As you discovered, installing 'susy' (with gem install susy ) resolved the issue. 如您所知,安装“ susy”(使用gem install susy )解决了该问题。

You also note that susy -v on the command line gave an error, but that's a red herring; 您还注意到命令行上的susy -v给出了一个错误,但这是一个红色的鲱鱼。 the susy gem does not install any command line tools, only Ruby code. 可疑的gem不安装任何命令行工具,仅安装Ruby代码。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Ruby错误kernel_require.rb:55:在'require'中:无法加载此类文件— ec2 / amitools / version - Ruby error kernel_require.rb:55:in `require': cannot load such file — ec2/amitools/version kernel_require.rb:15:in `require': 无法加载此类文件 -- 3.0/pg_ext (LoadError) - kernel_require.rb:15:in `require': cannot load such file -- 3.0/pg_ext (LoadError) 软件包安装错误后,kernel_require.rb:55:在'require'中:无法加载此类文件—捆绑程序(LoadError) - after bundle install error kernel_require.rb:55:in `require': cannot load such file — bundler (LoadError) lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:17:in `require': 无法加载此类文件 -- sass - lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:17:in `require': cannot load such file -- sass lib / bootsnap / load_path_cache / core_ext / kernel_require.rb:21:在'require'中:无法加载此类文件— sass(LoadError) - lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21:in `require': cannot load such file — sass (LoadError) ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require': 无法加载此类文件 -- selenium-webdriver (LoadError) - ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require': cannot load such file -- selenium-webdriver (LoadError) C:/Ruby23-x64/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:在'require'中:无法加载此类文件-watir(LoadError) - C:/Ruby23-x64/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require': cannot load such file — watir (LoadError) 错误 `require' /usr/lib/ruby/2.5.0/rubygems/core_ext/kernel_require.rb:59:in `require': 不能 - error `require' /usr/lib/ruby/2.5.0/rubygems/core_ext/kernel_require.rb:59:in `require': cannot guard_test_runner.rb:1:在'require'中:无法加载此类文件 - guard_test_runner.rb:1:in `require': cannot load such file /usr/lib/ruby/1.9.1/rubygems/custom_require.rb:36:在'require'中:无法加载此类文件-cassandra(LoadError) - /usr/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require': cannot load such file — cassandra (LoadError)
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM