Installing Sproutcore with RubyGems fails at the haml gem - ruby

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:
Install Ruby 1.9.2-p180
gem install sproutcore --pre
gem install eventmachine --pre
gem uninstall thin
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:
gem install sproutcore --pre, SproutCore v1.6.0.beta.1 was installed.
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..

Related

Installing into parent path not allowed when installing locally built Ruby gem

I've written a Ruby gem that I'd like to install locally. I'm using Rubygems 3.0.6 and RVM on OS X Mojave. This is a closed source gem and I'd rather not go to the trouble of publishing it to the company gemservers. I'm able to install other (published) gems just fine using both bundle install and gem install.
The gem is all built (using gem build) and the code works, but when I run:
gem install influx_trello_utility-0.1.0.gem
I get an error:
ERROR: While executing gem ... (Gem::Package::PathError)
installing into parent path /bin/[ of /Users/danascheider/.rvm/gems/ruby-2.6.3#influx_trello_utility/gems/influx_trello_utility-0.1.0 is not allowed
Any help with this would be much appreciated. I'm not sure what additional information would be useful, but I'm happy to answer any questions you may have. Thanks!

Updating Ruby to 2.0.0 using Pik

After installing pik and changing my Ruby version to 2.0.0, bundler no long works properly
C:\Users\Me\Documents\Work Projects\Application>bundle install
Fetching gem metadata from https://rubygems.org/.........
Fetching gem metadata from https://rubygems.org/..
Using rake (10.1.0)
Using i18n (0.6.5)
Using minitest (4.7.5)
Using multi_json (1.8.0)
Installing atomic (1.1.14)
Gem::InstallError: The 'atomic' native gem requires installed build tools.
Please update your PATH to include build tools or download the DevKit
from 'http://rubyinstaller.org/downloads' and follow the instructions
at 'http://github.com/oneclick/rubyinstaller/wiki/Development-Kit'
An error occurred while installing atomic (1.1.14), and Bundler cannot continue.
Make sure that `gem install atomic -v '1.1.14'` succeeds before bundling.
Installing the devkit from Ruby Installer sort of defeats the reason why I went to the trouble of installing pik. How can I fix this, so that in the future, I can easily update ruby using pik and still have everything working?
I had the same problem - if you follow the instructions listed (ie installing devkit and following their directions [they don't actually tell you to use rubyinstaller]), you'll be fine. Also make sure that during the init phase of the Devkit instructions that it doesn't miss any of your ruby installations.
A note though, it seems that pik can't specify the x64 version of 2.0.0, so you may run into problems if that's the case. In the end I had to use the rubyinstaller for the x64 version of ruby, and then ran the x64 version of the devkit.
Hope this helps.
I think Josh' answer is probably right, but I actually installed Ubuntu as a VM in the end, just so I could use RVM.
RVM is a thousand times better than Pik, and it installs the DevKit. It's so good it's genuinely worth installing Ubuntu just so you can use it.

Bundle Install not installing the gems from gemfile

I am trying to setup my rails application on Windows 7 machine. I installed Ruby 1.9.3 by using installer. I also installed Rails 3.2.2.
Now, I am trying to run bundle install from my application root directory. This command used to install all the required gems. However, when I am running in this new machine its not installing. I have to install all the gems manually one by one.
I know its bit strange but I am facing this for the first time..!!
Edit 1: Please refer below screen-shot.
Note: I have already installed few gems manually before posting here. The error related to DevKit that I am getting below has just came while I was tried to install json gem..
After Installing more gems manually:
If you read the error, it tells you that you need DevKit to install that gem on Windows. So install that and follow the instructions, then try again ;) After the json gem can be installed, it should install every other gem in the Gemfile.
(The json gem is a dependency from Rails)

Cannot install Ruby Gems in Windows 7

I have successfully installed Ruby Gems on my Mac many times. I need to configure a Windows 7 Enterprise virtual machine with Compass, Sass and Suzy.
I downloaded an installed Ruby on the Windows machine with the installer, 1.9.3. I ran gem update --system which updated Rubygems to 1.8.4.
I was able to install Sass 3.2 by running gem install sass
However, if I run gem install compass or gem install susy I get an error:
Error while excecuting gem .. (ArgumentError) marshall data too short
Any ideas? At this point, I can't install those gems.
The alternative solution..: Download gem compass from here to your ruby root folder. Then try again
gem install compass
It should install this time..Good luck
Had same issue, updating rubygems system solved it. Just use the following command
gem update --system
For those finding this question, many great tips here. Using them, I found this solution to work:
At the N: prompt in "start command line with ruby environment", I used the command rmdir /S .gem which deleted all gems. I then installed them again with gem install as directed on their respective host web pages. Hope this helps someone.

Problems with RubyGems

I'm having some problems with ruby gems. I'm trying to install the gem hitimes although after trying to install it (even using sudo) I get this error: http://cl.ly/Hvlf.
Could it be that I already have it installed because I've tried a few times now. Is there a way to uninstall a gem?
The gem can be found here on RubyGems.org and I've even tried to download the .gem file and install it that way but had no luck.

Resources