gpt4 book ai didi

ruby-on-rails - 无法运行生成 bundler /设置(LoadError)

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

我正在运行 OS X 10.11.2 (15C50),带有 rvm 1.26.11、ruby 2.3.0p0 和 gem 2.5.1。如果我尝试运行 rails g controller welcome 或任何其他生成命令,我会收到以下错误。

我已经完成了 rvm 内爆,从头开始安装了 ruby​​、rails 和 bundler。创建了一个新的应用程序,问题仍然存在。

% rails g controller welcome                                                                                                      
/Users/username/.rvm/rubies/ruby-2.3.0/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require': cannot load such file -- bundler/setup (LoadError)
from /Users/username/.rvm/rubies/ruby-2.3.0/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from /Users/username/Projects/tweener-frontend/vendor/bundle/gems/spring-1.6.1/lib/spring/commands.rb:33:in `<module:Spring>'
from /Users/username/Projects/tweener-frontend/vendor/bundle/gems/spring-1.6.1/lib/spring/commands.rb:4:in `<top (required)>'
from /Users/username/.rvm/rubies/ruby-2.3.0/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from /Users/username/.rvm/rubies/ruby-2.3.0/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from /Users/username/Projects/tweener-frontend/vendor/bundle/gems/spring-1.6.1/lib/spring/application.rb:77:in `preload'
from /Users/username/Projects/tweener-frontend/vendor/bundle/gems/spring-1.6.1/lib/spring/application.rb:143:in `serve'
from /Users/username/Projects/tweener-frontend/vendor/bundle/gems/spring-1.6.1/lib/spring/application.rb:131:in `block in run'
from /Users/username/Projects/tweener-frontend/vendor/bundle/gems/spring-1.6.1/lib/spring/application.rb:125:in `loop'
from /Users/username/Projects/tweener-frontend/vendor/bundle/gems/spring-1.6.1/lib/spring/application.rb:125:in `run'
from /Users/username/Projects/tweener-frontend/vendor/bundle/gems/spring-1.6.1/lib/spring/application/boot.rb:18:in `<top (required)>'
from /Users/username/.rvm/rubies/ruby-2.3.0/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from /Users/username/.rvm/rubies/ruby-2.3.0/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from -e:1:in `<main>'

最佳答案

我有同样的问题,我做了以下来解决这个问题:

bundle install --binstubs

先尝试这个,然后尝试运行:

bundle exec rails g controller welcome

希望对您有所帮助。

关于ruby-on-rails - 无法运行生成 bundler /设置(LoadError),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34478163/

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