无法解析 RubyMine 中的文件 [英] Cannot resolve file in RubyMine

查看:45
本文介绍了无法解析 RubyMine 中的文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试将 RubyMine (v6.3.3) 用于我的 Rails 项目.在我根据它的说明添加 bootstrap-sass gem 之后在

然而,RubyMine 似乎忽略了 Rails.application.config.asset.paths 设置,只检查默认资产路径.这就是出现红色波浪下划线的原因.

这是 RubyMine 的未解决问题:http://youtrack.jetbrains.com/issue/RUBY-15585

解决方法是在本地 gem 安装中创建符号链接(供应商/资产 -> 资产).它将关闭 RubyMine.

2.1.0/gems/bootstrap-sass-3.2.0.0% ls -l vendor共 8 个lrwxr-xr-x 1 gogao 员工 9 月 7 日 11:28 资产 ->../资产

更多细节可以在 GitHub issue https://github.com/twbs/bootstrap-sass/中找到问题/684(谢谢@Ri4a)

I am trying to use RubyMine (v6.3.3) for my rails project. After I added bootstrap-sass gem according its instruction in https://github.com/twbs/bootstrap-sass, RubyMine complains about the line I added in application.js file. However the file is actually in the scope of the projects' external libraries.

The project itself works as expected, just this RubyMine warning annoyed me.

Did I miss any step in configuration?

解决方案

It is confirmed to be a RubyMine issue.

bootstrap-sass gem has added assets to the assets path, and that's why the project works. https://github.com/twbs/bootstrap-sass/blob/master/lib/bootstrap-sass/engine.rb#L6

However RubyMine appeares to ignore the Rails.application.config.asset.paths setting and only inspect the default asset paths. That's why the red wavy underline appears.

Here is the open issue for RubyMine: http://youtrack.jetbrains.com/issue/RUBY-15585

The workaround to this is to create a symbol link (vendor/assets -> assets) in your local gem installation. It will shut RubyMine up.

2.1.0/gems/bootstrap-sass-3.2.0.0% ls -l vendor
total 8
lrwxr-xr-x  1 gogao  staff  9 Aug  7 11:28 assets -> ../assets

More details can be found in the GitHub issue https://github.com/twbs/bootstrap-sass/issues/684 (Thank you, @Ri4a)

这篇关于无法解析 RubyMine 中的文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