Ubuntu 9.10
newgemをインストールしたばかりです
gem install newgem
そして私が試してみると
newgem new_project
分かりました
adam@adam-ubuntu:~$ newgem newproject
newgem: command not found
echo /Users/itayayuuicularu/Documents/src/markdown_blog/.bundle/ruby/2.7.0/bin:/Users/itayayuuicularu/.rbenv/versions/2.7.6/bin:/usr/local/Cellar 経由でパスを確認しました/rbenv/1.2.0/libexec:/Users/itayayuuicularu/Library/Caches/fnm_multishells/95109_1713691261324/bin:/Users/itayayuuicularu/Library/Application Support/fnm:/opt/homebrew/opt/openssl@3/bin:/ Users/itayayuuicularu/Library/Caches/fnm_multishells/95018_1713691261250/bin:/Users/itayayuuicularu/.rbenv/shims:/Users/itayayuuicularu/.nodebrew/current/bin:/usr/local/opt/php@7.4/sbin:/ usr/local/opt/php@7.4/bin:/usr/local/opt/libxml2/bin:/Users/itayayuuicularu/.phpenv/shims:/opt/homebrew/opt/tidy-html5/lib:/opt/homebrew /opt/icu4c/bin:/opt/homebrew/opt/openssl@1.1/bin:/opt/homebrew/opt/krb5/bin:/opt/homebrew/opt/libiconv/bin:/opt/homebrew/opt/curl /bin:/opt/homebrew/opt/bzip2/bin:/opt/homebrew/opt/libxml2/bin:/opt/homebrew/opt/bison/bin:/Users/itayayuuicularu/.phpenv/bin:/Users/itayayuuicularu /bin:/usr/local/bin:/System/Cryptexes/App/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin:/var/run/com.apple.security.cryptexd/ codex.system/bootstrap/usr/local/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin:/var/run/com.apple.security.cryptexd/codex。 system/bootstrap/usr/appleinternal/bin:/Library/Apple/usr/bin:/Users/itayayuuicularu/.fzf/bin:/Users/itayayuuicularu/Documents/SDKs/flutter/bin
adam@adam-ubuntu:~$ echo $PATH
/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/home/adam/.gem
そして私の宝石環境
adam@adam-ubuntu:~$ gem environment
RubyGems Environment:
- RUBYGEMS VERSION: 1.3.6
- RUBY VERSION: 1.8.7 (2009-06-12 patchlevel 174) [x86_64-linux]
- INSTALLATION DIRECTORY: /usr/lib/ruby/gems/1.8
- RUBY EXECUTABLE: /usr/bin/ruby1.8
- EXECUTABLE DIRECTORY: /usr/bin
- RUBYGEMS PLATFORMS:
- ruby
- x86_64-linux
- GEM PATHS:
- /usr/lib/ruby/gems/1.8
- /home/adam/.gem/ruby/1.8
- GEM CONFIGURATION:
- :update_sources => true
- :verbose => true
- :benchmark => false
- :backtrace => false
- :bulk_threshold => 1000
- REMOTE SOURCES:
- http://rubygems.org/
パスなどについては詳しくありませんが、上記のすべての gem ディレクトリはパス上にあるのに、なぜコマンドが見つからないのでしょうか?
/php@7.4/bin:/usr/local/opt/libxml2/bin:/Users/itayayuuicularu/.phpenv/shims:/opt/homebrew/opt/tidy-html5/lib:/opt/homebrew/opt/icu4c/ /appleinternal/bin:/Library/Apple/usr/bin:/Users/itayayuuicularu/.fzf/bin:/Users/itayayuuicularu/Documents/SDKs/flutter/bin 変数には、Ruby の bin ディレクトリへの正確なパスを含める必要があります。bin:/opt/homebrew/opt/openssl@1.1/bin:/opt/homebrew/opt/krb5/bin:/opt/homebrew/opt/libiconv/bin:/opt/homebrew/opt/curl/bin:/opt ディレクトリを PATH に追加しても、そのサブフォルダーは含まれません。あなたの /Users/itayayuuicularu/Documents/src/markdown_blog/.bundle/ruby/2.7.0/bin:/Users/itayayuuicularu/.rbenv/versions/2.7.6/bin:/usr/local/Cellar/rbenv/1.2。 次の方法で bin ディレクトリを追加してみてください。/homebrew/opt/bzip2/bin:/opt/homebrew/opt/libxml2/bin:/opt/homebrew/opt/bison/bin:/Users/itayayuuicularu/.phpenv/bin:/Users/itayayuuicularu/bin:/usr 0/libexec:/Users/itayayuuicularu/Library/Caches/fnm_multishells/95109_1713691261324/bin:/Users/itayayuuicularu/Library/Application Support/fnm:/opt/homebrew/opt/openssl@3/bin:/Users/itayayuuicularu/Library /local/bin:/System/Cryptexes/App/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap /Caches/fnm_multishells/95018_1713691261250/bin:/Users/itayayuuicularu/.rbenv/shims:/Users/itayayuuicularu/.nodebrew/current/bin:/usr/local/opt/php@7.4/sbin:/usr/local/opt /usr/local/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr
export PATH=$PATH:/home/adam/.gem/ruby/1.8/bin
または、sudo を使用して gem をインストールした場合:
export PATH=$PATH:/usr/lib/ruby/gems/1.8/bin
新しい bash を開くたびにこれを手動で設定する必要がないように、これを .bashrc ファイルに追加するとよいでしょう。