gpt4 book ai didi

ruby-on-rails - 未定义的方法 : Activate Bin Path

转载 作者:数据小太阳 更新时间:2023-10-29 08:07:19 25 4
gpt4 key购买 nike

几天前我对我的 bash 配置文件进行了一些编辑,然后去创建一个新的 Rails 应用程序,然后弹出了这个错误。我不太确定问题出在哪里,或者为什么没有正确路由,我想我已经解决了。我还包含了我的新 bash 配置文件和我的旧配置文件。我删除了旧的,因为它看起来像是在疯狂地重复自己。

我跑

$ rails new newapp

/usr/local/bin/rails:22:in `<main>': undefined method `activate_bin_path' for Gem:Module (NoMethodError)

哪个 gem

$ which gem
/Users/LMagnotti/.rvm/rubies/ruby-2.2.4/bin/gem

哪些 rails

 which rails
/usr/local/bin/rails

gem 环境

$ 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 

最佳答案

您的 PATH 分配中的 ~ 不会扩展。在这种情况下,您可以使用 ${HOME} 而不是 ~

PATH 变量中的相对 above/path/to/gems 是怎么回事?您确定要这样做吗?

我怀疑其中之一导致了问题,或者实际上需要您从原始 PATH 表达式中删除的路径之一。

关于ruby-on-rails - 未定义的方法 : Activate Bin Path,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37594483/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com