简体   繁体   English

在haml gem上用RubyGems安装Sproutcore失败

[英]Installing Sproutcore with RubyGems fails at the haml gem

I am trying to install sproutcore on a windows xp vm (virtualbox), for development, using RubyGems. 我正在尝试使用RubyGems在Windows XP虚拟机(virtualbox)上安装萌芽核,以进行开发。 When gems reaches haml-3.0.25.gem it stops with the error: 当gems到达haml-3.0.25.gem时,它停止并显示错误:

gem install sproutcore -V
...
ERROR:  While executing gem ... (Zlib::DataError)
invalid stored block lengths

I have tried both Ruby 1.8.7 and 1.9.2 as well as RubyGems 1.7.1 and 1.8.1. 我已经尝试了Ruby 1.8.7和1.9.2以及RubyGems 1.7.1和1.8.1。 I tried downloading haml 3.1.1 with git and installing it manually, but the rake would not install. 我尝试使用git下载haml 3.1.1并手动安装,但耙无法安装。 It said something about 'lib/haml' not found. 它说没有找到有关“ lib / haml”的内容。 The directory did exist. 该目录确实存在。

Other gems install just fine under all the combinations I tried. 在我尝试的所有组合下,其他宝石都安装得很好。 I even tried installing it under my host OS (Win 7 32-bit), but it gave the same error. 我什至尝试将其安装在主机操作系统(Win 7 32位)下,但是出现了同样的错误。 Installing haml by itself changes the error message only slightly: 单独安装haml只会稍微更改错误消息:

gem install haml -V
...
ERROR:  While executing gem ... (Zlib::DataError)
invalid code lengths set

Zlib compresses and decompresses data streams from what I have read, so it sounds like the haml gem might be corrupt (although I doubt). Zlib从我已阅读的内容中压缩和解压缩数据流,因此听起来haml gem可能已损坏(尽管我对此表示怀疑)。

I am at my wits end and could find no helpful advice anywhere. 我无能为力,找不到任何有用的建议。

Special thanks to @saner for his contribution. 特别感谢@saner的贡献。 After a lot of frustration, this is how I finally installed sproutcore on a Windows XP VM running on a Windows 7 host. 经过许多挫败之后,这就是我最终如何在Windows 7主机上运行的Windows XP VM上安装了萌芽核心的方法。

1) Download and install Ruby 1.9.2-p180 (remember to tick the option to include the bin directory in the PATH variable). 1)下载并安装Ruby 1.9.2-p180(请记住勾选该选项以将bin目录包括在PATH变量中)。
2) Download DevKit 4.5.1 and extract it. 2)下载DevKit 4.5.1并将其解压缩。
3) Open a command prompt and cd to the extracted directory. 3)打开命令提示符,然后cd到解压缩的目录。
4) Run: 4)运行:

ruby dk.rb init
ruby dk.rb review
ruby dk.rb install

5) Download RubyGems 1.7.2 and run setup.rb 5)下载RubyGems 1.7.2并运行setup.rb
6) From the command prompt run 6)在命令提示符下运行

gem install haml -v 3.0.24
gem install eventmachine --pre
gem install sproutcore --pre

Thats it. 而已。
Enjoy. 请享用。

I know this is a really old question, but since I just experienced the same problem, I've decided to add my insights on it. 我知道这是一个非常老的问题,但是由于我刚刚遇到过同样的问题,所以我决定添加自己的见解。

So, it happened while I was trying to install the same set of gems on two different machines with different architectures, with different locations and respectively in different networks. 因此,当我试图在具有不同架构,不同位置和不同网络的两台不同机器上安装同一组gem时,就发生了这种情况。 Ie - my home mac and a remote linux server. 即-我的家庭Mac和远程Linux服务器。

So, one particular gem (dm-sqlite-adapter) failed installing on both machines, and I even tried it couple of times, but always with the same result: 因此,一个特殊的gem(dm-sqlite-adapter)无法在两台计算机上安装,我什至尝试了几次,但总是得到相同的结果:

$ gem install dm-sqlite-adapter 
ERROR:  While executing gem ... (Zlib::DataError)
    invalid code lengths set

Then I spent few minutes browsing the network for a solution, including reading this thread. 然后,我花了几分钟浏览网络以找到解决方案,包括阅读此线程。

Since I didn't find any satisfying answer and I wasn't pleased with the idea of reinstalling everything, decided to act dumb and tried gem install one more time.. And it worked. 由于我没有找到满意的答案,并且对重新安装所有内容的想法不满意,因此决定采取行动,并尝试再次gem install Then tried the other machine - worked like a charm. 然后尝试另一台机器-就像一个魅力。

So as a conclusion I'd just guess that the problem came from the remote repo and maybe the gem hadn't even downloaded at all (I forgot to check that prior to succeeding installing it). 因此,我可以得出一个结论,那就是问题出在远程仓库中,甚至gem甚至都没有下载(我忘记在成功安装前先检查一下)。 But as I said - it's just a guess.. 但是正如我所说-这只是一个猜测。

I was able to install SproutCore on Ruby 1.9.2: 我能够在Ruby 1.9.2上安装SproutCore:

  1. Install Ruby 1.9.2-p180 安装Ruby 1.9.2-p180
  2. gem install sproutcore --pre 宝石安装萌芽--pre
  3. gem install eventmachine --pre gem install eventmachine --pre
  4. gem uninstall thin 宝石卸载薄
  5. gem install mongrel 宝石安装杂种

I needed to remove thin because starting sc-server ended with errors, SproutCore will use mongrel instead of thin. 我需要删除Thin,因为启动sc-server时由于错误而结束,SproutCore将使用mongrel而不是Thin。


Update: 更新:

I didn't mention that I use RubyGems 1.7.2 and I have installed DevKit and Cygwin. 我没有提到我使用RubyGems 1.7.2,并且已经安装了DevKit和Cygwin。

I removed all versions of SproutCore, Mongrel and Haml, then I typed: 我删除了所有版本的SproutCore,Mongrel和Haml,然后键入:

  1. gem install sproutcore --pre , SproutCore v1.6.0.beta.1 was installed. gem install sproutcore --pre ,已安装SproutCore v1.6.0.beta.1。
  2. eventmachine --pre , eventmachine (1.0.0.beta.3 x86-mingw32) was installed eventmachine --pre ,eventmachine(1.0.0.beta.3 x86-mingw32)

SproutCore works with this setup, using mongrel was not necessary. SproutCore使用此设置,不需要使用杂种。

My configuration: sproutcore (1.6.0.beta.1), ruby 1.9.2p180, gem 1.7.2, thin (1.2.11 x86-mingw32), eventmachine (1.0.0.beta.3 x86-mingw32), haml (3.0.25), gcc version 4.5.0 (GCC) 我的配置:萌芽(1.6.0.beta.1),红宝石1.9.2p180,宝石1.7.2,薄(1.2.11 x86-mingw32),事件机(1.0.0.3.x x86-mingw32),haml( 3.0.25),gcc版本4.5.0(GCC)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM