简体   繁体   English

试图运行罗盘创建 - 获取Gemfile未找到错误

[英]Trying to run compass create - getting Gemfile Not Found Error

I am trying to get started with Compass/SASS with Foundation. 我正在努力开始使用Compass / SASS和Foundation。 I have installed ruby 2.0.0 using rvm and installed compass as well. 我已经使用rvm安装了ruby 2.0.0并安装了指南针。 I am using centOS. 我正在使用centOS。

However, when I try to run the following command: 但是,当我尝试运行以下命令时:

# compass create emj --javascripts-dir "js" --images-dir "img"

I am getting the following error: 我收到以下错误:

/usr/local/rvm/gems/ruby-2.0.0-p247@global/gems/bundler-1.3.5/lib/bundler/definition.rb:16:in `build': /Gemfile not found (Bundler::GemfileNotFound)
    from /usr/local/rvm/gems/ruby-2.0.0-p247@global/gems/bundler-1.3.5/lib/bundler.rb:148:in `definition'
    from /usr/local/rvm/gems/ruby-2.0.0-p247@global/gems/bundler-1.3.5/lib/bundler.rb:116:in `setup'
    from /usr/local/rvm/gems/ruby-2.0.0-p247@global/gems/bundler-1.3.5/lib/bundler.rb:132:in `require'
    from /usr/local/rvm/gems/ruby-2.0.0-p247/gems/compass-0.12.2/bin/compass:26:in `<top (required)>'
    from /usr/local/rvm/gems/ruby-2.0.0-p247/bin/compass:23:in `load'
    from /usr/local/rvm/gems/ruby-2.0.0-p247/bin/compass:23:in `<main>'
    from /usr/local/rvm/gems/ruby-2.0.0-p247/bin/ruby_executable_hooks:15:in `eval'
    from /usr/local/rvm/gems/ruby-2.0.0-p247/bin/ruby_executable_hooks:15:in `<main>'

I have tried searching for some solutions but I have hit a wall. 我试过寻找一些解决方案,但我已经碰壁了。

Any suggestions or help is much appreciated. 任何建议或帮助深表感谢。 Thank you. 谢谢。

In the past installing compass was a breeze, but I've been having the same problem over the past couple of days. 在过去安装指南针是轻而易举的,但在过去的几天里我遇到了同样的问题。 At first I thought it was just an OSX Mavericks issue, but I've had the same issue on 3 different OS now. 起初我以为这只是一个OSX Mavericks问题,但我现在在3个不同的操作系统上遇到了同样的问题。

This question seems very similar to yours, however the answer didn't work for me. 这个问题似乎与您的问题非常相似,但是答案对我而言不起作用。

In the past I don't recall ever seeing an @global directory, so perhaps something has changed about the way RVM installs? 在过去,我不记得曾经看过@global目录,所以RVM的安装方式可能有所改变吗? I did some hunting, found this , and tried: 我做了一些狩猎, 发现了这个 ,然后尝试:

rvm gemset delete global

I am now able to compass create without any issues. 现在,我可以compass create没有任何问题。

I'm not sure what the global gemset is for and don't really care at the moment. 我不确定全局gemset是做什么的,目前还不在乎。 I just want compass to work. 我只想要罗盘工作。

I had this same issue and found that I had the BUNDLE_GEMFILE environment variable set to /Gemfile . 我有同样的问题,发现我将BUNDLE_GEMFILE环境变量设置为/Gemfile I'm not sure why/how it got set, but that was my issue. 我不确定为什么/如何设定,但那是我的问题。

$ bundle exec rails console
$ /Gemfile not found
$ echo $BUNDLE_GEMFILE
/Gemfile
$ unset BUNDLE_GEMFILE
$ bundle exec rails console
# ... it works

Same problem here. 同样的问题在这里 Taking a look at the backtrace, the "faulty" line(s) are these, from bin/compass : 看一下回溯,“有缺陷”的线是这些,从bin/compass

if defined?(Bundler)
    require 'bundler/shared_helpers'
    Bundler.require :assets if Bundler::SharedHelpers.in_bundle?
end

Removing the Bundler.require line makes compass run flawlessly. 删除Bundler.require线可使指南针完美运行。 For more information take a look at this related issue on GitHub . 有关更多信息,请查看GitHub上的相关问题

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM