번들 : 명령을 찾을 수 없습니다
일부 자습서에 따라 vps, 우분투 10.04, 레일 3, 루비 및 mysql을 올바르게 설치했습니다. 실행 bundle check
하거나 bundle install
'-bash : bundle : command not found'오류가 발생합니다. 에서 gem list --local
나는 '번 들러 (1.0.2, 1.0.0)'참조 설치됩니다.
무슨 일인지 잘 모르겠습니다 ...
gem environment
보고:
RubyGems Environment:
- RUBYGEMS VERSION: 1.3.7
- RUBY VERSION: 1.8.7 (2010-04-19 patchlevel 253) [i686-linux]
- INSTALLATION DIRECTORY: /opt/ruby-enterprise-1.8.7-2010.02/lib/ruby/gems/1.8
- RUBY EXECUTABLE: /opt/ruby-enterprise-1.8.7-2010.02/bin/ruby
- EXECUTABLE DIRECTORY: /opt/ruby-enterprise-1.8.7-2010.02/bin
- RUBYGEMS PLATFORMS:
- ruby
- x86-linux
- GEM PATHS:
- /opt/ruby-enterprise-1.8.7-2010.02/lib/ruby/gems/1.8
- /root/.gem/ruby/1.8
- GEM CONFIGURATION:
- :update_sources => true
- :verbose => true
- :benchmark => false
- :backtrace => false
- :bulk_threshold => 1000
- REMOTE SOURCES:
- http://rubygems.org/
그리고 다음을 echo $PATH
반환합니다.
/opt/myruby/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/bin/gem:/opt/ruby-enterprise-1.8.7-2010.02/lib/ruby/gems/1.8/gems/:/root/.gem/ruby/1.8
그리고 다음을 which gem
반환합니다.
/usr/bin/gem
locate bundle
보고:
/opt/ruby-enterprise-1.8.7-2010.02/lib/ruby/gems/1.8/
ruby gem 실행 디렉토리를 경로에 추가해야합니다
export PATH=$PATH:/opt/ruby-enterprise-1.8.7-2010.02/bin
내 문제는 내가 한 것입니다.
sudo gem install bundler
그래서 나는 나 자신이 아닌 루트로 설치했습니다. 그래서 루트로 제거한 다음 나 자신으로 설치했습니다.
sudo gem uninstall bundler
gem install bundler
rbenv rehash
(rbenv를 사용하는 경우 마지막 명령)
그리고 효과가있었습니다. 은 "정확한"경로 이었다 에 .bashrc
(또는 다른 쉘 프로파일) 최소한 항
$PATH
=> zsh: /Users/myself/.rbenv/shims:/Users/myself/.rbenv/bin: ... etc
그러나 그것은 루트가 아닌 나 자신을 위해 설치 될 것으로 기대했습니다. 제 경우에는 올바른 설치 장소가~/.rbenv/versions/1.9.3-p194/lib/ruby/gems/1.9.1/gems/bundler
... 데비안 GNU / 리눅스 6.0 :)
export PATH=$PATH:/var/lib/gems/1.8/bin
나는 이것을했다 (2013 년 3 월 현재 우분투 최신 생각 :)] :
sudo gem install bundler
크레딧은 Ray Baxter 로갑니다 .
보석이 필요한 경우 Ruby를 이런 식으로 설치했습니다 (만성적으로 과세 대상 임).
mkdir /tmp/ruby && cd /tmp/ruby
wget http://ftp.ruby-lang.org/pub/ruby/1.9/ruby-1.9.3-p327.tar.gz
tar xfvz ruby-1.9.3-p327.tar.gz
cd ruby-1.9.3-p327
./configure
make
sudo make install
우분투 11.10을 실행 중이며 번들 실행 파일이 다음 위치에 있습니다.
/var/lib/gems/1.8/bin
내 솔루션은 해당 리포지토리에 Ruby 버전을 선택했는지 확인하는 것이 었습니다.
예 : chruby 2.2.2
또는rvm use 2.2.2
λ bundle install
zsh: command not found: bundle
λ ruby -v
ruby 1.9.3p484 (2013-11-22 revision 43786) [x86_64-linux]
### Notice the system Ruby version isn't included in chruby
λ chruby
ruby-1.9.3-p551
ruby-2.1.2
ruby-2.2.1
### Select a version via your version manager
λ chruby 1.9.3
### Ensure your version manager properly selects a version (*)
λ chruby
* ruby-1.9.3-p551
ruby-2.1.2
ruby-2.2.1
λ bundle install
Fetching gem metadata from https://rubygems.org/.........
아마도 distro-proof 경로는 쉘이 무엇이든 .bashrc 또는 .zshrc에 이것을 추가하고 있습니다.
PATH="$(ruby -e 'print Gem.default_dir')/bin:$PATH"
또는 사용자 전체에 gem을 설치 한 경우 다음을 사용하십시오.
PATH="$(ruby -e 'print Gem.user_dir')/bin:$PATH"
Step 1:Make sure you are on path actual workspace.For example, workspace/blog $: Step2:Enter the command: gem install bundler. Step 3: You should be all set to bundle install or bundle update by now
I think bundle executable is on :
/opt/ruby-enterprise-1.8.7-2010.02/lib/ruby/gems/1.8/gems/bin
and it's not in your $PATH
Make sure you do rbenv rehash
when installing different rubies
You can also create a symlink:
ln -s /opt/ruby-enterprise-1.8.7-2010.02/lib/ruby/gems/1.8/gems/bin/bundle /usr/bin/bundle
I had the exact same issue and was able to resolve it by running
rbenv rehash
After that bundle
worked as expected. Upon taking a look at the rbenv wiki entry it does mention that rehash should be run when an installed gem provides commands.
Installs shims for all Ruby executables known to rbenv (i.e., ~/.rbenv/versions//bin/). Run this command after you install a new version of Ruby, or install a gem that provides commands.
Apparently this is such an annoyance that some folks have written a gem to make sure you never need to run rehash
again. rbenv-gem-rehash
On my Arch Linux install, gems were installed to the ~/.gem/ruby/2.6.0/bin
directory if installed as user, or /root/.gem/ruby/2.6.0/bin
if installed via sudo
. Just append the appropriate one to your $PATH
environment variable:
export PATH=$PATH:/home/your_username/.gem/ruby/2.6.0/bin
참고URL : https://stackoverflow.com/questions/3914694/bundle-command-not-found
'IT박스' 카테고리의 다른 글
서비스 참조 오류 : 서비스 참조에 대한 코드를 생성하지 못했습니다. (0) | 2020.06.30 |
---|---|
나뭇 가지 PHP의 삼항 연산자 (if-then-else의 짧은 형태) (0) | 2020.06.30 |
python jinja 템플릿에서 loop.counter를 출력하는 방법은 무엇입니까? (0) | 2020.06.29 |
jQueryUI 툴팁이 Twitter 부트 스트랩과 경쟁하고 있습니다 (0) | 2020.06.29 |
“@ angular / core”에 의존하지 않는 것 같습니다. (0) | 2020.06.29 |