Install CocoaPods on an old Mac - ios

I'm using the Unity 5.2.4f game development engine and I have installed Ruby 1.9.3 on my old Mac with a Mac OS X v10.7.5 (Lion) system on it.
When I open a Unity project for the first time, there is an installation attempt which is failing and I don't know how to solve this, after trying for a few days. Here is the error I get:
IOS RESOLVER
Failed to install Cocoapods for the current user.
It will not be possible to install Cocoapods in the generated Xcode project which will result in link errors when building your application.
For more information see:
https://guides.cocoapods.org/using/getting-started.html
'gem install activesupport -v 4.2.6 --user-install' failed with code (1):
WARNING: You don't have /Users/DAN26/.gem/ruby/1.8/bin in your PATH,
gem executables will not run.
ERROR: Error installing activesupport:
i18n requires Ruby version >= 1.9.3.
So I go to the Terminal and do the following:
export PATH="/Users/DAN26/.gem/ruby/1.9.3/bin:$PATH"
No change. So I do this:
export PATH="/Users/DAN26/.gem/ruby/1.8/bin:$PATH"
Still get the same message...
Enter
$PATH
Result:
-bash: /usr/local/opt/openssl/bin:/Users/DAN26/.rbenv/bin:/Users/DAN26/.rbenv/shims:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin:/Users/DAN26/.rvm/bin: No such file or directory
I have installed lower versions of activesupport 4.2.5 and cocoapods 0.34.4 but no change (I have installed them because any other versions require Ruby 2.0.0+ which I fail to install)
Also if I enter in the Terminal:
gem list
I get this:
*** LOCAL GEMS ***
activesupport (4.2.9, 4.2.6, 4.2.5, 3.2.22.5)
bigdecimal (1.1.0)
claide (0.7.0)
cocoapods (0.34.4)
cocoapods-core (0.34.4)
cocoapods-downloader (0.7.2)
cocoapods-plugins (0.3.2)
cocoapods-trunk (0.3.1)
cocoapods-try (0.4.5)
colored (1.2)
escape (0.0.4)
fuzzy_match (2.0.4)
i18n (0.8.6)
io-console (0.3)
json (1.8.6, 1.5.5)
json_pure (1.8.6)
minitest (5.10.3, 2.5.1)
multi_json (1.12.1)
nap (1.1.0, 0.8.0)
netrc (0.7.8)
open4 (1.3.4)
rake (0.9.2.2)
rdoc (3.9.5)
thread_safe (0.3.6)
tzinfo (1.2.3)
xcodeproj (0.19.4)
I don't have any understanding on Mac. All I did above was by tutorials.

You can use sudo gem install cocoapods for installing CocoaPods in an old mac. It will be asking for the administrator password.
Based on the upcoming error, do the below steps:
sudo gem install activesupport -v 4.2.6
sudo gem install cocoapods
It can be possible you have to check activesupport version with this link.

Related

bundle install does not complete execution. It gets stuck in the middle

