【ruby】【linux】CentOS上安裝配置ruby開發環境

來源:互聯網
上載者:User
1.安裝編譯環境gcc
  使用yum install gcc線上安裝

2.安裝ruby開發環境
  先下載linux版安裝檔案:ruby-1.8.6-p111.tar.gz
  執行

  1. tar -zxvf ruby-1.8.6-p111.tar.gz
  2. cd ruby-1.8.6-p111
  3. ./configure --prefix=/usr/local/ruby
  4. make
  5. make install

3.安裝RubyGems,RubyGems是用來安裝ruby擴充包的模組,必要安裝
  安裝檔案:zlib-1.2.3.tar.gz
            rubygems-0.9.4.tgz
  執行

  1. tar -zxvf zlib-1.2.3.tar.gz
  2. cd zlib-1.2.3
  3. #install static lib
  4. ./configure
  5. make test
  6. make install
  7. make clean
  8. #install share lib
  9. ./configure --shared
  10. make test
  11. make install
  12. #copy header files
  13. cp zutil.h /usr/local/include
  14. cp zutil.c /usr/local/include
  15. #ruby zlib
  16. cd ruby-1.8.6/ext/zlib
  17. ruby extconf.rb --with-zlib-include=/usr/include --with-zlib-lib=/usr/lib
  18. make
  19. make install
  20. cd ../..
  21. make clean
  1. tar -zxvf rubygems-0.9.4.tgz
  2. cd rubygems-0.9.4
  3. ruby setup.rb

以後就可以任意安裝rubyforge下的gem包了,使用gem install -y -l filename.gem命令安裝
 

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.