Windows 7 上的指南针轮询错误

发布于 2024-11-17 09:55:53 字数 2781 浏览 3 评论 0原文

我正在尝试在本地处理 PHP 应用程序,该应用程序是从我和我的合作伙伴使用的 Git 存储库克隆的。

他使用 Mac,到目前为止我一直在虚拟 Ubuntu Linux 环境中开发该应用程序。两种环境都能够使用具有相同文件结构和文件的 Compass 轮询。

在 Windows 7 上,我从 Cygwin 运行 Compass 命令,这是我用来从应用程序的根目录 (C:/wamp/www/application) 进行 Compass 轮询的命令:

compass watch --trace src/ Application/ApplicationBundle/Resources/compass/

当我对 .scss 文件进行更改时,我收到以下错误:

ArgumentError on line 716 of /usr/lib/ruby/1.8/pathname.rb:不同的前缀:“/ /cygdrivecwampwwwlimelightsrclimelightlimelightbundleresourcescompasssrcpartials _object.scss”和“/cygdrive/c/wamp/www/limelight/src/limelight/limelightbundle/ 资源/指南针/src” /usr/lib/ruby/gems/1.8/gems/fssm-0.2.7/lib/fssm/path.rb:81:in 'split_path' /usr/lib/ruby/gems/1.8/gems/fssm-0.2.7/lib/fssm/path.rb:69:在“run_callback”中 /usr/lib/ruby/gems/1.8/gems/fssm-0.2.7/lib/fssm/path.rb:55:在'callback_action'中 /usr/lib/ruby/gems/1.8/gems/fssm-0.2.7/lib/fssm/path.rb:35:在“更新”中 /usr/lib/ruby/gems/1.8/gems/fssm-0.2.7/lib/fssm/state/directory.rb:39:在“修改”中 /usr/lib/ruby/gems/1.8/gems/fssm-0.2.7/lib/fssm/state/directory.rb:37:在“每个”中 /usr/lib/ruby/gems/1.8/gems/fssm-0.2.7/lib/fssm/state/directory.rb:37:在“修改”中 /usr/lib/ruby/gems/1.8/gems/fssm-0.2.7/lib/fssm/state/directory.rb:18:在“刷新”中 /usr/lib/ruby/gems/1.8/gems/fssm-0.2.7/lib/fssm/backends/polling.rb:17:在“运行”中 /usr/lib/ruby/gems/1.8/gems/fssm-0.2.7/lib/fssm/backends/polling.rb:17:在“每个”中 /usr/lib/ruby/gems/1.8/gems/fssm-0.2.7/lib/fssm/backends/polling.rb:17:在“运行”中 /usr/lib/ruby/gems/1.8/gems/fssm-0.2.7/lib/fssm/backends/polling.rb:15:在“循环”中 /usr/lib/ruby/gems/1.8/gems/fssm-0.2.7/lib/fssm/backends/polling.rb:15:在“运行”中 /usr/lib/ruby/gems/1.8/gems/fssm-0.2.7/lib/fssm/monitor.rb:26:在“运行”中 /usr/lib/ruby/gems/1.8/gems/fssm-0.2.7/lib/fssm.rb:20:在“监视器”中 /usr/lib/ruby/gems/1.8/gems/compass-0.11.1/lib/compass/commands/watch_project.rb:86:在“执行”中 /usr/lib/ruby/gems/1.8/gems/compass-0.11.1/lib/compass/commands/base.rb:18:在“执行”中 /usr/lib/ruby/gems/1.8/gems/compass-0.11.1/lib/compass/commands/project_base.rb:19:在“执行”中 /usr/lib/ruby/gems/1.8/gems/compass-0.11.1/lib/compass/exec/sub_command_ui.rb:43:在“执行!” /usr/lib/ruby/gems/1.8/gems/compass-0.11.1/lib/compass/exec/sub_command_ui.rb:15:在“运行!” /usr/lib/ruby/gems/1.8/gems/compass-0.11.1/bin/compass:25 /usr/lib/ruby/gems/1.8/gems/compass-0.11.1/bin/compass:39:在“调用”中 /usr/lib/ruby/gems/1.8/gems/compass-0.11.1/bin/compass:39 /usr/bin/compass:19:在“加载”中 /usr/bin/compass:19

我通过搜索找到的是,它可能与Windows将其驱动器名称大写有关,尽管返回的路径中缺少斜杠使得我认为问题可能出在其他地方。

