Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Heroku gem not working with RVM

I'm following the Ruby on Rails tutorial at http://railstutorial.org/chapters/beginning#sec:1.4.1, and all is going well until I tried to get my app going on Heroku.

I installed heroku, that worked fine, but now when I run heroku keys:add or any other heroku command, I get the following error:

/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>'

I did what the error message said, and installed libopenssl-ruby, but heroku still didn't work.

I've done a search and found the following two pages which try to combat the heroku errors: http://www.mail-archive.com/[email protected]/msg05001.html http://blog.project-sierra.de/archives/1534

I followed the instructions on these pages (which are the same), but heroku still doesn't work.

I usually do my work on windows, so everything is a bit new to me on ubuntu. Here's my ruby environment:

 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/

I'm running ubuntu 10.04.

Any help or advice for next steps would be much appreciated :)

like image 483
Louis Sayers Avatar asked Sep 02 '10 10:09

Louis Sayers


2 Answers

I experienced the same problem, and I think it was caused by not installing all the ruby dependencies listed when you run:

$rvm requirements # it was earlier: rvm notes

Specifically, I executed [be sure to install aptitude first]:

$sudo aptitude install build-essential bison openssl libreadline5 libreadline5-dev curl git zlib1g zlib1g-dev libssl-dev libsqlite3-0 libsqlite3-dev sqlite3 libxml2-dev

and after all that, I recompiled my ruby install (using $rvm reinstall 1.9.2) and heroku worked like a charm.

like image 152
Ryan Avatar answered Sep 18 '22 20:09

Ryan


Hey :) Don't know if it's still relevant or whether this will work for you as well.. it did for me.

Had the exact same problem..

I also noticed when doing
$ rails console

I was getting errors which indicated I had problems with Readline.

Following http://rvm.beginrescueend.com/packages/readline/ helped me fix all issues I was experiencing.

like image 22
einat Avatar answered Sep 19 '22 20:09

einat