我几天前用我的bash配置文件进行了一些编辑,然后去创建一个新的rails应用程序,然后弹出这个错误。我不太确定问题是什么或为什么事情没有正确布线,我以为我已经修好了。我还包括了我的新bash配置文件和我的旧配置文件。我删除了旧的,因为它看起来像疯了一样重复自己。
我跑
$ rails new newapp
/usr/local/bin/rails:22:in `<main>': undefined method `activate_bin_path' for Gem:Module (NoMethodError)
哪个宝石
$ which gem
/Users/LMagnotti/.rvm/rubies/ruby-2.2.4/bin/gem
哪个Rails
which rails
/usr/local/bin/rails
Gem Env
$ gem env
RubyGems Environment:
- RUBYGEMS VERSION: 2.4.8
- RUBY VERSION: 2.2.4 (2015-12-16 patchlevel 230) [x86_64-darwin15]
- INSTALLATION DIRECTORY: /Users/LMagnotti/.rvm/gems/ruby-2.2.4
- RUBY EXECUTABLE: /Users/LMagnotti/.rvm/rubies/ruby-2.2.4/bin/ruby
- EXECUTABLE DIRECTORY: /Users/LMagnotti/.rvm/gems/ruby-2.2.4/bin
- SPEC CACHE DIRECTORY: /Users/LMagnotti/.gem/specs
- SYSTEM CONFIGURATION DIRECTORY: /Users/LMagnotti/.rvm/rubies/ruby-2.2.4/etc
- RUBYGEMS PLATFORMS:
- ruby
- x86_64-darwin-15
- GEM PATHS:
- /Users/LMagnotti/.rvm/gems/ruby-2.2.4
- /Users/LMagnotti/.rvm/gems/ruby-2.2.4@global
- GEM CONFIGURATION:
- :update_sources => true
- :verbose => true
- :backtrace => false
- :bulk_threshold => 1000
- REMOTE SOURCES:
- https://rubygems.org/
- SHELL PATH:
- /Users/LMagnotti/.rvm/gems/ruby-2.2.4/bin
- /Users/LMagnotti/.rvm/gems/ruby-2.2.4@global/bin
- /Users/LMagnotti/.rvm/rubies/ruby-2.2.4/bin
- /usr/local/bin
- /usr/local/sbin
- ~/bin
- /usr/local/bin
- /usr/bin
- /bin
- /usr/sbin
- /sbin
- /Users/LMagnotti/.rvm/bin
- above/path/to/gems
新Bash档案
export PATH="/usr/local/bin:/usr/local/sbin:~/bin:$PATH"
[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm" # Load RVM into a shell session *as a function*
PATH=$PATH:above/path/to/gems
source ~/.rvm/scripts/rvm
旧Bash档案
export PATH=/Users/LMagnotti/.rbenv/shims:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Users/LMagnotti/.rvm/bin:/Lmagnotti/mongodb/bin:/Users/lmagnotti/mongodb/bin
答案 0 :(得分:1)
PATH分配中的~
不会展开。在这种情况下,您可以使用${HOME}
代替~
。
above/path/to/gems
变量中的相对PATH
是怎么回事?你确定要这么做吗?
我怀疑其中一个导致了问题,或者实际上需要从原始PATH表达式中删除的路径之一。