When I ran bundle install, it gets stuck towards the end.
Here's my bundle console output
!  ~/r/mangoweb   master  bundle install Sun Jul 27 12:45:28 IST 2014
Updating git://github.com/mongoid/mongoid.git
Updating git://github.com/Rameshv/mongoid-paranoia.git
Updating git://github.com/resque/resque.git
Updating git://github.com/zapnap/resque_mailer.git
Updating git://github.com/michaeldv/awesome_print.git
Updating https://github.com/stripe/stripe-ruby
Updating git://github.com/thedarkone/rails-dev-boost.git
Updating git#github.com:capistrano/rvm.git
Fetching gem metadata from http://rubygems.org/.......
Fetching additional metadata from http://rubygems.org/..
Resolving dependencies...
Using rake 10.3.2
Using i18n 0.6.11
Using minitest 4.7.5
Using multi_json 1.10.1
Using thread_safe 0.3.4
Using tzinfo 0.3.40
Using activesupport 4.0.2
Using builder 3.1.4
Using erubis 2.7.0
Using rack 1.5.2
Using rack-test 0.6.2
Using actionpack 4.0.2
Using mime-types 1.25.1
Using polyglot 0.3.5
Using treetop 1.4.15
Using mail 2.5.4
Using actionmailer 4.0.2
Using activemodel 4.0.2
Using activerecord-deprecated_finders 1.0.3
Using arel 4.0.2
Using activerecord 4.0.2
Using addressable 2.3.6
Using awesome_print 1.2.0 from git://github.com/michaeldv/awesome_print.git (at v2)
Using json 1.8.1
Using mini_portile 0.6.0
Using nokogiri 1.6.3.1
Using aws-sdk 1.49.0
Using bcrypt 3.1.7
Using bcrypt-ruby 3.1.5
Using coderay 1.1.0
Using better_errors 1.1.0
Using bson 2.3.0
Using bundler 1.6.1
Using colorize 0.7.3
Using net-ssh 2.9.1
Using net-scp 1.2.1
Using sshkit 1.5.1
Using capistrano 3.0.1
Using capistrano-bundler 1.1.2
Using capistrano-rails 1.1.0
Using capistrano-rvm 0.1.1 from git#github.com:capistrano/rvm.git (at master)
Using carrierwave 0.10.0
Using connection_pool 2.0.0
Using optionable 0.2.0
Using moped 2.0.0
Using origin 1.1.0
Using mongoid 4.0.0.alpha1 from git://github.com/mongoid/mongoid.git (at v4.0.0.alpha1)
Using mongoid-grid_fs 2.1.0
Using carrierwave-mongoid 0.7.1
Using timers 1.1.0
Using celluloid 0.15.2
Using choice 0.1.6
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.0.2
Using coffee-rails 4.0.1
Using hike 1.2.3
Using tilt 1.4.1
Using sprockets 2.11.0
Using sprockets-rails 2.0.1
Using rails 4.0.2
Using commands 0.2.1
Using css_parser 1.3.5
Using daemon_controller 1.2.0
Using daemons 1.1.9
Using orm_adapter 0.5.0
Using warden 1.2.3
Using devise 3.1.0
Using ejs 1.1.1
Using eventmachine 1.0.3
Using http_parser.rb 0.6.0
Using em-websocket 0.5.1
Using excon 0.38.0
Using factory_girl 4.4.0
Using faker 1.4.2
Using multipart-post 2.0.0
Using faraday 0.9.0
Using ffi 1.9.3
Using formatador 0.2.5
Using fog-core 1.23.0
Using fog-json 1.0.0
Using inflecto 0.0.2
Using fog-brightbox 0.1.1
Using fog-softlayer 0.3.11
Using ipaddress 0.8.0
Using fog 1.23.0
Using font-awesome-rails 4.1.0.0
Using rb-fsevent 0.9.4
Using rb-inotify 0.9.5
Using listen 2.7.9
Using lumberjack 1.0.9
Using method_source 0.8.2
Using slop 3.6.0
Using pry 0.10.0
Using guard 2.6.1
Using guard-livereload 2.3.0
Using haml 4.0.5
Using hashie 3.2.0
Using hirb 0.7.2
Using hpricot 0.8.6
Using htmlentities 4.3.2
Using jbuilder 1.5.3
Using jquery-rails 3.1.1
Using jwt 1.0.0
Using kaminari 0.16.1
Using launchy 2.4.2
Using letter_opener 1.2.0
I let it run for more than 30 minutes, but it still didn't get out of the loop. When I forced killed this process, I got an error saying that libv8 is not installed. I tried running this manually, but that didn't work either.
SystemExit: exit
An error occurred while installing libv8 (3.16.14.3), and Bundler cannot continue.
Make sure that `gem install libv8 -v '3.16.14.3'` succeeds before bundling.
I assumed that my settings are corrupt, and did rvm implode and tried setting up everything from scratch, but I was stuck with the same issue. I also ran a gem update --system just to check if everything upto date. Even that didn't help.
Here are some details,
Bundle version : 1.6.`
Ruby ruby 2.0.0p451 (2014-02-24 revision 45167) [x86_64-darwin12.5.0]
Not sure what is the issue. Am I missing something here?
Edit 1
This is the error I'm getting while installing libv8gem
Fetching: libv8-3.16.14.3.gem (100%)
Building native extensions. This could take a while...
ERROR: Error installing libv8:
ERROR: Failed to build gem native extension.
/Users/skmvasu/.rvm/rubies/ruby-2.0.0-p451/bin/ruby extconf.rb
creating Makefile
Compiling v8 for x64
Using python 2.7.5
Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/usr/include/c++/4.2.1
Unable to find a compiler officially supported by v8.
It is recommended to use GCC v4.4 or higher
Using compiler: g++
Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/usr/include/c++/4.2.1
Unable to find a compiler officially supported by v8.
It is recommended to use GCC v4.4 or higher
../src/cached-powers.cc:136:18: error: unused variable 'kCachedPowersLength' [-Werror,-Wunused-const-variable]
static const int kCachedPowersLength = ARRAY_SIZE(kCachedPowers);
^
1 error generated.
make[1]: *** [/Users/skmvasu/.rvm/gems/ruby-2.0.0-p451/gems/libv8-3.16.14.3/vendor/v8/out/x64.release/obj.target/preparser_lib/src/cached-powers.o] Error 1
make: *** [x64.release] Error 2
/Users/skmvasu/.rvm/gems/ruby-2.0.0-p451/gems/libv8-3.16.14.3/ext/libv8/location.rb:36:in `block in verify_installation!': libv8 did not install properly, expected binary v8 archive '/Users/skmvasu/.rvm/gems/ruby-2.0.0-p451/gems/libv8-3.16.14.3/vendor/v8/out/x64.release/obj.target/tools/gyp/libv8_base.a'to exist, but it was not found (Libv8::Location::Vendor::ArchiveNotFound)
from /Users/skmvasu/.rvm/gems/ruby-2.0.0-p451/gems/libv8-3.16.14.3/ext/libv8/location.rb:35:in `each'
from /Users/skmvasu/.rvm/gems/ruby-2.0.0-p451/gems/libv8-3.16.14.3/ext/libv8/location.rb:35:in `verify_installation!'
from /Users/skmvasu/.rvm/gems/ruby-2.0.0-p451/gems/libv8-3.16.14.3/ext/libv8/location.rb:26:in `install!'
from extconf.rb:7:in `<main>'
GYP_GENERATORS=make \
build/gyp/gyp --generator-output="out" build/all.gyp \
-Ibuild/standalone.gypi --depth=. \
-Dv8_target_arch=x64 \
-S.x64 -Dv8_enable_backtrace=1 -Dv8_can_use_vfp2_instructions=true -Darm_fpu=vfpv2 -Dv8_can_use_vfp3_instructions=true -Darm_fpu=vfpv3
CXX(target) /Users/skmvasu/.rvm/gems/ruby-2.0.0-p451/gems/libv8-3.16.14.3/vendor/v8/out/x64.release/obj.target/preparser_lib/src/allocation.o
CXX(target) /Users/skmvasu/.rvm/gems/ruby-2.0.0-p451/gems/libv8-3.16.14.3/vendor/v8/out/x64.release/obj.target/preparser_lib/src/atomicops_internals_x86_gcc.o
CXX(target) /Users/skmvasu/.rvm/gems/ruby-2.0.0-p451/gems/libv8-3.16.14.3/vendor/v8/out/x64.release/obj.target/preparser_lib/src/bignum.o
CXX(target) /Users/skmvasu/.rvm/gems/ruby-2.0.0-p451/gems/libv8-3.16.14.3/vendor/v8/out/x64.release/obj.target/preparser_lib/src/bignum-dtoa.o
CXX(target) /Users/skmvasu/.rvm/gems/ruby-2.0.0-p451/gems/libv8-3.16.14.3/vendor/v8/out/x64.release/obj.target/preparser_lib/src/cached-powers.o
extconf failed, exit code 1
Gem files will remain installed in /Users/skmvasu/.rvm/gems/ruby-2.0.0-p451/gems/libv8-3.16.14.3 for inspection.
Results logged to /Users/skmvasu/.rvm/gems/ruby-2.0.0-p451/extensions/x86_64-darwin-12/2.0.0-static/libv8-3.16.14.3/gem_make.out
Edit 2
I finally found the problem. My system updated to the latest version of Mavericks 10.9.4. There is some issue with a mac update and libv8 gem, that I don't fully understand, but I guess it has something to do with the old ruby setup. So, did an rvm implode and then installed it from scratch, and also reinstalled ruby. After that everything worked like a charm. If anyone is facing the same issue take a look at this thread https://github.com/cowboyd/libv8/issues/120. This might help shed some light to this issue.
libv8 is a C-binded lib, it's not a RVM issue, it's almost certainly a dependency issue in your system. Try googling for "install libv8 under macos" or try one of the alternative JS interpreters as explained on https://github.com/sstephenson/execjs (you should actually have this link in Gemfile by default)
The error is referencing a missing GCC compiler. It looks like you might be running OS X and Xcode. According to this answer How to use/install gcc on Mac OS X 10.8 / Xcode 4.4 you may have to tell Xcopy specifically that you want the command line tools installed.
Ultimately just go to the "Preferences" menu in Xcode, choose "Downloads", and then select "Command Line Tools" from the list to install them.

