9

我正在尝试做教程http://ruby.railstutorial.org/的 heroku 设置部分。但是在https://toolbelt.heroku.com/上,我注意到 Fedora 没有 .rpm,所以我尝试单独安装 Foreman 和 Heroku CLI。Foreman 和 Git 安装良好,但 Heroku CLI 出现问题。

当我尝试这样做时:

$yum install rubygem-heroku

然后简单地做

$heroku

我得到错误:

   /usr/share/rubygems/rubygems/dependency.rb:247:in `to_specs': Could not find heroku (>= 0) amongst [actionmailer-3.2.8, actionpack-3.2.8, activemodel-3.2.8, activerecord-3.2.8, activeresource-3.2.8, activesupport-3.2.8, addressable-2.3.2, arel-3.0.2, builder-3.0.4, builder-3.0.3, bundler-1.2.3, bundler-1.2.1, coffee-rails-3.2.2, coffee-script-2.2.0, coffee-script-source-1.4.0, coffee-script-source-1.3.3, erubis-2.7.0, excon-0.16.10, execjs-1.4.0, foreman-0.60.2, heroku-api-0.3.7, hike-1.2.1, i18n-0.6.1, journey-1.0.4, jquery-rails-2.1.4, jquery-rails-2.1.3, jquery-rails-2.0.2, json-1.7.5, launchy-2.1.2, libv8-3.3.10.4-x86_64-linux, mail-2.4.4, mime-types-1.19, multi_json-1.5.0, multi_json-1.3.6, netrc-0.7.7, polyglot-0.3.3, rack-1.4.1, rack-cache-1.2, rack-ssl-1.3.2, rack-test-0.6.2, rails-3.2.8, railties-3.2.8, rake-10.0.3, rake-0.9.2.2, rdoc-3.12, rest-client-1.6.7, rubygems-bundler-1.1.0, rubyzip-0.9.9, rvm-1.11.3.5, sass-3.2.3, sass-3.2.1, sass-rails-3.2.5, sprockets-2.1.3, sqlite3-1.3.6, sqlite3-1.3.5, therubyracer-0.10.2, thor-0.16.0, tilt-1.3.3, treetop-1.4.12, treetop-1.4.11, treetop-1.4.10, tzinfo-0.3.35, tzinfo-0.3.33, uglifier-1.3.0, uglifier-1.2.3, uglifier-1.0.3] (Gem::LoadError)
    from /usr/share/rubygems/rubygems/dependency.rb:256:in `to_spec'
    from /usr/share/rubygems/rubygems.rb:1231:in `gem'
    from /usr/bin/heroku:18:in `<main>'

所以我 yum 删除了它并尝试改为:

$rvmsudo gem install heroku

现在,当我运行 heroku 时,我得到:

/usr/local/rvm/rubies/ruby-1.9.3-p194/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require': cannot load such file -- readline (LoadError)
    from /usr/local/rvm/rubies/ruby-1.9.3-p194/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
    from /usr/local/rvm/gems/ruby-1.9.3-p194@rails3tutorial2ndEd/gems/heroku-2.33.5/lib/heroku/command/run.rb:1:in `<top (required)>'
    from /usr/local/rvm/rubies/ruby-1.9.3-p194/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
    from /usr/local/rvm/rubies/ruby-1.9.3-p194/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
    from /usr/local/rvm/gems/ruby-1.9.3-p194@rails3tutorial2ndEd/gems/heroku-2.33.5/lib/heroku/command.rb:14:in `block in load'
    from /usr/local/rvm/gems/ruby-1.9.3-p194@rails3tutorial2ndEd/gems/heroku-2.33.5/lib/heroku/command.rb:13:in `each'
    from /usr/local/rvm/gems/ruby-1.9.3-p194@rails3tutorial2ndEd/gems/heroku-2.33.5/lib/heroku/command.rb:13:in `load'
    from /usr/local/rvm/gems/ruby-1.9.3-p194@rails3tutorial2ndEd/gems/heroku-2.33.5/lib/heroku/cli.rb:27:in `start'
    from /usr/local/rvm/gems/ruby-1.9.3-p194@rails3tutorial2ndEd/gems/heroku-2.33.5/bin/heroku:17:in `<top (required)>'
    from /usr/local/rvm/gems/ruby-1.9.3-p194@rails3tutorial2ndEd/bin/heroku:19:in `load'
    from /usr/local/rvm/gems/ruby-1.9.3-p194@rails3tutorial2ndEd/bin/heroku:19:in `<main>'
    from /usr/local/rvm/gems/ruby-1.9.3-p194@rails3tutorial2ndEd/bin/ruby_noexec_wrapper:14:in `eval'
    from /usr/local/rvm/gems/ruby-1.9.3-p194@rails3tutorial2ndEd/bin/ruby_noexec_wrapper:14:in `<main>'

尝试rvm info产量

