开发者

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. When gems reaches haml-3.0.25.gem it stops with the error:

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. I tried downloading haml 3.1.1 with git and installing it manually, but the rake would not install. It said something about 'lib/haml' not found. 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. Installing haml by itself changes the error message only slightly:

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).

I am at my wits end and could find no helpful advice anywhere.


Special thanks to @saner for his contribution. After a lot of frustration, this is how I finally installed sproutcore on a Windows XP VM running on a Windows 7 host.

1) Download and install Ruby 1.9.2-p180 (remember to tick the option to include the bin directory in the PATH variable).
2) Download DevKit 4.5.1 and extract it.
3) Open a command prompt and cd to the extracted directory.
4) Run:

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

5) Download RubyGems 1.7.2 and run setup.rb
6) From the command prompt run

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

Thats it.
Enjoy.


I was able to install SproutCore on Ruby 1.9.2:

  1. Install Ruby 1.9.2-p180
  2. gem install sproutcore --pre
  3. 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.


Update:

I didn't mention that I use RubyGems 1.7.2 and I have installed DevKit and Cygwin.

I removed all versions of SproutCore, Mongrel and Haml, then I typed:

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

SproutCore works with this setup, using mongrel was not necessary.

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)


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. I.e. - my home mac and a remote linux server.

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 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. 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). But as I said - it's just a guess..

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