Troubles with ruby-2.X installation using RVM - ruby

I recently came across of the ruby-2.0.0-p0 installation. After the successfully installation of the rvm i type the following command at the bash.
rvm install ruby-2.0.0-p0
This this the result log.
Searching for binary rubies, this might take some time.
No binary rubies available for: debian/wheezy_sid/i386/ruby-2.0.0-p0.
Continuing with compilation. Please read 'rvm mount' to get more information on binary rubies.
Installing Ruby from source to: /home/javier/.rvm/rubies/ruby-2.0.0-p0, this may take a while depending on your cpu(s)...
ruby-2.0.0-p0 - #downloading ruby-2.0.0-p0, this may take a while depending on your connection...
ruby-2.0.0-p0 - #extracting ruby-2.0.0-p0 to /home/javier/.rvm/src/ruby-2.0.0-p0
ruby-2.0.0-p0 - #extracted to /home/javier/.rvm/src/ruby-2.0.0-p0
ruby-2.0.0-p0 - #configuring
ruby-2.0.0-p0 - #compiling
ruby-2.0.0-p0 - #installing
Removing old Rubygems files...
Installing rubygems-2.0.0 for ruby-2.0.0-p0 ...
Error running 'env GEM_PATH=/home/javier/.rvm/gems/ruby-2.0.0-p0:/home/javier/.rvm/gems/ruby-2.0.0-p0#global:/home/javier/.rvm/gems/ruby-2.0.0-p0:/home/javier/.rvm/gems/ruby-2.0.0-p0#global GEM_HOME=/home/javier/.rvm/gems/ruby-2.0.0-p0 /home/javier/.rvm/rubies/ruby-2.0.0-p0/bin/ruby /home/javier/.rvm/src/rubygems-2.0.0/setup.rb', please read /home/javier/.rvm/log/ruby-2.0.0-p0/rubygems.install.log
Installation of rubygems did not complete successfully.
Saving wrappers to '/home/javier/.rvm/bin'.
ruby-2.0.0-p0 - #adjusting #shebangs for (gem irb erb ri rdoc testrb rake).
ruby-2.0.0-p0 - #importing default gemsets, this may take time ...
Install of ruby-2.0.0-p0 - #complete
Making gemset ruby-2.0.0-p0 pristine.
Error running '' under ,
please read /home/javier/.rvm/log/ruby-2.0.0-p0/gemset.pristine.log
Making gemset ruby-2.0.0-p0#global pristine.
Error running '' under ,
please read /home/javier/.rvm/log/ruby-2.0.0-p0/gemset.pristine.log
Note that the process goes without troubles until the installation of ruby gems.
What's going on here ??
Any help appreciated.
First comment output
cat /home/javier/.rvm/log/ruby-2.0.0-p0/rubygems.install.log
/home/javier/.rvm/src/rubygems-2.0.0/lib/rubygems/core_ext/kernel_require.rb:45:in `require': cannot load such file -- openssl (LoadError)
from /home/javier/.rvm/src/rubygems-2.0.0/lib/rubygems/core_ext/kernel_require.rb:45:in `require'
from /home/javier/.rvm/src/rubygems-2.0.0/lib/rubygems/security.rb:8:in `<top (required)>'
from /home/javier/.rvm/src/rubygems-2.0.0/lib/rubygems/core_ext/kernel_require.rb:45:in `require'
from /home/javier/.rvm/src/rubygems-2.0.0/lib/rubygems/core_ext/kernel_require.rb:45:in `require'
from /home/javier/.rvm/src/rubygems-2.0.0/lib/rubygems/package.rb:43:in `<top (required)>'
from /home/javier/.rvm/src/rubygems-2.0.0/lib/rubygems/core_ext/kernel_require.rb:45:in `require'
from /home/javier/.rvm/src/rubygems-2.0.0/lib/rubygems/core_ext/kernel_require.rb:45:in `require'
from /home/javier/.rvm/src/rubygems-2.0.0/lib/rubygems/installer.rb:8:in `<top (required)>'
from /home/javier/.rvm/src/rubygems-2.0.0/lib/rubygems/core_ext/kernel_require.rb:45:in `require'
from /home/javier/.rvm/src/rubygems-2.0.0/lib/rubygems/core_ext/kernel_require.rb:45:in `require'
from /home/javier/.rvm/src/rubygems-2.0.0/lib/rubygems/request_set.rb:5:in `<top (required)>'
from /home/javier/.rvm/src/rubygems-2.0.0/lib/rubygems.rb:195:in `finish_resolve'
from /home/javier/.rvm/src/rubygems-2.0.0/lib/rubygems/rdoc.rb:14:in `<top (required)>'
from /home/javier/.rvm/src/rubygems-2.0.0/lib/rubygems/core_ext/kernel_require.rb:45:in `require'
from /home/javier/.rvm/src/rubygems-2.0.0/lib/rubygems/core_ext/kernel_require.rb:45:in `require'
from /home/javier/.rvm/src/rubygems-2.0.0/lib/rubygems/uninstaller.rb:10:in `<top (required)>'
from /home/javier/.rvm/src/rubygems-2.0.0/lib/rubygems/core_ext/kernel_require.rb:45:in `require'
from /home/javier/.rvm/src/rubygems-2.0.0/lib/rubygems/core_ext/kernel_require.rb:45:in `require'
from /home/javier/.rvm/src/rubygems-2.0.0/lib/rubygems/commands/setup_command.rb:440:in `uninstall_old_gemcutter'
from /home/javier/.rvm/src/rubygems-2.0.0/lib/rubygems/commands/setup_command.rb:144:in `execute'
from /home/javier/.rvm/src/rubygems-2.0.0/lib/rubygems/command.rb:305:in `invoke_with_build_args'
from /home/javier/.rvm/src/rubygems-2.0.0/lib/rubygems/command_manager.rb:170:in `process_args'
from /home/javier/.rvm/src/rubygems-2.0.0/lib/rubygems/command_manager.rb:130:in `run'
from /home/javier/.rvm/src/rubygems-2.0.0/lib/rubygems/gem_runner.rb:60:in `run'
from setup.rb:45:in `<main>'
RubyGems 2.0.0 installed
Second comment output And the other command
rvm use --default 2.0.0
RVM is not a function, selecting rubies with 'rvm use ...' will not work.
You need to change your terminal emulator preferences to allow login shell.
Sometimes it is required to use `/bin/bash --login` as the command.
Please visit https://rvm.io/integration/gnome-terminal/ for a example.

