Qiita Teams that are logged in
You are not logged in to any team

Log in to Qiita Team
Community
OrganizationEventAdvent CalendarQiitadon (β)
Service
Qiita JobsQiita ZineQiita Blog
135
Help us understand the problem. What are the problem?

More than 5 years have passed since last update.

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

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
Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
135
Help us understand the problem. What are the problem?