有谁知道为什么我可能会在 Windows 中收到此错误,但在其他平台上却不会?

注意:我找到了一个涉及安装 ruby​​ 的解决方法 (和指南针)通过 Windows 的命令提示符而不是 Cygwin,目前应该可以正常工作。不过,如果有人有想法,我仍然很好奇问题可能是什么。

I am attempting to work locally on a PHP application which I cloned from the Git repository my partner and I use.

He uses a Mac, and until now I have been working on the app in a virtual Ubuntu Linux environment. Both environments have been able to use Compass polling with the same file structure and files.

On Windows 7, I run Compass commands from Cygwin, and this is the command I use to have Compass poll from the root directory of the app (C:/wamp/www/application):

compass watch --trace src/Application/ApplicationBundle/Resources/compass/

When I then make a change to a .scss file, I receive the following error:

ArgumentError on line 716 of /usr/lib/ruby/1.8/pathname.rb: different prefix: "/
/cygdrivecwampwwwlimelightsrclimelightlimelightbundleresourcescompasssrcpartials
_object.scss" and "/cygdrive/c/wamp/www/limelight/src/limelight/limelightbundle/
resources/compass/src"
/usr/lib/ruby/gems/1.8/gems/fssm-0.2.7/lib/fssm/path.rb:81:in 'split_path'
/usr/lib/ruby/gems/1.8/gems/fssm-0.2.7/lib/fssm/path.rb:69:in 'run_callback'
/usr/lib/ruby/gems/1.8/gems/fssm-0.2.7/lib/fssm/path.rb:55:in 'callback_action'
/usr/lib/ruby/gems/1.8/gems/fssm-0.2.7/lib/fssm/path.rb:35:in 'update'
/usr/lib/ruby/gems/1.8/gems/fssm-0.2.7/lib/fssm/state/directory.rb:39:in 'modified'
/usr/lib/ruby/gems/1.8/gems/fssm-0.2.7/lib/fssm/state/directory.rb:37:in 'each'
/usr/lib/ruby/gems/1.8/gems/fssm-0.2.7/lib/fssm/state/directory.rb:37:in 'modified'
/usr/lib/ruby/gems/1.8/gems/fssm-0.2.7/lib/fssm/state/directory.rb:18:in 'refresh'
/usr/lib/ruby/gems/1.8/gems/fssm-0.2.7/lib/fssm/backends/polling.rb:17:in 'run'
/usr/lib/ruby/gems/1.8/gems/fssm-0.2.7/lib/fssm/backends/polling.rb:17:in 'each'
/usr/lib/ruby/gems/1.8/gems/fssm-0.2.7/lib/fssm/backends/polling.rb:17:in 'run'
/usr/lib/ruby/gems/1.8/gems/fssm-0.2.7/lib/fssm/backends/polling.rb:15:in 'loop'
/usr/lib/ruby/gems/1.8/gems/fssm-0.2.7/lib/fssm/backends/polling.rb:15:in 'run'
/usr/lib/ruby/gems/1.8/gems/fssm-0.2.7/lib/fssm/monitor.rb:26:in 'run'
/usr/lib/ruby/gems/1.8/gems/fssm-0.2.7/lib/fssm.rb:20:in 'monitor'
/usr/lib/ruby/gems/1.8/gems/compass-0.11.1/lib/compass/commands/watch_project.rb:86:in 'perform'
/usr/lib/ruby/gems/1.8/gems/compass-0.11.1/lib/compass/commands/base.rb:18:in 'execute'
/usr/lib/ruby/gems/1.8/gems/compass-0.11.1/lib/compass/commands/project_base.rb:19:in 'execute'
/usr/lib/ruby/gems/1.8/gems/compass-0.11.1/lib/compass/exec/sub_command_ui.rb:43:in 'perform!'
/usr/lib/ruby/gems/1.8/gems/compass-0.11.1/lib/compass/exec/sub_command_ui.rb:15:in 'run!'
/usr/lib/ruby/gems/1.8/gems/compass-0.11.1/bin/compass:25
/usr/lib/ruby/gems/1.8/gems/compass-0.11.1/bin/compass:39:in 'call'
/usr/lib/ruby/gems/1.8/gems/compass-0.11.1/bin/compass:39
/usr/bin/compass:19:in 'load'
/usr/bin/compass:19

All I've been able to find through searching is that it may have something to do with the fact that Windows capitalizes its drive names, although the lack of slashes in the returned path makes me think the problem may be elsewhere.