Try the following
$ rvm remove 2.0.0 # get rid of unsuccessful installation
$ rvm get head --autolibs=3 # get the latest RVM and build required libs
$ rvm requirements # just in case, install all other required stuff
$ rvm install ruby-2.0.0
If at any of those commands fails at any point. Update your question with the logs.

I had this exact same problem. The solution was elegant and simple.
Just update your gems direct from the command line:
sudo gem update --system
That's it!
Terminal will now show:
Updating RubyGems
Updating rubygems-update
Successfully installed rubygems-update-2.0.3
Updating RubyGems to 2.0.3
Installing RubyGems 2.0.3
RubyGems 2.0.3 installed

I had this exact same problem, same error message, etc. I don't know about you, but I use MacPorts, and through that I have libraries like OpenSSL installed, which I think may have contributed to my trouble.
I just got it working on my system; I'm not sure exactly what I did right but here are the steps I took:
Set up my ~/.rvmrc to match the first code block here.
Uninstalled 2.0.0 through rvm (rvm remove 2.0.0).
Removed the folders for ruby-2.0.0, rubygems-2.0.0 and the dependency packages like OpenSSL and YAML in ~/.rvm/src.
Executed rvm install 2.0.0 --with-opt-dir=/opt/local --autolibs=0. /opt/local is my MacPorts prefix directory, and autolibs=0 disables any dependency installation so it didn't have the opportunity to use something other than my MacPorts libraries. If you get through this step without red console output you're past the errors you were having above.
Not knowing if having an empty default gemset was the problem I also ran rvm use --create 2.0.0#... to get a non-default gemset created and then (successfully) installed a gem and its dependencies into it.
I hope this helps!

