Ubuntu 12.10,Ruby 1.9.3上的指南针gemfile语法错误 [英] Compass gemfile syntax error on Ubuntu 12.10, Ruby 1.9.3

查看:145
本文介绍了Ubuntu 12.10,Ruby 1.9.3上的指南针gemfile语法错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

运行安装rvm的标准程序,它也安装Ruby 1.9.3,然后安装rake,compass,sass,bundler和guard的gems,然后将我的gems / bin目录添加到我的路径中,我得到以下消息在运行罗盘上:

  /home/m1ke/.rvm/gems/ruby-1.9.3-p362/gems/bundler- 1.2.3 / lib / bundler / dsl.rb:35:在`rescue in eval_gemfile'中:Gemfile语法错误:(Bundler :: GemfileError)
gemguard,〜> 1.0.1
^
from /home/m1ke/.rvm/gems/ruby-1.9.3-p362/gems/bundler-1.2.3/lib/bundler/dsl.rb:32:in`eval_gemfile'$ b $ / from /home/m1ke/.rvm/gems/ruby-1.9.3-p362/gems/bundler-1.2.3/lib/bundler/dsl.rb:7:in from /home/m1ke/.rvm/gems /ruby-1.9.3-p362/gems/bundler-1.2.3/lib/bundler/definition.rb:18:in`build'
from /home/m1ke/.rvm/gems/ruby-1.9。 3-p362 / gems / bundler-1.2.3 / lib / bundler.rb:144:在'定义'中
来自/home/m1ke/.rvm/gems/ruby-1.9.3-p362/gems/bundler -1.2.3 / lib / bundler.rb:112:在`setup'$ b中$ / from /home/m1ke/.rvm/gems/ruby-1.9.3-p362/gems/bundler-1.2.3/lib/bundler.rb:128:in`require'
from / home / m1ke /.rvm/gems/ruby-1.9.3-p362/gems/compass-0.12.2/bin/compass:26:in'< top(required)>'从/ home / m1ke /中
。 rvm / gems / ruby​​-1.9.3-p362 / bin / compass:19:`load'
from /home/m1ke/.rvm/gems/ruby-1.9.3-p362/bin/compass:19 :在< main>
from /home/m1ke/.rvm/gems/ruby-1.9.3-p362/bin/ruby_noexec_wrapper:14:in`eval'
from /home/m1ke/.rvm/gems/ruby- 1.9.3-p362 / bin / ruby​​_noexec_wrapper:14:在< main>中

所有宝石安装了标准的 gem install compass 语法,我也运行了 gem update --system



更多信息!


  • 使用Windows RubyInstaller安装我的Windows安装。
  • 没有回应,我试着从 apt-get 中删除​​了gem并安装了ruby-compass包。这工作正常,但现在另一个gem(在apt-get上不可用)报告来自 /home/m1ke/.rvm/gems/ruby-1.9.9-p362 / ,而且也来自 /usr/share/ruby-1.9.1/ ,我假设安装了Compass apt-get。所以现在我可能有两个Ruby版本正在争夺......
  • 找到答案在另一个线程上



    只需运行 ruby​​gems-bundler-uninstaller 并且问题立即解决。在这里发帖而不是链接,因为链接的链接没有出现,当我搜索我的错误,因为我的错误是一个语法错误,而链接的帖子有一个文件未找到的错误。


    Having run the standard procedure for installing the rvm, which also installs Ruby 1.9.3, then installing gems for rake, compass, sass, bundler and guard, then adding my gems/bin directory to my path I get the following message on running compass:

    /home/m1ke/.rvm/gems/ruby-1.9.3-p362/gems/bundler-1.2.3/lib/bundler/dsl.rb:35:in `rescue in eval_gemfile': Gemfile syntax error: (Bundler::GemfileError)
    gem "guard", "~> 1.0.1"
                        ^
    from /home/m1ke/.rvm/gems/ruby-1.9.3-p362/gems/bundler-1.2.3/lib/bundler/dsl.rb:32:in `eval_gemfile'
    from /home/m1ke/.rvm/gems/ruby-1.9.3-p362/gems/bundler-1.2.3/lib/bundler/dsl.rb:7:in     from /home/m1ke/.rvm/gems/ruby-1.9.3-p362/gems/bundler-1.2.3/lib/bundler/definition.rb:18:in `build'
    from /home/m1ke/.rvm/gems/ruby-1.9.3-p362/gems/bundler-1.2.3/lib/bundler.rb:144:in `definition'
    from /home/m1ke/.rvm/gems/ruby-1.9.3-p362/gems/bundler-1.2.3/lib/bundler.rb:112:in `setup'
    from /home/m1ke/.rvm/gems/ruby-1.9.3-p362/gems/bundler-1.2.3/lib/bundler.rb:128:in `require'
    from /home/m1ke/.rvm/gems/ruby-1.9.3-p362/gems/compass-0.12.2/bin/compass:26:in `<top (required)>'
    from /home/m1ke/.rvm/gems/ruby-1.9.3-p362/bin/compass:19:in `load'
    from /home/m1ke/.rvm/gems/ruby-1.9.3-p362/bin/compass:19:in `<main>
    from /home/m1ke/.rvm/gems/ruby-1.9.3-p362/bin/ruby_noexec_wrapper:14:in `eval'
    from /home/m1ke/.rvm/gems/ruby-1.9.3-p362/bin/ruby_noexec_wrapper:14:in `<main>'
    

    All gems were installed with the standard gem install compass syntax, I have also run gem update --system

    More information!

    • The same gem works fine on my Windows install, installed using the Windows RubyInstaller.
    • Having had no responses I tried removing the gem and installing the ruby-compass package from apt-get. This works fine, but now another gem (not available on apt-get) reports errors the come from both /home/m1ke/.rvm/gems/ruby-1.9.9-p362/ but also from /usr/share/ruby-1.9.1/ which I assume the Compass apt-get installed. So now I may have two Ruby versions fighting...

    解决方案

    Found the answer on another thread

    Just run rubygems-bundler-uninstaller and the problem was fixed right away. Posting this here instead of just linking as the thread linked didn't come up when I searched my error, as my error was a syntax error whereas the linked post has a "file not found" error.

    这篇关于Ubuntu 12.10,Ruby 1.9.3上的指南针gemfile语法错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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