gpt4 book ai didi

ruby-on-rails - Ruby:堆栈级别太深(SystemStackError)

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

Ruby 在 Cygwin 中的 rails 和 bundler 崩溃。

$ ruby -v
ruby 1.9.3p374 (2013-01-15 revision 38858) [i386-cygwin]

Chloe@dumbopc /cygdrive/c/Sites
$ rails -v
Rails 3.2.11

Chloe@dumbopc /cygdrive/c/Sites
$ cd testapp

Chloe@dumbopc /cygdrive/c/Sites/testapp
$ rails -v
/usr/lib/ruby/site_ruby/1.9.1/rubygems/requirement.rb:114: stack level too
deep (SystemStackError)

Chloe@dumbopc /cygdrive/c/Sites/testapp
$ bundle install
Fetching gem metadata from https://rubygems.org/...........
Fetching gem metadata from https://rubygems.org/..
Unfortunately, a fatal error has occurred. Please see the Bundler
troubleshooting documentation at http://bit.ly/bundler-issues. Thanks!
/usr/lib/ruby/gems/1.9.1/gems/bundler-1.2.3/lib/bundler/friendly_errors.rb:32:
stack level too deep (SystemStackError)

我尝试了两个版本的 Ruby,ruby 1.9.3p327 和 ruby​​-1.9.3-p374-1。我从谷歌找到一些暗示 1.9.2 可能会解决问题的东西,但我无法在 setup.exe 中选择它。我也试过了

peflags -x8192000 `which ruby`

这没有帮助。我也试过18192000。我卸载了Ruby并重新安装。与 rails 相同。它仅在位于应用程序目录内时才会失败。当我尝试

rails new testapp

它创建目录和文件,但在 bundle install 上失败。我不能在该目录中运行 rails -v 。我怀疑还有其他命令那也会失败,但我还没有找到它们。我使用的是 Windows XP SP3。

$ uname -a
CYGWIN_NT-5.1 dumbopc 1.7.17(0.262/5/3) 2012-10-19 14:39 i686 Cygwin

如果你好奇的话,这里是坏行

$ rails -v
/usr/lib/ruby/site_ruby/1.9.1/rubygems/requirement.rb:114: stack level too
deep (SystemStackError)
$ cat -n /usr/lib/ruby/site_ruby/1.9.1/rubygems/requirement.rb | grep '^ *114'
114 requirements.map { |op, version| "#{op} #{version}" }.sort
$ bundle install
/usr/lib/ruby/gems/1.9.1/gems/bundler-1.2.3/lib/bundler/friendly_errors.rb:32:
stack level too deep (SystemStackError)
$ cat -n /usr/lib/ruby/gems/1.9.1/gems/bundler-1.2.3/lib/bundler/friendly_errors.rb | grep '^ *32'
32 raise e

我还尝试了 bundler 在其链接后的所有建议。我在 rails 脚本中添加了 -d 并打印了这个:

