ruby:rubygems:server
差分
このページの2つのバージョン間の差分を表示します。
| 次のリビジョン | 前のリビジョン | ||
| ruby:rubygems:server [2018/06/25 09:40] – 外部編集 127.0.0.1 | ruby:rubygems:server [2018/07/20 14:26] (現在) – taka | ||
|---|---|---|---|
| 行 1: | 行 1: | ||
| - | ====== Ruby - 共有サーバー等での RubyGems インストール ====== | + | ====== Ruby - 共有サーバー等でのRubyGemsインストール ====== |
| + | |||
| + | ===== はじめに | ||
| 私が利用している「さくらインターネット」での、RubyGemsによるモジュールのインストール方法。\\ | 私が利用している「さくらインターネット」での、RubyGemsによるモジュールのインストール方法。\\ | ||
| ここのレンタルサーバーではスタンダードプラン以上であればSSHを使ったシェルログインが利用できる。\\ | ここのレンタルサーバーではスタンダードプラン以上であればSSHを使ったシェルログインが利用できる。\\ | ||
| - | **1. RubyGems用の作業ディレクトリを作成する。** | + | ==== 1. RubyGems用の作業ディレクトリを作成する |
| - | <sxh bash; gutter: false;> | + | <sxh bash; gutter: |
| - | % mkdir -p ~/local/src | + | $ mkdir -p ~/local/src |
| </ | </ | ||
| - | **2. RubyGems本体をダウンロードし、解凍する。** | + | ==== 2. RubyGems本体をダウンロードし、解凍する |
| - | <sxh bash; gutter: false;> | + | <sxh bash; gutter: |
| - | % cd ~/ | + | $ cd ~/ |
| - | % wget http:// | + | $ wget http:// |
| - | % tar xzvf rubygems-1.8.24.tgz | + | $ tar xzvf rubygems-1.8.24.tgz |
| </ | </ | ||
| ※最新のバージョンは[[http:// | ※最新のバージョンは[[http:// | ||
| - | **3. RubyGems本体をインストールする。** | + | ==== 3. RubyGems本体をインストールする |
| - | <sxh bash; gutter: false;> | + | <sxh bash; gutter: |
| - | % cd rubygems-1.8.24 | + | $ cd rubygems-1.8.24 |
| - | % ruby setup.rb config --prefix=$HOME/ | + | $ ruby setup.rb config --prefix=$HOME/ |
| </ | </ | ||
| - | **4. 環境設定ファイルを開き環境変数を設定する。** | + | ==== 4. 環境設定ファイルを開き環境変数を設定する |
| - | <sxh bash; gutter: false;> | + | <sxh bash; gutter: |
| - | % vi ~/.cshrc | + | $ vi ~/.cshrc |
| </ | </ | ||
| - | <sxh bash; gutter: | + | <sxh bash; gutter:false;> |
| # $FreeBSD: src/ | # $FreeBSD: src/ | ||
| # | # | ||
| 行 61: | 行 63: | ||
| if ($?prompt) then | if ($?prompt) then | ||
| - | | + | |
| - | set filec | + | set filec |
| - | set history = 100 | + | set history = 100 |
| - | set savehist = 100 | + | set savehist = 100 |
| - | set mail = (/ | + | set mail = (/ |
| - | if ( $?tcsh ) then | + | if ( $?tcsh ) then |
| - | bindkey " | + | bindkey " |
| - | bindkey -k up history-search-backward | + | bindkey -k up history-search-backward |
| - | bindkey -k down history-search-forward | + | bindkey -k down history-search-forward |
| - | endif | + | endif |
| endif | endif | ||
| </ | </ | ||
| - | **5. 環境変数の設定を反映させる。** | + | ==== 5. 環境変数の設定を反映させる |
| - | <sxh bash; gutter: false;> | + | <sxh bash; gutter: |
| - | % source ~/.cshrc | + | $ source ~/.cshrc |
| </ | </ | ||
| - | **6. あとは通常通りインストールを行う。** | + | ==== 6. 通常通りインストールを行う |
| <color red> | <color red> | ||
| - | <sxh bash; gutter: false;> | + | <sxh bash; gutter: |
| - | % setenv RB_USER_INSTALL true | + | $ setenv RB_USER_INSTALL true |
| - | % gem install hoge | + | $ gem install hoge |
| </ | </ | ||
| - | **7. スクリプト側での設定も併せて行う。** | + | ==== 7. スクリプト側での設定も併せて行う |
| ライブラリの場所を指定してやらないと動かないようなので、インストールしたライブラリのうち利用するものの場所を教えてやる必要がある。 | ライブラリの場所を指定してやらないと動かないようなので、インストールしたライブラリのうち利用するものの場所を教えてやる必要がある。 | ||
| - | <sxh ruby; gutter: true;> | + | <sxh ruby> |
| # | # | ||
| # coding: utf-8 | # coding: utf-8 | ||
| - | Dir.chdir( File.dirname( $0 ) ) | + | Dir.chdir(File.dirname($0)) |
| - | $LOAD_PATH.push( | + | $LOAD_PATH.push("/ |
| - | $LOAD_PATH.push( | + | $LOAD_PATH.push("/ |
| - | $LOAD_PATH.push( | + | $LOAD_PATH.push("/ |
| - | $LOAD_PATH.push( | + | $LOAD_PATH.push("/ |
| - | require | + | require |
| - | require | + | require |
| - | require | + | require |
| </ | </ | ||
ruby/rubygems/server.1529887234.txt.gz · 最終更新: 2018/06/25 09:40 by 127.0.0.1