Gem Installer Extension Build error

I'm trying to update gem file from a freshly created Rails app. Each time I get the following:
Fetching gem metadata from https://rubygems.org/..........
Fetching gem metadata from https://rubygems.org/..
Resolving dependencies...
Using rake (10.1.0)
Using i18n (0.6.5)
Using minitest (4.7.5)
Using multi_json (1.8.2)
Using atomic (1.1.14)
Using thread_safe (0.1.3)
Using tzinfo (0.3.38)
Using activesupport (4.0.0)
Using builder (3.1.4)
Using erubis (2.7.0)
Using rack (1.5.2)
Using rack-test (0.6.2)
Using actionpack (4.0.0)
Using mime-types (1.25)
Using polyglot (0.3.3)
Using treetop (1.4.15)
Using mail (2.5.4)
Using actionmailer (4.0.0)
Using activemodel (4.0.0)
Using activerecord-deprecated_finders (1.0.3)
Using arel (4.0.1)
Using activerecord (4.0.0)
Using bundler (1.3.5)
Using coffee-script-source (1.6.3)
Using execjs (2.0.2)
Using coffee-script (2.2.0)
Using thor (0.18.1)
Using railties (4.0.0)
Using coffee-rails (4.0.1)
Using hike (1.2.3)
Using jbuilder (1.5.2)
Using jquery-rails (3.0.4)
Installing json (1.8.1)
Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.
/Users/adrianleeelder/.rvm/rubies/ruby-2.0.0-p0/bin/ruby extconf.rb
creating Makefile
make
compiling generator.c
make: gcc-4.2: No such file or directory
make: *** [generator.o] Error 1
Gem files will remain installed in /Users/adrianleeelder/.rvm/gems/ruby-2.0.0-p0/gems/json-1.8.1 for inspection.
Results logged to /Users/adrianleeelder/.rvm/gems/ruby-2.0.0-p0/gems/json-1.8.1/ext/json/ext/generator/gem_make.out
An error occurred while installing json (1.8.1), and Bundler cannot continue.
Make sure that `gem install json -v '1.8.1'` succeeds before bundling.
I updated to OS X Mavericks a while back and ever since I have had this problem. A lot of users are suggesting to run the command: xcode-select --install.
I fixed the error by doing the following:
1) Run the command which gcc
2) Then based on the output adjust this command and run it: ln -s /usr/bin/gcc /usr/bin/gcc-4.2 (May have to prepend sudo if permission is denied)
The bundle command should compile the gems correctly now.
Installing Xcode will also work. I had already installed Xcode, but for some reason when I tried to launch it recently it prompted an install. Using Alfred (the quick launch application) I typed Xcode and launched the installer.
I fixed the error through homebrew using the following:
brew tap homebrew/versions && brew install apple-gcc42
brew link --force apple-gcc42
ln -nsf $(which gcc-4.2) /usr/bin/gcc-4.2
You may have to 'sudo' for the last command if you get permission issues.

