【问题标题】:Ruby issue when installing Umpire on Ubuntu 12.04在 Ubuntu 12.04 上安装 Umpire 时出现 Ruby 问题
【发布时间】:2014-10-09 13:11:49
【问题描述】:

我目前正在尝试让https://github.com/heroku/umpire 在我的 Ubuntu 机器上使用石墨在本地工作。 我在 Ubuntu 12.04 版本上做了以下步骤:

  1. git 克隆https://github.com/heroku/umpire
  2. cd 裁判
  3. sudo apt-get install ruby​​-rvm
  4. sudo rvm install ruby​​-1.9.2-p180
  5. sudo apt-get install ruby​​-bundler

在 Gemfile 中产生错误的行:

gem 'rack-timeout', git: "https://github.com/freeformz/rack-timeout.git"

这是我在终端中遇到的错误:

/home/vagrant/umpire/Gemfile:9:in `evaluate': compile error (SyntaxError)
/home/vagrant/umpire/Gemfile:9: syntax error, unexpected ':', expecting $end
gem 'rack-timeout', git: "https://github.com/freeformz...
                    ^
from /usr/lib/ruby/vendor_ruby/bundler/definition.rb:17:in `build'
from /usr/lib/ruby/vendor_ruby/bundler.rb:136:in `definition'

我一直在尝试解决这个问题,但我对 Ruby 并不是特别熟悉。有谁知道如何解决这个问题?

提前感谢您的帮助。

【问题讨论】:

    标签: ruby ubuntu heroku gem graphite


    【解决方案1】:

    我不会使用 apt 提供的 rvm。 AFAICT 在某些方面已经过时并且损坏了。

    从这里开始:Installed Ruby 1.9.3 with RVM but command line doesn't show ruby -v

    一旦我这样做了,我就可以为我的用户安装正确版本的 ruby​​ 并进行捆绑安装...

    vagrant@ubuntu-12:~$ cd umpire/
    RVM used your Gemfile for selecting Ruby, it is all fine - Heroku does that too,
    you can ignore these warnings with 'rvm rvmrc warning ignore /home/vagrant/umpire/Gemfile'.
    To ignore the warning for all files run 'rvm rvmrc warning ignore allGemfiles'.
    
    ruby-1.9.3-p547 is not installed.
    To install do: 'rvm install ruby-1.9.3-p547'
    
    vagrant@ubuntu-12:~/umpire$ rvm install ruby-1.9.3-p547
    Searching for binary rubies, this might take some time.
    Found remote file https://rvm.io/binaries/ubuntu/12.04/x86_64/ruby-1.9.3-p547.tar.bz2
    Checking requirements for ubuntu.
    Requirements installation successful.
    ruby-1.9.3-p547 - #configure
    ruby-1.9.3-p547 - #download
      % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                     Dload  Upload   Total   Spent    Left  Speed
    100 11.3M  100 11.3M    0     0  1851k      0  0:00:06  0:00:06 --:--:-- 2137k
    ruby-1.9.3-p547 - #validate archive
    ruby-1.9.3-p547 - #extract
    ruby-1.9.3-p547 - #validate binary
    ruby-1.9.3-p547 - #setup
    ruby-1.9.3-p547 - #gemset created /home/vagrant/.rvm/gems/ruby-1.9.3-p547@global
    ruby-1.9.3-p547 - #importing gemset /home/vagrant/.rvm/gemsets/global.gems....................................
    ruby-1.9.3-p547 - #generating global wrappers........
    ruby-1.9.3-p547 - #gemset created /home/vagrant/.rvm/gems/ruby-1.9.3-p547
    ruby-1.9.3-p547 - #importing gemsetfile /home/vagrant/.rvm/gemsets/default.gems evaluated to empty gem list
    ruby-1.9.3-p547 - #generating default wrappers........
    
    vagrant@ubuntu-12:~/umpire$ bundle install
    Fetching gem metadata from https://rubygems.org/.........
    Fetching https://github.com/freeformz/rack-timeout.git
    Installing rake 10.1.1
    Installing addressable 2.3.5
    Installing aggregate 0.2.2
    Installing safe_yaml 0.9.7
    Installing crack 0.4.1
    Installing diff-lcs 1.2.5
    Installing excon 0.31.0
    Installing multipart-post 1.2.0
    Installing faraday 0.8.9
    Installing multi_json 1.8.4
    Installing librato-metrics 1.3.0
    Installing rack 1.5.2
    Installing puma 2.7.1
    Installing rack-protection 1.5.1
    Installing rack-ssl 1.3.3
    Installing rack-test 0.6.2
    Using rack-timeout 0.1.0beta2 from https://github.com/freeformz/rack-timeout.git (at master)
    Installing rspec-core 2.14.7
    Installing rspec-expectations 2.14.4
    Installing rspec-mocks 2.14.4
    Installing rspec 2.14.1
    Installing scrolls 0.3.3
    Installing tilt 1.4.1
    Installing sinatra 1.4.4
    Installing webmock 1.16.1
    Installing yajl-ruby 1.2.0
    Using bundler 1.6.2
    Your bundle is complete!
    Use `bundle show [gemname]` to see where a bundled gem is installed.
    vagrant@ubuntu-12:~/umpire$
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2013-09-12
      • 1970-01-01
      • 2014-04-16
      • 1970-01-01
      • 1970-01-01
      • 2012-08-10
      相关资源
      最近更新 更多