Open Up the Terminal and then Go to Edit > Profile Preferences and then go to the Tab "Title and Command" and Check "Run Command as Login Shell".
Boot Up a Bash and Now you can install Gems directly from the terminal without the use of sudo and the error "RVM is not a function, selecting rubies with 'rvm use ...' will not work." will be eliminated.
Cheers.

Related

cannot load such file -- rubygems/core_ext/kernel_warn (LoadError)

on a mac os 10.12.6 after i try sudo gem install rake or
i get this error message:
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:55:in `require': cannot load such file -- rubygems/core_ext/kernel_warn (LoadError)
from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from /Library/Ruby/Site/2.0.0/rubygems.rb:1395:in `<top (required)>'
from <internal:gem_prelude>:1:in `require'
from <internal:gem_prelude>:1:in `<compiled>'
The is error throws any gem install
Ruby version is 2.0.0, Ive tried updating ruby with homebrew but whni try installing home brew i get the same error.
Cant seem to edit /Library/Ruby/Site/2.0.0/rubygems.rb:1395
This is possibly related to issue #2535 in rubygems fixed in release 3.0.1.
Try gem update --system
All suggested solutions didn't fully work for me, although gem update --system seems to be a good idea, because it updates ruby. BUT: On my Mac, the system version didn't step back after the update, although ruby -v gave the correct new version. The described error remained for me, e.g. while using homebrew with brew update:
$ brew update
/System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require': cannot load such file -- rubygems/core_ext/kernel_warn (LoadError)
from /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from /Library/Ruby/Site/2.3.0/rubygems.rb:1395:in `<top (required)>'
from <internal:gem_prelude>:4:in `require'
from <internal:gem_prelude>:4:in `<internal:gem_prelude>'
The only thing that helped me was the following as described here:
sudo rm -f '/usr/local/bin/update_rubygems'
sudo rm -rf '/Library/Ruby/Site/2.3.0'
Hope to help some folks (I'am on MacOS 10.14.2).
You are going to have problems using system ruby or messing with it's gems. You are far better off to use a ruby version manager where you may have different versions of ruby per project. I highly recommend RVM.
See here for how to install
Did you also try to run gem install bundler?
Post output of these commands if they don't give you an error
ruby -v
which ruby
gem env

How can I fix charlock_holmes gem so it works on opensuse Tumbleweed?

I can install charlock_holmes gem on opensuse, trying to open it up in irb quickly, I get this:
> irb
2.3.0 :001 > require 'charlock_holmes'
LoadError: /home/wpostma/.rvm/gems/ruby-2.3.0/gems/charlock_holmes-0.7.3/lib/charlock_holmes/charlock_holmes.so:
undefined symbol: _ZTIN6icu_538ByteSinkE - /home/wpostma/.rvm/gems/ruby-2.3.0/gems/charlock_holmes-0.7.3/lib/charlock_holmes/charlock_holmes.so
from /home/wpostma/.rvm/rubies/ruby-2.3.0/lib64/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from /home/wpostma/.rvm/rubies/ruby-2.3.0/lib64/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from /home/wpostma/.rvm/gems/ruby-2.3.0/gems/charlock_holmes-0.7.3/lib/charlock_holmes.rb:1:in `<top (required)>'
from /home/wpostma/.rvm/rubies/ruby-2.3.0/lib64/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:127:in `require'
from /home/wpostma/.rvm/rubies/ruby-2.3.0/lib64/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:127:in `rescue in require'
from /home/wpostma/.rvm/rubies/ruby-2.3.0/lib64/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:40:in `require'
from (irb):1
from /home/wpostma/.rvm/rubies/ruby-2.3.0/bin/irb:11:in `<main>'
2.3.0 :002 >
It looks to me like maybe something in charlock_holmes is incompatible with the libicu version inside tumbleweed.
I'm using ruby installed with rvm, and purging all my gemsets and reinstalling does not fix it. Any other ways to get charlock_holmes to work? Maybe I need to install a special copy of libicu (earlier, older) and point the gem at it?
Either of these works. For me the bundle config option works better.
This is a direct command to install the gem, directing it towards the correct libicu version:
gem install charlock_holmes -- --with-icu-dir=/usr/local
This is a command to tell which ever ruby project I install later on this system, will get gems installed by bundler to just work instead of breaking:
bundle config build.charlock_holmes "--with-icu-dir=/usr/local" --global
Since I'm using rvm the above bundle configuration seems to be "global" to that rvm environment only.
In my case, the bundle config is helpful as a large series of actions that would have otherwise failed (installing gems, and bootstrapping a large rails application) just worked.

