gpt4 book ai didi

ruby-on-rails - lockfile_parser.r :48:in `parse_source' : undefined method `[]' for nil:NilClass (NoMethodError)

转载 作者:行者123 更新时间:2023-12-03 16:17:40 26 4
gpt4 key购买 nike

我第一次搞砸了 RubyOnRails3 和 Git。一切都进行得很顺利,直到突然任何与 rails 相关的命令行参数停止工作。不幸的是,我不知道是什么原因造成的,也不知道如何修复它。

这是命令行的输出

C:\railstest\railsproject>rails
C:/Ruby192/lib/ruby/gems/1.9.1/gems/bundler-1.0.0/lib/bundler/lockfile_parser.rb
:48:in `parse_source': undefined method `[]' for nil:NilClass (NoMethodError)
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/bundler-1.0.0/lib/bundler/lockf
ile_parser.rb:20:in `block in initialize'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/bundler-1.0.0/lib/bundler/lockf
ile_parser.rb:14:in `each'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/bundler-1.0.0/lib/bundler/lockf
ile_parser.rb:14:in `initialize'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/bundler-1.0.0/lib/bundler/defin
ition.rb:43:in `new'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/bundler-1.0.0/lib/bundler/defin
ition.rb:43:in `initialize'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/bundler-1.0.0/lib/bundler/dsl.r
b:122:in `new'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/bundler-1.0.0/lib/bundler/dsl.r
b:122:in `to_definition'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/bundler-1.0.0/lib/bundler/defin
ition.rb:20:in `build'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/bundler-1.0.0/lib/bundler.rb:12
8:in `definition'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/bundler-1.0.0/lib/bundler.rb:11
6:in `load'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/bundler-1.0.0/lib/bundler.rb:10
0:in `setup'
from C:/railstest/railsproject/config/boot.rb:8:in `<top (required)>'
from <internal:lib/rubygems/custom_require>:29:in `require'
from <internal:lib/rubygems/custom_require>:29:in `require'
from script/rails:5:in `<main>'

我不确定要提供哪些其他信息

最佳答案

看来 Gemfile.lock 有问题文件。您可以尝试删除此文件并运行 bundle install再次查看它是否可以正确重新创建它。

关于ruby-on-rails - lockfile_parser.r :48:in `parse_source' : undefined method `[]' for nil:NilClass (NoMethodError),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3624391/

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