Cannot install Ruby Gems in Windows 7 - ruby

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.

Related

installation of jekyll failed - Windows

I am trying to install jekyll on a 32 bit windows 7 PC . I downloaded ruby installer-32 bit and 32 bit devkit and extracted un ruby install folder.i got some ssh error which i resolved by temporarily switching to http instead of https and then updated gems as well as installed bundler using
gem install bundler
however gem install jekyll gives following error
Temporarily enhancing PATH to include DevKit...
Building native extensions. This could take a while...
ERROR: Error installing jekyll:
ERROR: Failed to build gem native extension.
C:/Ruby21/bin/ruby.exe -r ./siteconf20150109-5804-1k3wbva.rb extconf.rb
No such file or directory - C:/Ruby21/bin/ruby.exe -r ./siteconf20150109-5804-1k
3wbva.rb extconf.rb 2>&1
Gem files will remain installed in C:/Ruby21/lib/ruby/gems/2.1.0/gems/fast-stemm
er-1.0.2 for inspection.
Results logged to C:/Ruby21/lib/ruby/gems/2.1.0/extensions/x86-mingw32/2.1.0/fas
t-stemmer-1.0.2/gem_make.out
You need to install the Ruby DevKit to fix the error you're seeing. Any sane Ruby install has the ability to build stuff on the fly.
I would start with Julian Thilo's awesome instructions for installing Jekyll on Windows:
Run Jekyll on Windows
If you are installing Ruby only for the purpose of running Jekyll, PortableJekyll will give you a full working Jekyll install in < 5 minutes.
Happy Jekylling...
I tried the same thing on 3 systems and found out that installing ruby gems fixed the issue .. so for anyone coming back at this question , this is how you install jekyll on a windows pc:
1.download and install ruby.
2.download devkit extract in to a folder(preferably inside ruby installation dir) and type in cmd window while in your devkit dir :
ruby dk.rb init
ruby dk.rb install
3.download and install gems by
ruby setup.rb
4. finally :
gem install bundler
gem install jekyll
*bundler is a jekyll dependency
I had the same issue on Windows 10 after installing Ruby+Devkit 2.5.X (x64) with the Windows installer.
The reason was that I changed the default path in the installer and had spaces in the path name. Apparently some make scripts do not like that.
Reinstalling to a path without any spaces fixed the issue.
Also see this related issue on github.
I failed to install "gem install jekyll bundler" when ruby was installed in "c:\program files\Ruby26-x64". After I reinstalled ruby on c:\Ruby26-x64 everything went ok. Seems like installation fails to parse path with blank

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)

Installing new gems

Hi I am looking to install the win32-service gem in Ruby for Windows, I have tried using the "gem install" command but it doesn't seem to know where to find my gem ;(
I downloaded the gem itself which came with a load of folders but no install instructions.
Is there anyway I can manually install the gem or point IRB in the right direction?
run this command to install gem file manually.
gem install [your gem file]

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

How would I install this locally? Will gem install work?

https://github.com/Shopify/shopify_api
I've never manually installed something like this before, I have only used gem install xxxx in the past.
I am using RVM.
Update
OK, gem install does work, but how would I install it manually?
It's a gem so you could download it and decompress it, cd into its directory, then run rake. But why? gem install will be less work and will do as well.
gem install path/to/gem/file.gem
It's a gem, it's available from Rubygems, so
gem install shopify_api
See https://rubygems.org/gems/shopify_api

Resources