Error upgrading to Ruby 2.2.4

I ran rvm install ruby-2.2.4 and got the following error:
$ rvm reinstall ruby-2.2.4
ruby-2.2.4 - #removing src/ruby-2.2.4..
ruby-2.2.4 - #removing rubies/ruby-2.2.4..
Searching for binary rubies, this might take some time.
No binary rubies available for: osx/10.9/x86_64/ruby-2.2.4.
Continuing with compilation. Please read 'rvm help mount' to get more information on binary rubies.
Checking requirements for osx.
Certificates in '/usr/local/etc/openssl/cert.pem' are already up to date.
Requirements installation successful.
Installing Ruby from source to: /Users/JAckerman/.rvm/rubies/ruby-2.2.4, this may take a while depending on your cpu(s)...
ruby-2.2.4 - #downloading ruby-2.2.4, this may take a while depending on your connection...
ruby-2.2.4 - #extracting ruby-2.2.4 to /Users/JAckerman/.rvm/src/ruby-2.2.4....
ruby-2.2.4 - #applying patch /Users/JAckerman/.rvm/patches/ruby/2.2.4/fix_installing_bundled_gems.patch.
ruby-2.2.4 - #configuring..........................................................
ruby-2.2.4 - #post-configuration.
ruby-2.2.4 - #compiling.............................................................
ruby-2.2.4 - #installing............
Error running '__rvm_make install',
showing last 15 lines of /Users/JAckerman/.rvm/log/1454705088_ruby-2.2.4/install.log
from /Users/JAckerman/.rvm/src/ruby-2.2.4/lib/rubygems/core_ext/kernel_require.rb:54:in `require'
from /Users/JAckerman/.rvm/src/ruby-2.2.4/lib/rubygems/core_ext/kernel_require.rb:54:in `require'
from /Users/JAckerman/.rvm/src/ruby-2.2.4/lib/rubygems/dependency_installer.rb:3:in `<top (required)>'
from /Users/JAckerman/.rvm/src/ruby-2.2.4/lib/rubygems/core_ext/kernel_require.rb:54:in `require'
from /Users/JAckerman/.rvm/src/ruby-2.2.4/lib/rubygems/core_ext/kernel_require.rb:54:in `require'
from /Users/JAckerman/.rvm/src/ruby-2.2.4/lib/rubygems.rb:556:in `install'
from ./tool/rbinstall.rb:722:in `block (2 levels) in <main>'
from ./tool/rbinstall.rb:721:in `each'
from ./tool/rbinstall.rb:721:in `block in <main>'
from ./tool/rbinstall.rb:757:in `call'
from ./tool/rbinstall.rb:757:in `block in <main>'
from ./tool/rbinstall.rb:754:in `each'
from ./tool/rbinstall.rb:754:in `<main>'
make: *** [do-install-nodoc] Error 1
++ return 2
There has been an error while running make install. Halting the installation.
I tried these steps, running rvm reinstall ruby-2.2.4 after each step, to no avail:
rvm get head
rvm get master
Then all of this:
$ rvm gem list error
Please note that `rvm gem ...` was removed, try `gem list error` or `rvm all do gem list error` instead. ( see: 'rvm usage' )
JAckerman#Jasons-MacBook-Pro parkme3.1 (staging) $ gem list error
/Users/JAckerman/.rvm/rubies/ruby-2.2.4/lib/ruby/2.2.0/yaml.rb:4:in `<top (required)>':
It seems your ruby installation is missing psych (for YAML output).
To eliminate this warning, please install libyaml and reinstall your ruby.
/Users/JAckerman/.rvm/rubies/ruby-2.2.4/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:in `require': dlopen(/Users/JAckerman/.rvm/rubies/ruby-2.2.4/lib/ruby/2.2.0/x86_64-darwin13/psych.bundle, 9): Library not loaded: /usr/local/lib/libyaml-0.2.dylib (LoadError)
Referenced from: /Users/JAckerman/.rvm/rubies/ruby-2.2.4/lib/ruby/2.2.0/x86_64-darwin13/psych.bundle
Reason: image not found - /Users/JAckerman/.rvm/rubies/ruby-2.2.4/lib/ruby/2.2.0/x86_64-darwin13/psych.bundle
from /Users/JAckerman/.rvm/rubies/ruby-2.2.4/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:in `require'
from /Users/JAckerman/.rvm/rubies/ruby-2.2.4/lib/ruby/2.2.0/psych.rb:1:in `<top (required)>'
from /Users/JAckerman/.rvm/rubies/ruby-2.2.4/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:in `require'
from /Users/JAckerman/.rvm/rubies/ruby-2.2.4/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:in `require'
from /Users/JAckerman/.rvm/rubies/ruby-2.2.4/lib/ruby/2.2.0/yaml.rb:5:in `<top (required)>'
from /Users/JAckerman/.rvm/rubies/ruby-2.2.4/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:in `require'
from /Users/JAckerman/.rvm/rubies/ruby-2.2.4/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:in `require'
from /Users/JAckerman/.rvm/rubies/ruby-2.2.4/lib/ruby/2.2.0/rubygems.rb:624:in `load_yaml'
from /Users/JAckerman/.rvm/rubies/ruby-2.2.4/lib/ruby/2.2.0/rubygems/config_file.rb:328:in `load_file'
from /Users/JAckerman/.rvm/rubies/ruby-2.2.4/lib/ruby/2.2.0/rubygems/config_file.rb:197:in `initialize'
from /Users/JAckerman/.rvm/rubies/ruby-2.2.4/lib/ruby/2.2.0/rubygems/gem_runner.rb:74:in `new'
from /Users/JAckerman/.rvm/rubies/ruby-2.2.4/lib/ruby/2.2.0/rubygems/gem_runner.rb:74:in `do_configuration'
from /Users/JAckerman/.rvm/rubies/ruby-2.2.4/lib/ruby/2.2.0/rubygems/gem_runner.rb:39:in `run'
from /Users/JAckerman/.rvm/rubies/ruby-2.2.4/bin/gem:21:in `<main>'
JAckerman#Jasons-MacBook-Pro parkme3.1 (staging) $ brew install libyaml
Warning: libyaml-0.1.6 already installed
JAckerman#Jasons-MacBook-Pro parkme3.1 (staging) $ brew reinstall libyaml
==> Reinstalling libyaml
Warning: libyaml-0.1.6 already installed
JAckerman#Jasons-MacBook-Pro parkme3.1 (staging) $ brew unlink libyaml
Unlinking /usr/local/Cellar/libyaml/0.1.6... 1 symlinks removed
JAckerman#Jasons-MacBook-Pro parkme3.1 (staging) $ brew reinstall libyaml
==> Reinstalling libyaml
Warning: libyaml-0.1.6 already installed, it's just not linked
JAckerman#Jasons-MacBook-Pro parkme3.1 (staging) $ brew link libyaml
Linking /usr/local/Cellar/libyaml/0.1.6... 5 symlinks created
Then I re-tried rvm get head and rvm get master, reinstalling after each.
Install / update autoconf brew install autoconf
The issue was that, while most of the above was right, none of it was working because my homebrew was not up to date, which I figured out by running brew doctor. Updating home brew (brew update) and then reinstalling the necessary libraries got it working.

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/heroku#googlegroups.com/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 :)
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.
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.
I blew many hours on this yesterday. Eventually, somewhat by chance (actually more like sheer desperation), I looked in the file /usr/bin/heroku
I noticed the first line of the script said
#!/usr/bin/env ruby1.9.1
I changed this to
#!/usr/bin/env ruby
and it started working. After re-installing ruby about 10 times and all that mucking around with openssl. rolleyes
I'm also doing the Railstutorial on Ubuntu 10.10 and got the exact same error while trying to add Heroku keys. This solves it:
$ rvm remove 1.9.2
$ rvm pkg install openssl
$ rvm install 1.9.2 -C --with-openssl-dir=$HOME/.rvm/usr
Read my directions on how to install RVM on Linux. You need to install libssl-dev or things like net/https won't work. It's OK though, just install that and recompile your rubies.
In your case "recompiling your rubies" can probably be done by issuing:
rvm install
Or alternatively you might make some progress by manually recompiling the openssl extension:
cd /home/sirswap/.rvm/src/ruby-1.9.2-p0/ext/openssl
ruby extconf.rb
make
make install
Please reinstall ruby. I was same problem and fixed by reinstalling ruby.
rvm reinstall ruby 1.9.2

Resolve multiple versions of rubygems

I have what looks like multiple versions of rubygems installed on my machine, when i gem list i see all my gems, but when i go to run scripts, i get error messages like
Missing these required gems:
SystemTimer
Is there any methodology I can follow to remove all versions of rubygems but one? Ideally i would like to be able to access all the gems that show up under gem list in my programs.
From Gem Environment
- RUBY EXECUTABLE: /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby
Still if i run:
$ /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby script/mailer_daemon_fetcher start production
no such file to load -- SystemTimer
/Library/Ruby/Site/1.8/rubygems/custom_require.rb:31:in `gem_original_require'
/Library/Ruby/Site/1.8/rubygems/custom_require.rb:31:in `require'
/Library/Ruby/Gems/1.8/gems/activesupport-2.3.4/lib/active_support/dependencies.rb:156:in `require'
/Library/Ruby/Gems/1.8/gems/activesupport-2.3.4/lib/active_support/dependencies.rb:521:in `new_constants_in'
/Library/Ruby/Gems/1.8/gems/activesupport-2.3.4/lib/active_support/dependencies.rb:156:in `require'
/Library/Ruby/Gems/1.8/gems/rails-2.3.4/lib/rails/gem_dependency.rb:208:in `load'
/Library/Ruby/Gems/1.8/gems/rails-2.3.4/lib/initializer.rb:307:in `load_gems'
/Library/Ruby/Gems/1.8/gems/rails-2.3.4/lib/initializer.rb:307:in `each'
/Library/Ruby/Gems/1.8/gems/rails-2.3.4/lib/initializer.rb:307:in `load_gems'
/Library/Ruby/Gems/1.8/gems/rails-2.3.4/lib/initializer.rb:164:in `process'
/Library/Ruby/Gems/1.8/gems/rails-2.3.4/lib/initializer.rb:113:in `send'
/Library/Ruby/Gems/1.8/gems/rails-2.3.4/lib/initializer.rb:113:in `run'
./script/../config/environment.rb:13
script/mailer_daemon_fetcher:5:in `require'
script/mailer_daemon_fetcher:5
no such file to load -- SystemTimer
/Library/Ruby/Site/1.8/rubygems/custom_require.rb:31:in `gem_original_require'
/Library/Ruby/Site/1.8/rubygems/custom_require.rb:31:in `require'
/Library/Ruby/Gems/1.8/gems/activesupport-2.3.4/lib/active_support/dependencies.rb:156:in `require'
/Library/Ruby/Gems/1.8/gems/activesupport-2.3.4/lib/active_support/dependencies.rb:521:in `new_constants_in'
/Library/Ruby/Gems/1.8/gems/activesupport-2.3.4/lib/active_support/dependencies.rb:156:in `require'
/Library/Ruby/Gems/1.8/gems/rails-2.3.4/lib/rails/gem_dependency.rb:208:in `load'
/Library/Ruby/Gems/1.8/gems/rails-2.3.4/lib/initializer.rb:307:in `load_gems'
/Library/Ruby/Gems/1.8/gems/rails-2.3.4/lib/initializer.rb:307:in `each'
/Library/Ruby/Gems/1.8/gems/rails-2.3.4/lib/initializer.rb:307:in `load_gems'
/Library/Ruby/Gems/1.8/gems/rails-2.3.4/lib/initializer.rb:169:in `process'
/Library/Ruby/Gems/1.8/gems/rails-2.3.4/lib/initializer.rb:113:in `send'
/Library/Ruby/Gems/1.8/gems/rails-2.3.4/lib/initializer.rb:113:in `run'
./script/../config/environment.rb:13
script/mailer_daemon_fetcher:5:in `require'
script/mailer_daemon_fetcher:5
Missing these required gems:
SystemTimer
You're running:
ruby 1.8.7.72 at /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby
rubygems 1.3.5 at /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/gems/1.8, /Library/Ruby/Gems/1.8
note in the above i'm manually calling ruby**/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby** this is the same file that my /usr/bin/ruby is symlinked to, and also my GEM_PATH is set to be /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/gems/1.8
full output of gem environment is available here: http://pastie.org/661104
I think the problem is SystemTimer loads slightly oddly so you need more configuration in environment.rb
The "problem" seems to be that gem is called "SystemTimer" but you need to load "system_timer". In order to accomplish this with environment.rb you should use:
config.gem 'SystemTimer', :lib => 'system_timer'
That seemed to solve the same problem for me.
I have a feeling that you might be using a different version of ruby than ruby gems is. Either that or ruby doesn't know where to look for your gems.
See the the gem installation guide to ensure your environment is configured to use gems.
If you're still having problems after following instructions, ensure that you haven't got multiple versions of ruby installed. In the event that there are multiple version of Ruby available, make sure your scripts are calling the same version of Ruby as gem is. This is done by comparing the gem environment listing for RUBY_EXECUTABLE against your scripts' shebang line. Double check to follow any symlinks, because most distribution based installations of ruby will symlink /usr/bin/ruby to /usr/bin/ruby1.8
You should also check that your gems were installed by the same user who is running the script.
If you ran gem install without root privileges the new gems will be installed in your home directory. If you're running a script that depends on these gems as another user. Those installed gems will not be found. However, there's no problems if your gems are installed by root and a different user is running scripts that requires those gems.
I experienced this problem while switching from Ruby to Ruby Enterprise Edition. I found that I had to install all my required gems again using REE's instance of gem.
gem cleanup
it will delete all old gem versions
you have problems with environment - running gem gets others than when you use rubygems in script
look at output of (especially GEM PATHS)
gem environment
also you can compare results of ruby -e 'p ENV' executed in shell and p ENV execute somewhere in your code — look for differences in gem related stuff
Using RVM https://rvm.io/ you can have different versions of Ruby (Enterprise Edition, MRI, Rubinius, etc) and different gem sets.
Check it out, it is really useful !

Resources