I exited out of terminal, re-opened, now every time I run rspec I get this error, what gives?

Seriously have no idea what has happened any help would be great thanks.
GacntMac in ~/Desktop/rails_projects/sample_app on updating-users
+ bundle install (Tue, Feb 05)
Fetching gem metadata from https://rubygems.org/.........
Fetching gem metadata from https://rubygems.org/..
Using rake (10.0.3)
Using i18n (0.6.1)
Using multi_json (1.5.0)
Using activesupport (3.2.11)
Using builder (3.0.4)
Using activemodel (3.2.11)
Using erubis (2.7.0)
Using journey (1.0.4)
Using rack (1.4.4)
Using rack-cache (1.2)
Using rack-test (0.6.2)
Using hike (1.2.1)
Using tilt (1.3.3)
Using sprockets (2.2.2)
Using actionpack (3.2.11)
Using mime-types (1.20.1)
Using polyglot (0.3.3)
Using treetop (1.4.12)
Using mail (2.4.4)
Using actionmailer (3.2.11)
Using arel (3.0.2)
Using tzinfo (0.3.35)
Using activerecord (3.2.11)
Using activeresource (3.2.11)
Installing bcrypt-ruby (3.0.1) with native extensions
Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby extconf.rb
mkmf.rb can't find header files for ruby at /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/ruby.h
Gem files will remain installed in /Users/GacntMac/.bundler/tmp/2663/gems/bcrypt-ruby-3.0.1 for inspection.
Results logged to /Users/GacntMac/.bundler/tmp/2663/gems/bcrypt-ruby-3.0.1/ext/mri/gem_make.out
An error occurred while installing bcrypt-ruby (3.0.1), and Bundler cannot continue.
Make sure that `gem install bcrypt-ruby -v '3.0.1'` succeeds before bundling.
GacntMac in ~/Desktop/rails_projects/sample_app on updating-users
I cd'd to the directory the error says ruby.h should be in, but I don't see anything..
GacntMac in /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby
o ls -a (Tue, Feb 05)
. .. 1.8 gems site_ruby user-gems vendor_ruby
Edit: Added rvm info
GacntMac in /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby
o rvm info (Tue, Feb 05)
-bash: rvm: command not found
This is weird cause I've been playing with Rails for days, now it some how uninstalled its self?
This only started happening since I exited out of terminal and re-opened it. I'm lost and new to Rails so I have no idea what any of this means, just trying to follow a tutorial. Thanks!
You are trying to install software into the system installation of Ruby, put there by Apple.
RVM or rbenv will install things into a private sandbox in your home directory. The error shows the file isn't going there, so your RVM or rbenv isn't initialized correctly.
If you run RVM, execute rvm info from the command-line, and look at the information output, as a sanity check.

