试图在Ubuntu上安装Heroku会给json和ruby带来错误

时间:2014-07-22 04:34:01

标签: ruby json ubuntu heroku

就像标题所说,我一直在尝试安装Heroku。但是,只要我运行任何heroku命令,我就会得到这个:

/usr/local/heroku/vendor/gems/json-1.7.7/lib/json/common.rb:67:in `initialize': no implicit conversion of nil into Hash (TypeError)
    from /usr/local/heroku/vendor/gems/json-1.7.7/lib/json/common.rb:67:in `new'
    from /usr/local/heroku/vendor/gems/json-1.7.7/lib/json/common.rb:67:in `generator='
    from /usr/local/heroku/vendor/gems/json-1.7.7/lib/json/ext.rb:17:in `<module:Ext>'
    from /usr/local/heroku/vendor/gems/json-1.7.7/lib/json/ext.rb:12:in `<module:JSON>'
    from /usr/local/heroku/vendor/gems/json-1.7.7/lib/json/ext.rb:9:in `<top (required)>'
    from /home/andrew/.rvm/rubies/ruby-2.1.2/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:in `require'
    from /home/andrew/.rvm/rubies/ruby-2.1.2/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:in `require'
    from /usr/local/heroku/vendor/gems/json-1.7.7/lib/json.rb:58:in `<module:JSON>'
    from /usr/local/heroku/vendor/gems/json-1.7.7/lib/json.rb:54:in `<top (required)>'
    from /home/andrew/.rvm/rubies/ruby-2.1.2/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:in `require'
    from /home/andrew/.rvm/rubies/ruby-2.1.2/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:in `require'
    from /usr/local/heroku/lib/heroku/cli.rb:18:in `<top (required)>'
    from /home/andrew/.rvm/rubies/ruby-2.1.2/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:in `require'
    from /home/andrew/.rvm/rubies/ruby-2.1.2/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:in `require'
    from /usr/local/heroku/bin/heroku:23:in `<main>'

我运行这些命令来安装Heroku:

 sudo apt-add-repository 'deb http://toolbelt.herokuapp.com/ubuntu ./'
wget -O- https://toolbelt.heroku.com/apt/release.key | apt-key add -
 sudo apt-get update
sudo apt-get install heroku-toolbelt

任何人都可以帮助我吗?谢谢!

2 个答案:

答案 0 :(得分:0)

尝试运行此脚本

wget -qO- https://toolbelt.heroku.com/install-ubuntu.sh | sh

使用此命令后,安装没问题。

答案 1 :(得分:0)

我有同样的错误。我认为这是Heroku CLI 3.9.4版本的一个问题,他们刚刚发布了3.9.5。更新后一切正常。

更新

sudo apt-get update
sudo apt-get upgrade