gem と gem の依存関係を管理するにはrvm
、 andを使用することをお勧めします。bundler
システム全体に gem をインストールすることはありません。特に Mac では、システム全体の gem を扱うのが非常に面倒になる可能性があります。
rvm + bundler を起動して開始するのは簡単です。
まず、rvm をインストールします (git が必要です)。
bash < <( curl http://rvm.beginrescueend.com/releases/rvm-install-head )
# this will be installed on your $HOME/.rvm directory
rvm のセットアップ
echo "source $HOME/.rvm/scripts/rvm" >> $HOME/.bash_profile
source "$HOME/.rvm/scripts/rvm"
次に、rvm 経由で Ruby をインストールします。
rvm install ree # Ruby Enterprise Edition or,
# rvm install 1.9.2
# rvm install 1.8.7
Ruby コンパイラに切り替える
rvm use ree
gemset を作成して、さまざまな gem バージョンに簡単に切り替えることができます。
rvm gemset create rails3 # where rails3 is the gemset name
gemset を使用する
rvm use ree@rails3
バンドラーをインストールする
gem install bundler # without sudo
Gemfile を作成し、gem をインストールします。
mkdir myproject
cd myproject
bundle init # this will create a Gemfile
echo "gem 'rails'" >> Gemfile
echo "gem 'sqlite3-ruby', :require => 'sqlite3'" >> Gemfile
bundle install
元の投稿については、システムのインストールの場合は、実行して確認できます。which sqlite3_ruby
返され/usr/bin/sqlite3_ruby
た場合は、コマンドの前に追加sudo
する必要がありますgem uninstall
。