我正在http://railstutorial.org/chapters/beginning#sec:1.4.1关注Ruby on Rails教程,一切顺利,直到我试图让我的应用程序继续使用Heroku。
我安装了heroku,运行正常但是现在当我运行heroku keys:add
或任何其他heroku命令时,我收到以下错误:
/home/sirswap/.rvm/gems/ruby-1.9.2-p0@rails3tutorial/gems/rest-client-1.4.2/lib/restclient.rb:9:in `rescue in <top (required)>':
no such file to load -- net/https. Try running apt-get install libopenssl-ruby (LoadError)
from /home/sirswap/.rvm/gems/ruby-1.9.2-p0@rails3tutorial/gems/rest-client-1.4.2/lib/restclient.rb:5:in `<top (required)>'
from <internal:lib/rubygems/custom_require>:29:in `require'
from <internal:lib/rubygems/custom_require>:29:in `require'
from /home/sirswap/.rvm/gems/ruby-1.9.2-p0@rails3tutorial/gems/rest-client-1.4.2/lib/rest_client.rb:2:in `<top (required)>'
from <internal:lib/rubygems/custom_require>:29:in `require'
from <internal:lib/rubygems/custom_require>:29:in `require'
from /home/sirswap/.rvm/gems/ruby-1.9.2-p0@rails3tutorial/gems/heroku-1.9.14/lib/heroku/client.rb:2:in `<top (required)>'
from <internal:lib/rubygems/custom_require>:29:in `require'
from <internal:lib/rubygems/custom_require>:29:in `require'
from /home/sirswap/.rvm/gems/ruby-1.9.2-p0@rails3tutorial/gems/heroku-1.9.14/lib/heroku.rb:3:in `<top (required)>'
from <internal:lib/rubygems/custom_require>:29:in `require'
from <internal:lib/rubygems/custom_require>:29:in `require'
from /home/sirswap/.rvm/gems/ruby-1.9.2-p0@rails3tutorial/gems/heroku-1.9.14/bin/heroku:6:in `<top (required)>'
from /home/sirswap/.rvm/gems/ruby-1.9.2-p0@rails3tutorial/bin/heroku:19:in `load'
from /home/sirswap/.rvm/gems/ruby-1.9.2-p0@rails3tutorial/bin/heroku:19:in `<main>'
我做了错误消息所说的,并安装了libopenssl-ruby,但是heroku仍然没有用。
我已完成搜索并找到以下两个试图解决heroku错误的页面: http://www.mail-archive.com/heroku@googlegroups.com/msg05001.html http://blog.project-sierra.de/archives/1534
我按照这些页面上的说明(相同),但是heroku仍无效。
我通常在Windows上做我的工作,所以在ubuntu上对我来说一切都有点新鲜。这是我的红宝石环境:
RubyGems Environment:
- RUBYGEMS VERSION: 1.3.7
- RUBY VERSION: 1.9.2 (2010-08-18 patchlevel 0) [i686-linux]
- INSTALLATION DIRECTORY: /home/sirswap/.rvm/gems/ruby-1.9.2-p0@rails3tutorial
- RUBY EXECUTABLE: /home/sirswap/.rvm/rubies/ruby-1.9.2-p0/bin/ruby
- EXECUTABLE DIRECTORY: /home/sirswap/.rvm/gems/ruby-1.9.2-p0@rails3tutorial/bin
- RUBYGEMS PLATFORMS:
- ruby
- x86-linux
- GEM PATHS:
- /home/sirswap/.rvm/gems/ruby-1.9.2-p0@rails3tutorial
- /home/sirswap/.rvm/gems/ruby-1.9.2-p0@global
- GEM CONFIGURATION:
- :update_sources => true
- :verbose => true
- :benchmark => false
- :backtrace => false
- :bulk_threshold => 1000
- REMOTE SOURCES:
- http://rubygems.org/
我正在运行ubuntu 10.04。
非常感谢下一步的任何帮助或建议:)
答案 0 :(得分:20)
我遇到了同样的问题,我认为这是因为没有安装运行时列出的所有ruby依赖项:
$rvm requirements # it was earlier: rvm notes
具体来说,我执行了[一定要先安装aptitude]:
$sudo aptitude install build-essential bison openssl libreadline5 libreadline5-dev curl git zlib1g zlib1g-dev libssl-dev libsqlite3-0 libsqlite3-dev sqlite3 libxml2-dev
然后,我重新编译了我的ruby安装(使用$rvm reinstall 1.9.2
),heroku就像魅力一样。
答案 1 :(得分:4)
有完全相同的问题..
我在做什么时也注意到了
$ rails console
我收到的错误表明我在使用Readline时遇到了问题。
以下http://rvm.beginrescueend.com/packages/readline/帮助我解决了我遇到的所有问题。
答案 2 :(得分:4)
我注意到剧本的第一行说
#!/usr/bin/env ruby1.9.1
我将此更改为
#!/usr/bin/env ruby
它开始工作了。重新安装红宝石大约10次后,用openssl重新安装。 rolleyes
答案 3 :(得分:3)
我也在使用Ubuntu 10.10上的Railstutorial,并在尝试添加Heroku密钥时遇到了完全相同的错误。这解决了它:
$ rvm remove 1.9.2
$ rvm pkg install openssl
$ rvm install 1.9.2 -C --with-openssl-dir=$HOME/.rvm/usr
答案 4 :(得分:2)
在how to install RVM on Linux上阅读我的路线。您需要安装libssl-dev或net / https之类的东西不起作用。没关系,只需安装并重新编译你的红宝石。
答案 5 :(得分:1)
在您的情况下,“重新编译您的红宝石”可以通过发出:
来完成rvm install
或者您也可以通过手动重新编译openssl扩展来取得一些进展:
cd /home/sirswap/.rvm/src/ruby-1.9.2-p0/ext/openssl
ruby extconf.rb
make
make install
答案 6 :(得分:0)
请重新安装红宝石。我是同样的问题,并通过重新安装ruby修复。
rvm reinstall ruby 1.9.2