5

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 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 按照其链接提供的所有建议。我将 -d 添加到 rails 脚本并打印了以下内容:

$ 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
4

2 回答 2

5

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

peflags -X409600 `which ruby`

如此处所述。

于 2013-02-09T19:16:17.737 回答
0

同样的事情发生在我身上。我从 cygwin 安装文件中卸载了 ruby​​,当我在 CMD 中 ram ruby​​ -v 时,它仍然存在!

事实证明,我在“PATH”环境变量中有其他 ruby​​.exe 实例。所以检查你的环境变量,卸载所有东西,看看它是否指向另一个 ruby​​ 文件。

于 2013-02-06T11:08:41.527 回答