On Ubuntu 12.04 trying to install Rails with $ gem install Rails fails with ERROR: Loading command: install (LoadError) cannot load such file -- zlib ERROR: While executing gem ... (NameError) uninitialized constant Gem::Commands::InstallCommand Ruby was installed with rbenv. More info: ~$ gem environment RubyGems Environment: - RUBYGEMS VERSION: 1.8.23 - RUBY VERSION: 1.9.3 (2012-10-12 patchlevel 286) [i686-linux] - INSTALLATION DIRECTORY: /home/user/.rbenv/versions/1.9.3-p286/lib/ruby/gems/1.9.1 - RUBY EXECUTABLE: /home/user/.rbenv/versions/1.9.3-p286/bin/ruby - EXECUTABLE DIRECTORY: /home/user/.rbenv/versions/1.9.3-p286/bin - RUBYGEMS PLATFORMS: - ruby - x86-linux - GEM PATHS: - /home/user/.rbenv/versions/1.9.3-p286/lib/ruby/gems/1.9.1 - /home/user/.gem/ruby/1.9.1 - GEM CONFIGURATION: - :update_sources => true - :verbose => true - :benchmark => false - :backtrace => false - :bulk_threshold => 1000 - REMOTE SOURCES: - http://rubygems.org/ and ~$ lsb_release -a;uname -a; dpkg -l|grep zlib LSB Version: core-2.0-ia32:core-2.0-noarch:core-3.0-ia32:core-3.0-noarch:core-3.1-ia32:core-3.1-noarch:core-3.2-ia32:core-3.2-noarch:core-4.0-ia32:core-4.0-noarch Distributor ID: Ubuntu Description: Ubuntu 12.04.1 LTS Release: 12.04 Codename: precise Linux machine 3.2.0-32-generic-pae #51-Ubuntu SMP Wed Sep 26 21:54:23 UTC 2012 i686 i686 i386 GNU/Linux ii zlib1g 1:1.2.3.4.dfsg-3ubuntu4 compression library - runtime ii zlib1g-dev 1:1.2.3.4.dfsg-3ubuntu4 compression library - development What is wrong? -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To view this discussion on the web visit https://groups.google.com/d/msg/rubyonrails-talk/-/fJtpjaAOA5IJ. For more options, visit https://groups.google.com/groups/opt_out.
Pardon the silly question, but are you sure zlib1g-dev was installed prior to building this ruby and not after the fact? (This has caused many the annoying hour for me with multiple rubies and forgetting when ruby x was actually built!) -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To view this discussion on the web visit https://groups.google.com/d/msg/rubyonrails-talk/-/YgRTXOTIvPgJ. For more options, visit https://groups.google.com/groups/opt_out.
No, the question is not silly at all. Actually, when I presented this problem in an Ubuntu forum I asked it myself. And, yes, uninstalling and reinstalling ruby 1.9.3-p286 solved the problem. Thank you very much! Den lördagen den 10:e november 2012 kl. 17:00:21 UTC+1 skrev Sam Pizzey:> > Pardon the silly question, but are you sure zlib1g-dev was installed > prior to building this ruby and not after the fact? > (This has caused many the annoying hour for me with multiple rubies and > forgetting when ruby x was actually built!)-- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msg/rubyonrails-talk/-/1dOSAuZBThsJ. For more options, visit https://groups.google.com/groups/opt_out.