$ bundle install: Failed to build gem native extension

Using Snow leopard, Rails 3.0.3, ruby 1.9.2p0 and RVM. When trying to install bundle I get:
[first_app]$ bundle install
Fetching source index for http://rubygems.org/
Using rake (0.8.7)
Using abstract (1.0.0)
Using activesupport (3.0.3)
Using builder (2.1.2)
Using i18n (0.5.0)
Using activemodel (3.0.3)
Using erubis (2.6.6)
Using rack (1.2.1)
Using rack-mount (0.6.13)
Using rack-test (0.5.7)
Using tzinfo (0.3.24)
Using actionpack (3.0.3)
Using mime-types (1.16)
Using polyglot (0.3.1)
Using treetop (1.4.9)
Using mail (2.2.14)
Using actionmailer (3.0.3)
Using arel (2.0.7)
Using activerecord (3.0.3)
Using activeresource (3.0.3)
Using bundler (1.0.7)
Using thor (0.14.6)
Using railties (3.0.3)
Using rails (3.0.3)
Installing sqlite3 (1.3.3) with native extensions /Users/dawson/.rvm/rubies/ruby-1.9.2-p
0/lib/ruby/1.9.1/rubygems/installer.rb:483:in `rescue in block in build_extensions': ERROR: Failed to build gem native extension. (Gem::Installer::ExtensionBuildError)
/Users/dawson/.rvm/rubies/ruby-1.9.2-p0/bin/ruby extconf.rb
checking for sqlite3.h... *** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of
necessary libraries and/or headers. Check the mkmf.log file for more
details. You may need configuration options.
You are missing some libraries on your system related to sqlite. This is a common problem with gems that depend on libraries which should be installed on your computer. try installing libsqlite3-dev.
I ran into almost exactly this problem (Snow Leopard, Ruby1.9.2-p0, RVM, Rails 3.1.0rc4, with developer tools installed), and resolved it by upgrading to a newer patch level of Ruby.
Using RVM, you'd write:
rvm upgrade ruby-1.9.2-p180 ruby-1.9.2-p0
(180 is the current patch, but there might be a newer one when you try this. Use the stable release version named here: http://www.ruby-lang.org/en/downloads/)
Try:
gem "sqlite-ruby", "~> 1.3.1"
You may be having issues because you're on Ruby 1.9. This gem is said to work with 1.9:
http://isitruby19.com/sqlite3-ruby
Use 'sudo bundle install' since native extensions try to write in system directories.
sudo -s
export ARCHFLAGS='-arch x86_64'
export PATH=/Library/PostgreSQL/9.1/bin:${PATH}
gem install pg

Error Installing rails on Ubuntu 10.04

I am trying to install rails on Ubuntu 10.04. So far, I've executed these commands:
apt-get install build-essential libapache2-mod-passenger apache2 rubygems ruby1.8-dev libopenssl-ruby
gem install fastthread
gem install rails
Fastthread installed easily. However, trying to install rails results in:
ERROR: Error installing rails:
bundler requires RubyGems version >= 1.3.6
So, I tried gem -v which returned 1.3.5.
How do I upgrade rubygems? apt-get won't install above 1.3.5. And gem update --system results in:
ERROR: While executing gem ... (RuntimeError)
gem update --system is disabled on Debian. RubyGems can be updated using the official Debian repositories by aptitude or apt-get.
So right now I simply can't install rails, because I need a newer version of rubygems, and ubuntu won't let me upgrade my current version of rubygems.
As a side note, i tried installed rails via apt-get install rails which seemed to work, but I don't see rails as a gem when i type gem list. What's the deal with that?
Another note: The result of gem list is:
*** LOCAL GEMS ***
abstract (1.0.0)
actionmailer (3.0.1, 3.0.0)
actionpack (3.0.1, 3.0.0)
activemodel (3.0.1, 3.0.0)
activerecord (3.0.1, 3.0.0)
activeresource (3.0.1, 3.0.0)
activesupport (3.0.1, 3.0.0)
arel (2.0.1, 1.0.1)
builder (2.1.2)
erubis (2.6.6)
fastthread (1.0.7)
i18n (0.4.2)
mail (2.2.9)
mime-types (1.16)
mysql (2.8.1)
polyglot (0.3.1)
rack (1.2.1)
rack-mount (0.6.13)
rack-test (0.5.6)
railties (3.0.1, 3.0.0)
rake (0.8.7)
rubygems-update (1.3.7)
thor (0.14.4)
treetop (1.4.8)
tzinfo (0.3.23)
I assume installing rails via apt-get installed those gems? Prior to installing rails through apt-get I only had mysql and fastthread.
There is also a gem available which handles the update
sudo gem install rubygems-update
sudo /var/lib/gems/1.8/bin/update_rubygems
You have to manually install rubygems 1.3.7 (wget from website, extract, run setup.rb).
Install rvm and take control of your ruby environment.
http://rvm.io/
This may be a newer way of doing it that wasn't available before, but I ran
sudo gem update --system
and it gave me the latest version.
For some reason, Debian/Ubuntu Ruby package doesn't include the RubyGems library. Even worst, RubyGems has been bundled into Ruby 1.9.x but if you try to install it via apt-get, the package manager will force you to install them as two separate packages.
Debian/Ubuntu RubyGems package is outdated, as you noticed, and to make things even more complicated you can't upgrade the packaged version of RubyGems just installing a new RubyGems versions on top of it because the system is patched to prevent you to complete the task, as you experienced.
My suggestion is to avoid using the Ubuntu/Debian pckaged version.
The alternatives are:
for a development system, use RVM
for a production server, install Ruby from source. If you want Ruby < 1.9 you can use Ruby Enterprise edition that is also available as Debian/Ubuntu package. If you want Ruby 1.9.x, compile it from the source.

Resources