Does anyone know why I might receive this error in Windows, but not other platforms?

NOTE: I have found a work-around involving installing ruby (and compass) through Windows' command prompt rather than Cygwin, and that should work fine for now. Still, if anyone has ideas, I'm still curious as to what the problem could be.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(5

如果没有 2024-11-24 09:55:53

根据此提交,这是由指南针依赖引起的问题称为 FSSM。它用于监视指南针中的文件变化。 此评论中描述了解决方法。

FSSM 似乎检测到 ruby​​ 正在 Windows 机器内运行,并以 Windows 的方式处理路径 (C:\blabla)。注释掉文件 /lib/fssm/pathname.rb 的第 26 行使 compass watch 按预期工作。您还可以添加

unless path[0, 1] == File::SEPARATOR

到第 26 行末尾以使其正常工作。

According to this commit, this is a problem caused by a compass dependency called FSSM. It is used to monitor file changes in compass. A workaround is described in this comment.

It seems that FSSM detects that ruby is running inside a Windows box, and treats paths in the Windows' way (C:\blabla). Commenting out the line 26 of the file <fssm_gem_path>/lib/fssm/pathname.rb makes compass watch work as expected. You can also add

unless path[0, 1] == File::SEPARATOR

to the end of line 26 to make it work.

巷子口的你 2024-11-24 09:55:53

我想我只需提供更多信息来帮助人们找到 pathname.rb 文件。

在 cygwin 提示符下输入:

gem env

这(毫不奇怪)会显示有关 Ruby Gems 安装的大量信息。查找指定安装目录的行。我的是:

/usr/lib/ruby/gems/1.8

现在在 Windows 资源管理器中导航到此位置,但将“usr”替换为 cygwin 安装目录。因此,上述路径变为:

C:\cygwin\lib\ruby\gems\1.8

进入此位置后,向下钻取,直到遇到 fssm gem 目录。

在此 [fssm] 目录中,进入:

/lib/fssm/

...您应该在那里找到 pathname.rb 文件。

按照上面的方法编辑一下,一切就OK了。我希望这有帮助。

I thought I'd just provide a little more info to help people find the pathname.rb file.

On the cygwin prompt type:

gem env

This (unsurprisingly) brings up a load of info about your Ruby Gems installtion. Look for the line which specifies the INSTALLATION DIRECTORY. Mine was:

/usr/lib/ruby/gems/1.8

Now in Windows Explorer navigate to this location but substitute "usr" for your cygwin installation directory. Therefore the above path becomes:

C:\cygwin\lib\ruby\gems\1.8

Once in this location drill down until you come across the fssm gem directory.

Within this [fssm] directory go into:

/lib/fssm/

...and there you should find the pathname.rb file.

Edit it as above and all is well. I hope this helps.

谁与争疯 2024-11-24 09:55:53

我遇到了同样的错误,但设置略有不同。我的项目文件夹位于网络驱动器上(本地安装了 ruby​​ 和 sass/compass),每次我对 .scss 文件进行更改时,指南针手表都会崩溃,并出现与 OP 类似的错误。我通过映射网络驱动器而不是直接通过网络访问它解决了这个问题(右键单击“我的电脑”并选择映射网络驱动器,这样我就可以访问位于 A: 的远程驱动器)。

现在,我不再执行“compass watch //SERVERNAME/My_Project”(我使用的是 Git Bash),而是执行“compass watch a/My_Project”,然后指南针停止崩溃。

希望对其他人有帮助。

I was running into this same error with a slightly different setup. My project folder was on a network drive (ruby and sass/compass installed locally), and every time I made a change to a .scss file compass watch would crash with similar errors to the OP. I solved the issue by mapping my network drive instead of accessing it directly via the network (right clicked on My Computer and choose map network drive so I could access my remote drive at A:).

Now, instead of doing 'compass watch //SERVERNAME/My_Project' (I'm using Git Bash), I do 'compass watch a/My_Project' and compass stopped crashing.

Hope that helps someone else.

秋凉 2024-11-24 09:55:53

使用 Cygwin,重新安装 Compass 开发版本(例如 0.13+)。适用于我的 Compass 0.13.alpha.4 (Markab)
为此:

gem uninstall compass
gem install compass --pre --no-rdoc --no-ri

Using Cygwin, re install a compass dev release (such as 0.13+). Works for me with Compass 0.13.alpha.4 (Markab)
To do so:

gem uninstall compass
gem install compass --pre --no-rdoc --no-ri
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文