LoginSignup
28
31

More than 5 years have passed since last update.

bundleコマンドのパスを通す方法

Posted at

はじめに

bundlerをインストール後にGemfileを書いて、必要なライブラリをインストールするためにbundleコマンドを
実行する必要がありますが、bundleコマンドのPATHが通っていない場合があります。
ここではその対処法をメモしています。

bundleコマンドのPATHを通す方法

bundlerをインストールする:

gem install bundler

EXECUTABLE DIRECTORYのPATHを確認する

$ gem environment
RubyGems Environment:
  - RUBYGEMS VERSION: 2.0.14
  - RUBY VERSION: 2.0.0 (2013-11-22 patchlevel 353) [x86_64-linux]
  - INSTALLATION DIRECTORY: /home/dev/.rbenv/versions/2.0.0-p353/lib/ruby/gems/2.0.0
  - RUBY EXECUTABLE: /home/dev/.rbenv/versions/2.0.0-p353/bin/ruby
  - EXECUTABLE DIRECTORY: /home/dev/.rbenv/versions/2.0.0-p353/bin <-ここ
  - RUBYGEMS PLATFORMS:
    - ruby
    - x86_64-linux
  - GEM PATHS:
     - /home/dev/.rbenv/versions/2.0.0-p353/lib/ruby/gems/2.0.0
     - /home/dev/.gem/ruby/2.0.0
  - GEM CONFIGURATION:
     - :update_sources => true
     - :verbose => true
     - :backtrace => false
     - :bulk_threshold => 1000
  - REMOTE SOURCES:
     - https://rubygems.org/

PATHを通す

$ echo $HOME
/home/dev

$ echo 'export PATH="$HOME/.rbenv/versions/2.0.0-p353/bin:$PATH"' >> ~/.bash_profile 

$ source ~/.bash_profile 

$ bundle -v
Bundler version 1.7.3
28
31
1

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
28
31