无法通过rvm安装指南针

时间:2012-05-15 23:35:25

标签: ruby rvm compass-sass

在Ubuntu 11.10中,我是一个快乐且无忧无虑的罗盘用户。我升级到12.04并遇到了这个问题:Compass (ruby) encoding error

我设法解决了它在我的一台计算机上通过rvm安装ruby但现在我在另一台计算机上遇到了一个不同的错误(它有同样的初始问题)。我安装ruby和指南针并使用全局gemset作为默认值:

    gem list

*** LOCAL GEMS ***

bundler (1.1.3)
chunky_png (1.2.5)
compass (0.12.1)
fssm (0.2.9)
rake (0.9.2.2)
rubygems-bundler (1.0.0)
rvm (1.11.3.3)
sass (3.1.18)

但是当我尝试用指南针做任何事情时,我得到了这个错误:

    compass
/home/mrpotato/.rvm/gems/ruby-1.9.3-p194@global/gems/bundler-1.1.3/lib/bundler/shared_helpers.rb:22:in `default_gemfile': Could not locate Gemfile (Bundler::GemfileNotFound)
    from /home/mrpotato/.rvm/gems/ruby-1.9.3-p194@global/gems/bundler-1.1.3/lib/bundler.rb:213:in `default_gemfile'
    from /home/mrpotato/.rvm/gems/ruby-1.9.3-p194@global/gems/bundler-1.1.3/lib/bundler.rb:164:in `root'
    from /home/mrpotato/.rvm/gems/ruby-1.9.3-p194@global/gems/bundler-1.1.3/lib/bundler.rb:123:in `load'
    from /home/mrpotato/.rvm/gems/ruby-1.9.3-p194@global/gems/bundler-1.1.3/lib/bundler.rb:114:in `setup'
    from /home/mrpotato/.rvm/gems/ruby-1.9.3-p194@global/gems/bundler-1.1.3/lib/bundler.rb:119:in `require'
    from /home/mrpotato/.rvm/gems/ruby-1.9.3-p194@global/gems/compass-0.12.1/bin/compass:25:in `<top (required)>'
    from /home/mrpotato/.rvm/gems/ruby-1.9.3-p194@global/bin/compass:19:in `load'
    from /home/mrpotato/.rvm/gems/ruby-1.9.3-p194@global/bin/compass:19:in `<main>'
    from /home/mrpotato/.rvm/gems/ruby-1.9.3-p194@global/bin/ruby_noexec_wrapper:14:in `eval'
    from /home/mrpotato/.rvm/gems/ruby-1.9.3-p194@global/bin/ruby_noexec_wrapper:14:in `<main>'

感谢您的帮助。

4 个答案:

答案 0 :(得分:14)

刚刚发布的新版rubygems-bundler似乎存在问题。安装以前的版本(gem install -v 0.9.2 rubygems-bundler)为我修复了它。

编辑:我还运行rubygems-bundler-uninstaller,这可能是修复的真正来源。

答案 1 :(得分:3)

我尝试在Mountain Lion上安装Compass / SASS / RVM时遇到了这个问题。

我无法使用rubygems-bundler-uninstaller来运行/卸载,所以我必须执行以下操作:

  1. 切换到rvm global gemset并卸载rubygems-bundler rvm ruby​​-1.9.3-p194@global然后gem uninstall ruby​​gems-bundler

  2. 然后切换回我的另一个宝石 - rvm ruby​​-1.9.3-p194,现在正在运行指南针或sass或任何宝石作品

  3. 不确定这是否是正确的做事方式,但它对我有用。希望有所帮助。

答案 2 :(得分:1)

这是指南针中的错误,它假定存在Bundler意味着Bundler.setup被调用。

以下是打破它的行https://github.com/chriseppstein/compass/blob/stable/bin/compass#L24-L26

24 if defined?(Bundler)
25   Bundler.require :assets
26 end

答案 3 :(得分:1)

如果你正在使用yeoman来构建一个恰好想要使用指南针的基于节点的应用程序,你可以禁用这些类型的应用程序的Gemfile要求。

只需将此行添加到~/.bash_profile

即可
export NOEXEC_EXCLUDE="compass"

运行source ~/.bash_profile并重试。在自己生成的角度项目(不需要Gemfile)上运行grunt server时遇到此问题。

https://github.com/mpapis/rubygems-bundler#disabling-executables