$ rails -v
Exception `LoadError' at /usr/lib/ruby/site_ruby/1.9.1/rubygems.rb:1264 - cannot load such file -- rubygems/defaults/operating_system
Exception `LoadError' at /usr/lib/ruby/site_ruby/1.9.1/rubygems.rb:1273 - cannot load such file -- rubygems/defaults/ruby
Exception `NoMethodError' at /usr/lib/ruby/site_ruby/1.9.1/rubygems/specification.rb:1495 - undefined method `to_ary' for #<Gem::Specification name=rake version=0.9.2.2>
Exception `NoMethodError' at /usr/lib/ruby/site_ruby/1.9.1/rubygems/specification.rb:1495 - undefined method `to_ary' for #<Gem::Specification name=rake version=10.0.3>
Exception `NoMethodError' at /usr/lib/ruby/site_ruby/1.9.1/rubygems/specification.rb:1495 - undefined method `to_ary' for #<Gem::Specification name=json version=1.7.5>
Exception `NoMethodError' at /usr/lib/ruby/site_ruby/1.9.1/rubygems/specification.rb:1495 - undefined method `to_ary' for #<Gem::Specification name=json version=1.7.6>
Exception `NoMethodError' at /usr/lib/ruby/site_ruby/1.9.1/rubygems/specification.rb:1495 - undefined method `to_ary' for #<Gem::Specification name=rake version=0.9.2.2>
Exception `NoMethodError' at /usr/lib/ruby/site_ruby/1.9.1/rubygems/specification.rb:1495 - undefined method `to_ary' for #<Gem::Specification name=rake version=10.0.3>
Exception `NoMethodError' at /usr/lib/ruby/site_ruby/1.9.1/rubygems/specification.rb:1495 - undefined method `to_ary' for #<Gem::Specification name=json version=1.7.5>
Exception `NoMethodError' at /usr/lib/ruby/site_ruby/1.9.1/rubygems/specification.rb:1495 - undefined method `to_ary' for #<Gem::Specification name=json version=1.7.6>
Exception `NoMethodError' at /usr/lib/ruby/site_ruby/1.9.1/rubygems/specification.rb:1495 - undefined method `to_ary' for #<Gem::Specification name=rake version=0.9.2.2>
Exception `NoMethodError' at /usr/lib/ruby/site_ruby/1.9.1/rubygems/specification.rb:1495 - undefined method `to_ary' for #<Gem::Specification name=rake version=10.0.3>
Exception `NoMethodError' at /usr/lib/ruby/site_ruby/1.9.1/rubygems/specification.rb:1495 - undefined method `to_ary' for #<Gem::Specification name=json version=1.7.5>
Exception `NoMethodError' at /usr/lib/ruby/site_ruby/1.9.1/rubygems/specification.rb:1495 - undefined method `to_ary' for #<Gem::Specification name=json version=1.7.6>
Exception `NoMethodError' at /usr/lib/ruby/site_ruby/1.9.1/rubygems/specification.rb:1495 - undefined method `to_ary' for #<Gem::Specification name=rake version=0.9.2.2>
Exception `NoMethodError' at /usr/lib/ruby/site_ruby/1.9.1/rubygems/specification.rb:1495 - undefined method `to_ary' for #<Gem::Specification name=rake version=10.0.3>
Exception `NoMethodError' at /usr/lib/ruby/site_ruby/1.9.1/rubygems/specification.rb:1495 - undefined method `to_ary' for #<Gem::Specification name=json version=1.7.5>
Exception `NoMethodError' at /usr/lib/ruby/site_ruby/1.9.1/rubygems/specification.rb:1495 - undefined method `to_ary' for #<Gem::Specification name=json version=1.7.6>
Exception `NoMethodError' at /usr/lib/ruby/site_ruby/1.9.1/rubygems/specification.rb:1495 - undefined method `to_ary' for #<Gem::Specification name=rake version=0.9.2.2>
Exception `NoMethodError' at /usr/lib/ruby/site_ruby/1.9.1/rubygems/specification.rb:1495 - undefined method `to_ary' for #<Gem::Specification name=rake version=10.0.3>
Exception `NoMethodError' at /usr/lib/ruby/site_ruby/1.9.1/rubygems/specification.rb:1495 - undefined method `to_ary' for #<Gem::Specification name=json version=1.7.5>
Exception `NoMethodError' at /usr/lib/ruby/site_ruby/1.9.1/rubygems/specification.rb:1495 - undefined method `to_ary' for #<Gem::Specification name=json version=1.7.6>
Exception `NoMethodError' at /usr/lib/ruby/site_ruby/1.9.1/rubygems/specification.rb:1495 - undefined method `to_ary' for #<Gem::Specification name=rake version=0.9.2.2>
Exception `NoMethodError' at /usr/lib/ruby/site_ruby/1.9.1/rubygems/specification.rb:1495 - undefined method `to_ary' for #<Gem::Specification name=rake version=10.0.3>
Exception `NoMethodError' at /usr/lib/ruby/site_ruby/1.9.1/rubygems/specification.rb:1495 - undefined method `to_ary' for #<Gem::Specification name=json version=1.7.5>
Exception `NoMethodError' at /usr/lib/ruby/site_ruby/1.9.1/rubygems/specification.rb:1495 - undefined method `to_ary' for #<Gem::Specification name=json version=1.7.6>
/usr/lib/ruby/site_ruby/1.9.1/rubygems/requirement.rb:118: stack level too deep (SystemStackError)


$ head -1 /usr/bin/rails
#!/usr/bin/ruby.exe -d

最佳答案

我认为您的 peflags 命令行有误。尝试:

peflags -X409600 `which ruby`

描述here .

关于ruby-on-rails - Ruby:堆栈级别太深(SystemStackError),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14589341/

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