chef verify shows error that gems dependencies on this path error
C:/opscode/chefdk/embedded/lib/ruby/site_ruby/2.3.0/rubygems/dependency.rb:310:in `to_specs': Could not find 'test-kitchen' (= 1.15.0) - did find: [test-kitchen-1.17.0] (Gem::MissingSpecVersionError)
GEM_PATH=C:/Users/ravikiran/AppData/Local/chefdk/gem/ruby/2.3.0;C:/opscode/chefdk/embedded/lib/ruby/gems/2.3.0', execute `gem env` for more information
from C:/opscode/chefdk/embedded/lib/ruby/site_ruby/2.3.0/rubygems/dependency.rb:320:in `to_spec'
from C:/opscode/chefdk/embedded/lib/ruby/site_ruby/2.3.0/rubygems/core_ext/kernel_gem.rb:65:in `gem'
from C:/opscode/chefdk/bin/kitchen:19:in `<main>'
Remove your ~/.chefdk folder, you probably tried to upgrade some gems in-place at some point. Wiping that out should get you back to baseline (if it doesn't, reinstall the ChefDK package too).
how about installing the test-kitchen (= 1.15.0) gem, that it says is missing. See this on how to install a ruby gem. http://guides.rubygems.org/rubygems-basics/
update on how to install gem using the chefdk's ruby: I don't have a chefdk installed in a windows OS, but you should see the ruby installed by the chefdk here PATH_TO_chefdk/embedded/bin/ruby.
So, i just installed a chefdk on my win10 x64 (as its a friday :) )... And then to use the ruby from chefdk. follow this https://docs.chef.io/install_dk.html .. Refer to the "Powershell" section. But in short, just run chef shell-init powershell | Invoke-Expression in the PS console.
now you should be able to install the gem version.
Related
I'm trying to run different gems on Raspbian and they won't work. I tried on two gems: Jekyll and Lolcat.
I've installed both gems:
pi#moon ~ $ sudo gem install lolcat
Successfully installed lolcat-42.0.99
1 gem installed
Installing ri documentation for lolcat-42.0.99...
Installing RDoc documentation for lolcat-42.0.99...
pi#moon ~ $ sudo gem install jekyll
Successfully installed jekyll-1.4.3
1 gem installed
Installing ri documentation for jekyll-1.4.3...
Installing RDoc documentation for jekyll-1.4.3...
These are the errors I receive.
pi#moon ~ $ lolcat --help
/usr/lib/ruby/1.9.1/rubygems/dependency.rb:247:in `to_specs': Could not find lolcat (>= 0)
amongst [bundler-1.5.3, bundler-unload-1.0.2, executable-hooks-1.3.1, gem-wrappers-1.2.4, rubygems-bundler-1.4.2, rvm-1.11.3.9] (Gem::LoadError)
from /usr/lib/ruby/1.9.1/rubygems/dependency.rb:256:in `to_spec'
from /usr/lib/ruby/1.9.1/rubygems.rb:1231:in `gem'
from /usr/local/bin/lolcat:22:in `<main>'
pi#moon ~ $ jekyll
/usr/lib/ruby/1.9.1/rubygems/dependency.rb:247:in `to_specs': Could not find jekyll (>= 0)
amongst [bundler-1.5.3, bundler-unload-1.0.2, executable-hooks-1.3.1, gem-wrappers-1.2.4, rubygems-bundler-1.4.2, rvm-1.11.3.9] (Gem::LoadError)
from /usr/lib/ruby/1.9.1/rubygems/dependency.rb:256:in `to_spec'
from /usr/lib/ruby/1.9.1/rubygems.rb:1231:in `gem'
from /usr/local/bin/jekyll:22:in `<main>'
I was advised to re-install ruby using RVM. I did, and when I run rvm list to see my ruby versions, I get the following:
pi#moon ~ $ rvm list
rvm rubies
=> ruby-1.9.1-p431 [ armv6l ]
* ruby-2.1.0 [ armv6l ]
I tried running the gems on both versions (1.9.1 & 2.1.0) but receive the same errors.
Thank you in advance!
Several things were wrong here:
Firstly, the gems had been installed as root, which meant that their codebase (and any shell scripts or binary commands their installation generated) were root's, not the current users. This was the cause of OP's original failure - namely, the executable scripts could not resolve the gems since they were installed under a different user's rvm environment.
Secondly, even had the gems commands been accessible this could have created all sorts of security problems, given that the files belonged to root. Potentially, if these gems had contained badly-behaved code (or malicious code) embedded within them, a privilege escalation attack might have been possible against the system running the ruby process.
Basically, the TL;DR is that you should always install the gems using the credentials of the user who needs to run the ruby process that requires the gems, and this user should never be root or have superuser rights to the system or filesystem.
When I try to start debugging in Aptana Studio 3, an error occurs:
/Users/shia/.rvm/rubies/ruby-1.8.7-p374/lib/ruby/site_ruby/1.8/rubygems/dependency.rb:296:in `to_specs': Could not find 'ruby-debug-ide' (>= 0) among 7 total gem(s) (Gem::LoadError)
from /Users/shia/.rvm/rubies/ruby-1.8.7-p374/lib/ruby/site_ruby/1.8/rubygems/dependency.rb:307:in `to_spec'
from /Users/shia/.rvm/rubies/ruby-1.8.7-p374/lib/ruby/site_ruby/1.8/rubygems/core_ext/kernel_gem.rb:47:in `gem'
from /Users/shia/.rvm/rubies/ruby-1.8.7-p374/bin/rdebug-ide:22
After a while a dialog pops out saying "An internal error occurred during: "Launching Game.rb". Could not connect to debugger on port 54008". (Game.rb is the file that I'm debugging.)
I'm using Ruby on OS X 10.9.1. I first installed the latest version, Ruby 2.0.0, using Homebrew. Then I found out the debugger doesn't work well with Ruby 1.9+, so I installed RVM and used it to install Ruby 1.8.7. Then I executed $rvm use 1.8.7 in the Terminal.
After that, I executed $gem install ruby-debug-ide and $gem install ruby-debug-base and everything looked OK. But when I restarted Aptana, the debugging still didn't work and returned the error above.
Not sure which step I'm missing here. Thank you very much.
I have the same problem, set the defualt ruby and gem set version for rvm.
rvm --default use 'ruby-2.1.1#global'
rvm --default use 'ruby-2.1.1'
I working on a Windows 7 machine with Vagrant v 1.4.1 and I have been struggling to install the vagrant-berkshelf plugin. I'm following some instructions from a blog by Mischa Taylor. I've installed VirtualBox (4.2.20), a "sane" Ruby environment (with the DevKit) and the berkshelf gem and that went fine as well but whenever I issue the
> vagrant plugin install vagrant-berkshelf
The command returns an error when trying to build the
Installing the 'vagrant-berkshelf' plugin. This can take a few minutes...
C:/HashiCorp/Vagrant/embedded/lib/ruby/2.0.0/rubygems/ext/builder.rb:62:in `run':
ERROR: Failed to build gem native extension. (Gem::Installer::ExtensionBuildError)
C:/HashiCorp/Vagrant/embedded/bin/ruby.exe extconf.rb
C:/HashiCorp/Vagrant/embedded/bin/ruby.exe: invalid option -J (-h will show valid
options) (RuntimeError)
Gem files will remain installed in C:/Users/user_me/.vagrant.d/gems/gems/hitimes-
1.2.1 for inspection.
Results logged to C:/Users/user_me/.vagrant.d/gems/gems/hitimes-1.2.1/ext/hitimes/c/gem_make.out
from
C:/HashiCorp/Vagrant/embedded/lib/ruby/2.0.0/rubygems/ext/ext_conf_builder.rb:39:in `block in build'
if I issue
> gem install hitimes
that works fine, so the problem seems to be in the extension builder that Vagrant uses. I don't have alot of experience working with Ruby I was just wanting to start learning to use chef and berkshelf with vagrant.
This may be due to the version of Ruby
try rvm to manage your ruby environments, download ruby 1.9.3 through rvm
then
rvm use 1.9.3
vagrant plugin install vagrant-berkshelf
TL;DR:
$ gem install rubyzip
ERROR: While executing gem ... (Errno::EPERM)
Operation not permitted - /Users/darth/.rvm/gems/ruby-1.9.2-p136/gems/rubyzip-0.9.4/README
And now in detail. I'm not sure which information is relevant, so I'm just gonna say it all.
I recently upgraded from OS X Snow Leopard to Lion (also upgraded Xcode to 4.2)
Everything worked just fine for a while
Today I decided to install some gems (RSpec, Cucumber), and I started getting date format warnings whenever I did anything with RubyGems
I decided to update RubyGems, from 1.3.6 (I'm not sure here) to current 1.8.11
The warning kept on popping up, so I tried to remove the gemset with rvm gemset empty, which also failed, because of some permission denied error (yes stupid me didn't write it down)
In result of that, I reinstalled Ruby via rvm remove 1.9.2 and rvm install 1.9.2 (I didn't forget to rvm use 1.9.2 --default after that.
I installed bundler gem install bundle and then tried to bundle install in my Rails 3.1.1 project, but it ends with error
Installing rubyzip (0.9.4)
Errno::EPERM: Operation not permitted - /Users/darth/.rvm/gems/ruby-1.9.2-p136/gems/rubyzip-0.9.4/README
An error occured while installing rubyzip (0.9.4), and Bundler cannot continue.
Make sure that `gem install rubyzip -v '0.9.4'` succeeds before bundling.
gem install rubyzip -v '0.9.4' gives the above mentioned error
The README file says to download source and install from there via ruby install.rb, which also ends in error
$ ruby install.rb
/Users/darth/.rvm/rubies/ruby-1.9.2-p136/lib/ruby/1.9.1/fileutils.rb:841:in `install': wrong number of arguments (4 for 3) (ArgumentError)
from install.rb:21:in `block in <main>'
from install.rb:18:in `each'
from install.rb:18:in `<main>'
Even executing tests fro rubyzip ends up in bunch of errors
$ rake test
rake/gempackagetask is deprecated. Use rubygems/package_task instead
rake/rdoctask is deprecated. Use rdoc/task instead (in RDoc 2.4.2+)
/Users/darth/.rvm/rubies/ruby-1.9.2-p136/bin/ruby -C test alltests.rb
<internal:lib/rubygems/custom_require>:29:in `require': no such file to load -- stdrubyexttest (LoadError)
from <internal:lib/rubygems/custom_require>:29:in `require'
from alltests.rb:5:in `<main>'
rake aborted!
Command failed with status (1): [/Users/darth/.rvm/rubies/ruby-1.9.2-p136/b...]
Tasks: TOP => test
(See full trace by running task with --trace)
I'm out of ideas, what can I do?
I'm really not sure what caused this, but I managed to fix it by doing the following.
Since reinstalling Ruby 1.9.2 didn't help, I decided to be even more drastical and went down to rvm. I found out that I had version 1.1.something installed, which is about 9 months old.
I tried to update, but it didn't help, so rvm implode did the trick. I even had to sudo rm -rf ~/.rvm, probably because I managed to mess up some gem installs by adding sudo to them.
After reinstalling rvm and reinstalling 1.9.2, it seems like everything is working fine now, even with Xcode 4.2.
Lesson learned, rm -rf & reinstall is better than trying to upgrade from a year old version :)
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..