knife-batch icon indicating copy to clipboard operation
knife-batch copied to clipboard

can't install gem on MacOS X

Open prudnitskiy opened this issue 12 years ago • 4 comments

Trying to install plugin via gem (macosx, ruby 1.9.3-p194, rvm)

$ gem install knife-batch

/Users/logan/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/psych.rb:203:in `parse': (<unknown>): found character that cannot start any token while scanning for the next token at line 26 column 14 (Psych::SyntaxError)
    from /Users/logan/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/psych.rb:203:in `parse_stream'
    from /Users/logan/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/psych.rb:151:in `parse'
    from /Users/logan/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/psych.rb:127:in `load'
    from /Users/logan/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/site_ruby/1.9.1/rubygems/specification.rb:491:in `from_yaml'
    from /Users/logan/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/site_ruby/1.9.1/rubygems/package/tar_input.rb:195:in `load_gemspec'
    from /Users/logan/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/site_ruby/1.9.1/rubygems/package/tar_input.rb:60:in `block in initialize'
    from /Users/logan/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/site_ruby/1.9.1/rubygems/package/tar_reader.rb:64:in `block in each'
    from /Users/logan/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/site_ruby/1.9.1/rubygems/package/tar_reader.rb:55:in `loop'
    from /Users/logan/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/site_ruby/1.9.1/rubygems/package/tar_reader.rb:55:in `each'
    from /Users/logan/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/site_ruby/1.9.1/rubygems/package/tar_input.rb:35:in `initialize'
    from /Users/logan/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/site_ruby/1.9.1/rubygems/package/tar_input.rb:20:in `new'
    from /Users/logan/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/site_ruby/1.9.1/rubygems/package/tar_input.rb:20:in `open'
    from /Users/logan/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/site_ruby/1.9.1/rubygems/package.rb:44:in `open'
    from /Users/logan/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/site_ruby/1.9.1/rubygems/format.rb:62:in `from_io'
    from /Users/logan/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/site_ruby/1.9.1/rubygems/format.rb:46:in `block in from_file_by_path'
    from /Users/logan/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/site_ruby/1.9.1/rubygems/format.rb:45:in `open'
    from /Users/logan/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/site_ruby/1.9.1/rubygems/format.rb:45:in `from_file_by_path'
    from /Users/logan/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/site_ruby/1.9.1/rubygems/installer.rb:119:in `format'
    from /Users/logan/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/site_ruby/1.9.1/rubygems/installer.rb:129:in `spec'
    from /Users/logan/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/site_ruby/1.9.1/rubygems/installer.rb:386:in `ensure_required_ruby_version_met'
    from /Users/logan/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/site_ruby/1.9.1/rubygems/installer.rb:156:in `install'
    from /Users/logan/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/site_ruby/1.9.1/rubygems/dependency_installer.rb:297:in `block in install'
    from /Users/logan/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/site_ruby/1.9.1/rubygems/dependency_installer.rb:270:in `each'
    from /Users/logan/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/site_ruby/1.9.1/rubygems/dependency_installer.rb:270:in `each_with_index'
    from /Users/logan/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/site_ruby/1.9.1/rubygems/dependency_installer.rb:270:in `install'
    from /Users/logan/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/site_ruby/1.9.1/rubygems/commands/install_command.rb:121:in `block in execute'
    from /Users/logan/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/site_ruby/1.9.1/rubygems/commands/install_command.rb:115:in `each'
    from /Users/logan/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/site_ruby/1.9.1/rubygems/commands/install_command.rb:115:in `execute'
    from /Users/logan/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/site_ruby/1.9.1/rubygems/command.rb:278:in `invoke'
    from /Users/logan/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/site_ruby/1.9.1/rubygems/command_manager.rb:147:in `process_args'
    from /Users/logan/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/site_ruby/1.9.1/rubygems/command_manager.rb:117:in `run'
    from /Users/logan/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/site_ruby/1.9.1/rubygems/gem_runner.rb:65:in `run'
    from /Users/logan/.rvm/rubies/ruby-1.9.3-p194/bin/gem:25:in `<main>'

prudnitskiy avatar Dec 13 '12 09:12 prudnitskiy

What version of rubygems are you running? I'll see if I can replicate.

imeyer avatar Dec 13 '12 18:12 imeyer

Yeah I get the same issue. I'll find a fix for it and let you know.

imeyer avatar Dec 13 '12 19:12 imeyer

looks like you've got a invalid gem metadata inside your gem. this is probably due to building the gem with ruby 1.8's default yaml lib, and attempting to read it with the stricter psych lib in ruby 1.9+

If you just re-release the gem using ruby 1.9 to submit, you should be fine.

josephholsten avatar Mar 19 '13 21:03 josephholsten

Ah, also as a work around you can either:

Use this line in a Gemfile:

gem 'knife-batch', github: 'imeyer/knife-batch'

Or build and install the gem locally:

git clone git://github.com/imeyer/knife-batch.git
cd knife-batch
rake install

josephholsten avatar Mar 19 '13 21:03 josephholsten