Skip to content

Instantly share code, notes, and snippets.

@naoto
Created October 29, 2010 00:32
Show Gist options
  • Save naoto/652642 to your computer and use it in GitHub Desktop.
Save naoto/652642 to your computer and use it in GitHub Desktop.
centOS で ruby を make

CentOS で ruby を make

ruby 1.8.7

$> wget ftp://ftp.ruby-lang.org/pub/ruby/1.8/ruby-1.8.7-p302.tar.gz
$> tar zxvf ruby-1.8.7-p302.tar.gz
$> cd ruby-1.8.7-p302
$> ./configure
$> ./make
$> sudo ./make install

$> ruby --version

rubygems 1.3.7

$> wget http://rubyforge.org/frs/download.php/70696/rubygems-1.3.7.tgz
$> tar zxvf rubygems-1.3.7.tgz
$> cd rubygems-1.3.7
$> sudo ruby setup.rb

この状態では zlib でエラーが出る

$> gem update --system
ERROR:  Loading command: update (LoadError)
no such file to load -- zlib
ERROR:  While executing gem ... (NameError)
uninitialized constant Gem::Commands::UpdateCommand

zlib を入れる

$> sudo yum install zlib-devel
$> cd ruby-1.8.7-p302/ext/zlib
$> ruby extconf.rb
$> make
$> sudo make install

完了

$> gem env
RubyGems Environment:
  - RUBYGEMS VERSION: 1.3.7
  - RUBY VERSION: 1.8.7 (2010-08-16 patchlevel 302) [i686-linux]
  - INSTALLATION DIRECTORY: /home/naoto/.gem/ruby/1.8
  - RUBY EXECUTABLE: /usr/local/bin/ruby
  - EXECUTABLE DIRECTORY: /home/naoto/.gem/ruby/1.8/bin
  - RUBYGEMS PLATFORMS:
    - ruby
    - x86-linux
  - GEM PATHS:
     - /home/naoto/.gem/ruby/1.8
     - /usr/local/lib/ruby/gems/1.8
  - GEM CONFIGURATION:
     - :update_sources => true
     - :verbose => true
     - :benchmark => false
     - :backtrace => false
     - :bulk_threshold => 1000
  - REMOTE SOURCES:
     - http://rubygems.org/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment