红宝石无法解释的语法错误**意外的tPOW [英] ruby unexplained syntax error ** unexpected tPOW

查看:189
本文介绍了红宝石无法解释的语法错误**意外的tPOW的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

运行此命令:

 knife cookbook upload compat_resource

由于语法错误而失败:

FATAL: /apps/chef-repo/cookbooks/compat_resource/files/lib/chef_compat/copied_from_chef/chef/property.rb:56: syntax error, unexpected tPOW, expecting ')'
FATAL:      new(**options)
FATAL:            ^

我怀疑运行刀的版本小于2。

如何用特定的红宝石版磨刀。

如何用ruby> 2重新安装Chef?

 gem env
RubyGems Environment:
  - RUBYGEMS VERSION: 1.8.23
  - RUBY VERSION: 1.9.3 (2012-04-20 patchlevel 194) [x86_64-linux]
  - INSTALLATION DIRECTORY: /usr/local/rvm/gems/ruby-2.1.8
  - RUBY EXECUTABLE: /usr/bin/ruby1.9.1
  - EXECUTABLE DIRECTORY: /usr/local/rvm/gems/ruby-2.1.8/bin
  - RUBYGEMS PLATFORMS:
    - ruby
    - x86_64-linux
  - GEM PATHS:
     - /usr/local/rvm/gems/ruby-2.1.8
     - /usr/local/rvm/gems/ruby-2.1.8@global
  - GEM CONFIGURATION:
     - :update_sources => true
     - :verbose => true
     - :benchmark => false
     - :backtrace => false
     - :bulk_threshold => 1000
  - REMOTE SOURCES:
     - http://rubygems.org/

ruby​​ gems文件夹输出

ruby gems folder output

ls /usr/local/rvm/gems/ruby-2.1.8/gems
addressable-2.3.8           celluloid-io-0.16.2           httpclient-2.6.0.1           sawyer-0.6.0
berkshelf-4.0.1             cleanroom-1.0.0               minitar-0.5.4                semverse-1.2.1
berkshelf-api-client-2.0.0  dep-selector-libgecode-1.0.2  mixlib-authentication-1.3.0  solve-1.2.1
buff-config-1.0.1           dep_selector-1.0.3            mixlib-log-1.6.0             thor-0.19.1
buff-extensions-1.0.0       erubis-2.7.0                  multipart-post-2.0.0         timers-4.0.4
buff-ignore-1.1.1           faraday-0.9.2                 nio4r-1.2.0                  varia_model-0.4.1
buff-ruby_engine-0.1.0      ffi-1.9.10                    octokit-3.8.0
buff-shell_out-0.2.0        hashie-3.4.3                  retryable-2.0.3
celluloid-0.16.0            hitimes-1.2.3                 ridley-4.3.2


推荐答案

不能使用rubygems安装Chef,而是在工作站上使用 ChefDK 。它带有完整的红宝石堆栈(称其好坏。),从而确保Chef宝石和红宝石版本兼容。

Do not install Chef using rubygems, but use ChefDK on your workstation instead. This ships with a complete ruby stack (call this good or bad..) and thus ensures that the Chef gems and the ruby version are compatible.

这篇关于红宝石无法解释的语法错误**意外的tPOW的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