ruby-1.9.3-p194@rails3tutorial2ndEd:

  system:
    uname:       "Linux angelo 3.6.5-1.fc17.x86_64 #1 SMP Wed Oct 31 19:37:18 UTC 2012 x86_64 x86_64 x86_64 GNU/Linux"
    system:      "redhat/17./x86_64"
    bash:        "/usr/bin/bash => GNU bash, version 4.2.37(1)-release (x86_64-redhat-linux-gnu)"
    zsh:         " => not installed"

  rvm:
    version:      "rvm 1.16.6 (master) by Wayne E. Seguin <wayneeseguin@gmail.com>, Michal Papis <mpapis@gmail.com> [https://rvm.io/]"
    updated:      "2 months 20 days 1 hour 33 minutes 52 seconds ago"

  ruby:
    interpreter:  "ruby"
    version:      "1.9.3p194"
    date:         "2012-04-20"
    platform:     "x86_64-linux"
    patchlevel:   "2012-04-20 revision 35410"
    full_version: "ruby 1.9.3p194 (2012-04-20 revision 35410) [x86_64-linux]"

  homes:
    gem:          "/usr/local/rvm/gems/ruby-1.9.3-p194@rails3tutorial2ndEd"
    ruby:         "/usr/local/rvm/rubies/ruby-1.9.3-p194"

  binaries:
    ruby:         "/usr/local/rvm/rubies/ruby-1.9.3-p194/bin/ruby"
    irb:          "/usr/local/rvm/rubies/ruby-1.9.3-p194/bin/irb"
    gem:          "/usr/local/rvm/rubies/ruby-1.9.3-p194/bin/gem"
    rake:         "/usr/local/rvm/gems/ruby-1.9.3-p194@rails3tutorial2ndEd/bin/rake"

  environment:
    PATH:         "/home/angelo/.rvm/bin:/usr/local/rvm/gems/ruby-1.9.3-p194@rails3tutorial2ndEd/bin:/usr/local/rvm/gems/ruby-1.9.3-p194@global/bin:/usr/local/rvm/rubies/ruby-1.9.3-p194/bin:/usr/local/rvm/bin:/usr/lib64/qt-3.3/bin:/usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/usr/sbin:/home/angelo/heroku-client/:/home/angelo/.local/bin:/home/angelo/bin"
    GEM_HOME:     "/usr/local/rvm/gems/ruby-1.9.3-p194@rails3tutorial2ndEd"
    GEM_PATH:     "/usr/local/rvm/gems/ruby-1.9.3-p194@rails3tutorial2ndEd:/usr/local/rvm/gems/ruby-1.9.3-p194@global"
    MY_RUBY_HOME: "/usr/local/rvm/rubies/ruby-1.9.3-p194"
    IRBRC:        "/usr/local/rvm/rubies/ruby-1.9.3-p194/.irbrc"
    RUBYOPT:      ""
    gemset:       "rails3tutorial2ndEd"

还有我的 Rails 版本

$ rails -v
Rails 3.2.8

宝石环境:

$ gem env
RubyGems Environment:
  - RUBYGEMS VERSION: 1.8.24
  - RUBY VERSION: 1.9.3 (2012-04-20 patchlevel 194) [x86_64-linux]
  - INSTALLATION DIRECTORY: /usr/local/rvm/gems/ruby-1.9.3-p194@rails3tutorial2ndEd
  - RUBY EXECUTABLE: /usr/local/rvm/rubies/ruby-1.9.3-p194/bin/ruby
  - EXECUTABLE DIRECTORY: /usr/local/rvm/gems/ruby-1.9.3-p194@rails3tutorial2ndEd/bin
  - RUBYGEMS PLATFORMS:
    - ruby
    - x86_64-linux
  - GEM PATHS:
     - /usr/local/rvm/gems/ruby-1.9.3-p194@rails3tutorial2ndEd
     - /usr/local/rvm/gems/ruby-1.9.3-p194@global
  - GEM CONFIGURATION:
     - :update_sources => true
     - :verbose => true
     - :benchmark => false
     - :backtrace => false
     - :bulk_threshold => 1000
  - REMOTE SOURCES:
     - http://rubygems.org/

我对整个红宝石(以及heroku)都很陌生,所以我不确定我应该寻找什么来匹配,但一切似乎都是ruby-1.9.3,所以我很困惑为什么Heroku不想合作。

4

5 回答 5

4

现在在https://toolbelt.heroku.com/standalone上还有一个独立版本的工具带。

于 2013-07-24T23:36:08.633 回答
3

我宁愿使用 heroku 和工头 gem,也不愿在 fedora 17/18 上使用 heroku 工具。

gem install heroku 
gem install foreman

在安装过程中它会给出一个警告说

herokugem 已被弃用,取而代之的是 Heroku Toolbelt。

忽略那个。toolbet 甚至给我在 windows 系统上的问题。

在 Fedora 17/18 上一切正常。

享受红宝石!

于 2013-02-16T09:32:43.863 回答
1

我做了

sudo yum install rubygem-heroku 

如果您使用的是 RVM,请执行此操作

rvm use system

使用heroku客户端。

很难让 heroku 命令与 rvm+jruby 一起工作

于 2014-04-11T16:54:40.847 回答
1

您应该完全选择更稳定的独立选项。我也安装了 gem,但遇到了很多类型的错误(ssl、cert、yours...)

你可以去:

https://toolbelt.heroku.com/standalone

并根据您的操作系统安装它。

希望这可以帮助

于 2015-11-07T18:20:36.730 回答
0

如果您安装 ruby​​gem_heroku 包,它可能会在系统 ruby​​ 中安装 gem。

根据您的示例,您正在使用 RVM。

您应该将 heroku gem 直接安装到 RVM 环境和要在其中使用它的 gemset 中:

gem install heroku
于 2012-12-22T20:18:26.787 回答