在执行heroku login的时候遇到如下错误:
$ heroku login
/usr/local/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:in `require': cannot load such file -- readline (LoadError)
from /usr/local/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from /usr/local/heroku/lib/heroku/command/run.rb:1:in `<top (required)>'
from /usr/local/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from /usr/local/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from /usr/local/heroku/lib/heroku/command.rb:14:in `block in load'
from /usr/local/heroku/lib/heroku/command.rb:13:in `each'
from /usr/local/heroku/lib/heroku/command.rb:13:in `load'
from /usr/local/heroku/lib/heroku/cli.rb:36:in `start'
from /usr/bin/heroku:25:in `<main>'
在Stackoverflow上搜索一番之后,采取在Gemfile下增加:
gem 'rb-readline'
的做法
之后执行
$ bundle install --without production
terminal打印出如下信息
$ bundle install --without production
Fetching gem metadata from https://rubygems.org/..........
Resolving dependencies...
Using rake 10.3.2
Using i18n 0.6.11
Using json 1.8.1
Using minitest 5.4.0
Using thread_safe 0.3.4
Using tzinfo 1.2.1
Using activesupport 4.1.1
Using builder 3.2.2
Using erubis 2.7.0
Using actionview 4.1.1
Using rack 1.5.2
Using rack-test 0.6.2
Using actionpack 4.1.1
Using mime-types 1.25.1
Using polyglot 0.3.5
Using treetop 1.4.15
Using mail 2.5.4
Using actionmailer 4.1.1
Using activemodel 4.1.1
Using arel 5.0.1.20140414130214
Using activerecord 4.1.1
Using bundler 1.6.2
Using coffee-script-source 1.7.1
Using execjs 2.2.1
Using coffee-script 2.3.0
Using thor 0.19.1
Using railties 4.1.1
Using coffee-rails 4.0.1
Using hike 1.2.3
Using jbuilder 1.0.2
Using jquery-rails 2.2.1
Using multi_json 1.10.1
Using tilt 1.4.1
Using sprockets 2.11.0
Using sprockets-rails 2.1.3
Using rails 4.1.1
Your user account isn't allowed to install to the system Rubygems.
You can cancel this installation and run:
bundle install --path vendor/bundle
to install the gems into ./vendor/bundle/, or you can enter your password
and install the bundled gems to Rubygems using sudo.
Password:
Installing rb-readline 0.5.1
Using rdoc 3.12.2
Using sass 3.2.19
Using sass-rails 4.0.3
Using sdoc 0.3.20
Using sqlite3 1.3.8
Using turbolinks 1.1.1
Using uglifier 2.5.3
Your bundle is complete!
Gems in the group production were not installed.
Use `bundle show [gemname]` to see where a bundled gem is installed.
再次执行heroku login:OK
接下来是通过 Git 将应用程序推送到 Heroku 中,遇到问题:
$ git push heroku master
The authenticity of host 'heroku.com (50.19.85.156)' can't be established.
在Stackoverflow上看到有人说是没有把ssh key加到heroku中。因为原来已经有了ssh的key,于是执行
$ heroku keys:add
但是git push的时候还是出现了同样的提示信息,在选择是否继续连接的时候选yes没有出现问题。
个人猜测是原先没有ssh key就去生成一个,有的话就不用。