139
137

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

bundleコマンドにパスが通っていなかったときの対処法

Posted at

bundlerをインストールする。

$ gem install bundler

確認のためbundle -vを実行する。

$ bundle -v
-bash: bundle: command not found

command not foundと言われてしまった。
どこにインストールされたか確認する。

$ gem contents bundler | grep bin
/home/deploy/.gem/ruby/2.0.0/gems/bundler-1.5.1/bin/bundle

/home/deploy/.gem/ruby/2.0.0/gems/bundler-1.5.1/binの下に発見した。
しかし、これをPATHに設定するとバージョンアップの度に更新しなければならない。

そんなバカな!

$ gem environment
RubyGems Environment:
  - RUBYGEMS VERSION: 2.0.12
  - RUBY VERSION: 2.0.0 (2013-11-22 patchlevel 353) [x86_64-linux]
  - INSTALLATION DIRECTORY: /home/deploy/.gem/ruby/2.0.0
  - RUBY EXECUTABLE: /usr/bin/ruby20
  - EXECUTABLE DIRECTORY: /home/deploy/.gem/ruby/2.0.0/bin
  - RUBYGEMS PLATFORMS:
    - ruby
    - x86_64-linux
  - GEM PATHS:
     - /home/deploy/.gem/ruby/2.0.0
     - /usr/local/lib64/ruby/gems/2.0.0
     - /usr/lib64/ruby/gems/2.0.0
  - GEM CONFIGURATION:
     - :update_sources => true
     - :verbose => true
     - :backtrace => false
     - :bulk_threshold => 1000
     - "gem" => "--no-ri --no-rdoc"
  - REMOTE SOURCES:
     - https://rubygems.org/

EXECUTABLE DIRECTORYを使いましょう。

$ echo 'export PATH="$HOME/.gem/ruby/2.0.0/bin:$PATH"' >> ~/.bashrc
$ source ~/.bashrc
$ bundle -v
Bundler version 1.5.1
139
137
0

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
139
137

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?