annotate gem rails configuration give error - ruby-on-rails-4

Ruby: 2.3.0p0
Rails version : 4.2.6
annotate gem version: 2.7.1
On doing rails g annotate:install gives me this error:
(erb):34:in `template': uninitialized constant AnnotateModels (NameError)
from /Users/newput/.rvm/rubies/ruby-2.3.0/lib/ruby/2.3.0/erb.rb:864:in `eval'
from /Users/newput/.rvm/rubies/ruby-2.3.0/lib/ruby/2.3.0/erb.rb:864:in `result'
from /Users/newput/.rvm/gems/ruby-2.3.0/gems/thor-0.19.1/lib/thor/actions/file_manipulation.rb:116:in `block in template'
from /Users/newput/.rvm/gems/ruby-2.3.0/gems/thor-0.19.1/lib/thor/actions/create_file.rb:53:in `render'
from /Users/newput/.rvm/gems/ruby-2.3.0/gems/thor-0.19.1/lib/thor/actions/create_file.rb:62:in `block (2 levels) in invoke!'
from /Users/newput/.rvm/gems/ruby-2.3.0/gems/thor-0.19.1/lib/thor/actions/create_file.rb:62:in `open'
from /Users/newput/.rvm/gems/ruby-2.3.0/gems/thor-0.19.1/lib/thor/actions/create_file.rb:62:in `block in invoke!'
from /Users/newput/.rvm/gems/ruby-2.3.0/gems/thor-0.19.1/lib/thor/actions/empty_directory.rb:116:in `invoke_with_conflict_check'
from /Users/newput/.rvm/gems/ruby-2.3.0/gems/thor-0.19.1/lib/thor/actions/create_file.rb:60:in `invoke!'
from /Users/newput/.rvm/gems/ruby-2.3.0/gems/thor-0.19.1/lib/thor/actions.rb:94:in `action'
from /Users/newput/.rvm/gems/ruby-2.3.0/gems/thor-0.19.1/lib/thor/actions/create_file.rb:25:in `create_file'
from /Users/newput/.rvm/gems/ruby-2.3.0/gems/thor-0.19.1/lib/thor/actions/file_manipulation.rb:115:in `template'
from /Users/newput/.rvm/gems/ruby-2.3.0/gems/annotate-2.7.1/lib/generators/annotate/install_generator.rb:9:in `copy_tasks'

I'm not sure if this solves your error, but I got same error by following steps:
$ rails new hi
$ cd hi
$ echo "gem 'annotate', '2.7.1', require: false" >> Gemfile
$ bundle
$ rails g annotate:install
Running via Spring preloader in process 29328
create lib/tasks/auto_annotate_models.rake
(erb):34:in `template': uninitialized constant AnnotateModels (NameError)
from /home/hibariya/.rbenv/versions/2.3.0/lib/ruby/2.3.0/erb.rb:864:in `eval'
from /home/hibariya/.rbenv/versions/2.3.0/lib/ruby/2.3.0/erb.rb:864:in `result'
from /home/hibariya/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/thor-0.19.1/lib/thor/actions/file_manipulation.rb:116:in `block in template'
...
I think this error can be fixed by requiring the annotate-gem in advance.
So when I removed require: false from gem 'annotate', '2.7.1', require: false in the Gemfile then the error was fixed.

Related

Error with vagrant up for aws

Triying to run vagrant up --provider=aws I get the following error.
/opt/vagrant/embedded/gems/2.1.0/gems/vagrant-2.1.0/lib/vagrant/machine.rb:164:in `action': undefined method `fire_triggers' for nil:NilClass (NoMethodError)
from /home/martin/.vagrant.d/gems/2.4.4/gems/vagrant-aws-0.7.2/lib/vagrant-aws/provider.rb:32:in `state'
from /opt/vagrant/embedded/gems/2.1.0/gems/vagrant-2.1.0/lib/vagrant/machine.rb:521:in `state'
from /opt/vagrant/embedded/gems/2.1.0/gems/vagrant-2.1.0/lib/vagrant/machine.rb:145:in `initialize'
from /opt/vagrant/embedded/gems/2.1.0/gems/vagrant-2.1.0/lib/vagrant/vagrantfile.rb:79:in `new'
from /opt/vagrant/embedded/gems/2.1.0/gems/vagrant-2.1.0/lib/vagrant/vagrantfile.rb:79:in `machine'
from /opt/vagrant/embedded/gems/2.1.0/gems/vagrant-2.1.0/lib/vagrant/environment.rb:700:in `machine'
from /opt/vagrant/embedded/gems/2.1.0/gems/vagrant-2.1.0/lib/vagrant/plugin/v2/command.rb:180:in `block in with_target_vms'
from /opt/vagrant/embedded/gems/2.1.0/gems/vagrant-2.1.0/lib/vagrant/plugin/v2/command.rb:204:in `block in with_target_vms'
from /opt/vagrant/embedded/gems/2.1.0/gems/vagrant-2.1.0/lib/vagrant/plugin/v2/command.rb:186:in `each'
from /opt/vagrant/embedded/gems/2.1.0/gems/vagrant-2.1.0/lib/vagrant/plugin/v2/command.rb:186:in `with_target_vms'
from /opt/vagrant/embedded/gems/2.1.0/gems/vagrant-2.1.0/plugins/commands/up/command.rb:87:in `execute'
from /opt/vagrant/embedded/gems/2.1.0/gems/vagrant-2.1.0/lib/vagrant/cli.rb:54:in `execute'
from /opt/vagrant/embedded/gems/2.1.0/gems/vagrant-2.1.0/lib/vagrant/environment.rb:275:in `cli'
from /opt/vagrant/embedded/gems/2.1.0/gems/vagrant-2.1.0/bin/vagrant:156:in `<main>'
My vagrant file is:
# -*- mode: ruby -*-
# vi: set ft=ruby :
require 'vagrant-aws'
Vagrant.configure("2") do |config|
config.vm.box = "aws-dummy"
config.vm.provider :aws do |aws, override|
aws.access_key_id = "my_key_id"
aws.secret_access_key = "my_access_key"
aws.keypair_name = "my_keypair_name"
aws.ami = "ami-916f59f4"
override.ssh.username = "ubuntu"
override.ssh.private_key_path = "/home/my_user/.ssh/id_rsa"
end
end
I'm running vagrant version 2.1.0, I also installed vagrant-aws(0.7.2) plugin.
The question is what i'm doing wrong?
Thanks.
Well, as suggested by PrasadK it seems to be a bug, not the particular one you suggested, but there is a bug in version 2.1.0.
I manually upgrade varian to 2.1.1 and the problem is fixed.

sidekiq - WARN: ArgumentError: wrong number of arguments (given 0, expected 2..3)

It shows wrong number of arguments but I am passing 3 arguments
ScannerWorker.perform_async('bob1','bob2',5)
Here sidekiq worker code
class ScannerWorker
include Sidekiq::Worker
def perform(bob1, bob2, bob3)
puts bob1
end
end
sidekiq version:- 4.2.7
rails 4.2.6
Redis server v=3.0.7
Sidekiq Error:-
2017-01-03T06:29:43.007Z 9547 TID-itjjk WARN: ArgumentError: wrong number of arguments (given 0, expected 2..3)
2017-01-03T06:29:43.007Z 9547 TID-itjjk WARN: /home/smk/14.04/rails/projects/myappname/app/workers/scanner_worker.rb:5:in `test'
/home/smk/14.04/rails/projects/myappname/app/workers/scanner_worker.rb:5:in `perform'
/home/smk/14.04/rails/projects/myappname/vendor/bundle/gems/sidekiq-4.2.7/lib/sidekiq/processor.rb:158:in `execute_job'
/home/smk/14.04/rails/projects/myappname/vendor/bundle/gems/sidekiq-4.2.7/lib/sidekiq/processor.rb:138:in `block (4 levels) in process'
/home/smk/14.04/rails/projects/myappname/vendor/bundle/gems/sidekiq-4.2.7/lib/sidekiq.rb:36:in `block in <module:Sidekiq>'
/home/smk/14.04/rails/projects/myappname/vendor/bundle/gems/sidekiq-4.2.7/lib/sidekiq/processor.rb:133:in `block (3 levels) in process'
/home/smk/14.04/rails/projects/myappname/vendor/bundle/gems/sidekiq-4.2.7/lib/sidekiq/middleware/chain.rb:128:in `block in invoke'
/home/smk/14.04/rails/projects/myappname/vendor/bundle/gems/sidekiq-4.2.7/lib/sidekiq/middleware/server/active_record.rb:6:in `call'
/home/smk/14.04/rails/projects/myappname/vendor/bundle/gems/sidekiq-4.2.7/lib/sidekiq/middleware/chain.rb:130:in `block in invoke'
/home/smk/14.04/rails/projects/myappname/vendor/bundle/gems/sidekiq-4.2.7/lib/sidekiq/middleware/server/retry_jobs.rb:74:in `call'
/home/smk/14.04/rails/projects/myappname/vendor/bundle/gems/sidekiq-4.2.7/lib/sidekiq/middleware/chain.rb:130:in `block in invoke'
/home/smk/14.04/rails/projects/myappname/vendor/bundle/gems/sidekiq-4.2.7/lib/sidekiq/middleware/server/logging.rb:11:in `block in call'
/home/smk/14.04/rails/projects/myappname/vendor/bundle/gems/sidekiq-4.2.7/lib/sidekiq/logging.rb:32:in `with_context'
/home/smk/14.04/rails/projects/myappname/vendor/bundle/gems/sidekiq-4.2.7/lib/sidekiq/middleware/server/logging.rb:7:in `call'
/home/smk/14.04/rails/projects/myappname/vendor/bundle/gems/sidekiq-4.2.7/lib/sidekiq/middleware/chain.rb:130:in `block in invoke'
/home/smk/14.04/rails/projects/myappname/vendor/bundle/gems/sidekiq-4.2.7/lib/sidekiq/middleware/chain.rb:133:in `invoke'
/home/smk/14.04/rails/projects/myappname/vendor/bundle/gems/sidekiq-4.2.7/lib/sidekiq/processor.rb:132:in `block (2 levels) in process'
/home/smk/14.04/rails/projects/myappname/vendor/bundle/gems/sidekiq-4.2.7/lib/sidekiq/processor.rb:174:in `stats'
/home/smk/14.04/rails/projects/myappname/vendor/bundle/gems/sidekiq-4.2.7/lib/sidekiq/processor.rb:131:in `block in process'
/home/smk/14.04/rails/projects/myappname/vendor/bundle/gems/sidekiq-4.2.7/lib/sidekiq.rb:35:in `block in <module:Sidekiq>'
/home/smk/14.04/rails/projects/myappname/vendor/bundle/gems/sidekiq-4.2.7/lib/sidekiq/processor.rb:126:in `process'
/home/smk/14.04/rails/projects/myappname/vendor/bundle/gems/sidekiq-4.2.7/lib/sidekiq/processor.rb:82:in `process_one'
/home/smk/14.04/rails/projects/myappname/vendor/bundle/gems/sidekiq-4.2.7/lib/sidekiq/processor.rb:70:in `run'
/home/smk/14.04/rails/projects/myappname/vendor/bundle/gems/sidekiq-4.2.7/lib/sidekiq/util.rb:17:in `watchdog'
/home/smk/14.04/rails/projects/myappname/vendor/bundle/gems/sidekiq-4.2.7/lib/sidekiq/util.rb:25:in `block in safe_thread'
You need to restart Sidekiq. Live code reloading only works with Sidekiq 4.2+ running Rails 5.0+.
Follow this steps
* Mention the sidekiq version in gemfile
* kill the sidekiq process and restart the sidekiq
You need to restart Sidekiq
To Start:
$ bundle exec sidekiq
To Run in the background:
$ bundle exec sidekiq -d -P tmp/sidekiq.pid -L log/sidekiq.log
where -d demonize, -P pid file, -L log file.
Stop:
$ bundle exec sidekiqctl stop tmp/sidekiq.pid 0
Sidekiq shut down gracefully.
where 0 is number of seconds to wait until Sidekiq exits.
worth noting. I've been working on a similar issue.
SomeWorker.perform_async(#user.id)
class SomeWorker
include Sidekiq::Worker
def perform(user_id)
puts "{user_id}"
end
end
unsure exactly why i was getting the arguments error. Maybe it was an because of an instance variable, maybe a rails bug.
Nevertheless, I receated the worker using
$rails g sidekiq:worker SomeWorker
and saw this *.
class SomeWorker
include Sidekiq::Worker
def perform(*args)
puts #some thing
end
end
by adding the astrix everything worked perfectly.
quick answer:
class SomeWorker
include Sidekiq::Worker
def perform(*user_id)
puts #some thing
end
end

Could not find ruby-oci8, when deploying Rails application using Bundler

Not sure how to go about debugging this error. Deployment of this Rails application is successful on the development server but I get bundle stdout: Could not find ruby-oci8-2.2.0 in any of the sources (error) when deploying to the production server.
Is the error message saying that it can't find ruby-oci8 in the gemset? Any ideas on how I might go about debugging why the deployment isn't working on the production server?
I am using the below Capistrano Gems
capistrano (3.4.0)
capistrano-bundler (1.1.4)
capistrano-file-permissions (0.1.1)
capistrano-rails (1.1.3)
capistrano-rvm (0.1.2)
Shortened message from running: cap production deploy
** Invoke deploy:updated (first_time)
** Invoke bundler:install (first_time)
** Execute bundler:install
DEBUG [103a4281] Running /usr/bin/env if test ! -d /home/rails/apps/cals_db_sync/releases/20151020160801; then echo "Directory does not exist '/home/rails/apps/cals_db_sync/releases/20151020160801'" 1>&2; false; fi as deploy_user#example.com
DEBUG [103a4281] Command: if test ! -d /home/rails/apps/cals_db_sync/releases/20151020160801; then echo "Directory does not exist '/home/rails/apps/cals_db_sync/releases/20151020160801'" 1>&2; false; fi
DEBUG [103a4281] Finished in 0.006 seconds with exit status 0 (successful).
INFO [60676e5b] Running /usr/local/rvm/bin/rvm ruby-2.1.6#cals_db_sync do bundle install --path /home/rails/apps/cals_db_sync/shared/bundle --without development test --deployment --quiet as deploy_user#example.com
DEBUG [60676e5b] Command: cd /home/rails/apps/cals_db_sync/releases/20151020160801 && ( RVM_BIN_PATH=/usr/local/rvm/bin /usr/local/rvm/bin/rvm ruby-2.1.6#cals_db_sync do bundle install --path /home/rails/apps/cals_db_sync/shared/bundle --without development test --deployment --quiet )
DEBUG [60676e5b] Could not find ruby-oci8-2.2.0 in any of the sources
cap aborted!
SSHKit::Runner::ExecuteError: Exception while executing as deploy_user#example.com: bundle exit status: 7
bundle stdout: Could not find ruby-oci8-2.2.0 in any of the sources
bundle stderr: Nothing written
/usr/local/rvm/gems/ruby-2.1.6#cals_db_sync/gems/sshkit-1.7.1/lib/sshkit/runners/parallel.rb:16:in `rescue in block (2 levels) in execute'
/usr/local/rvm/gems/ruby-2.1.6#cals_db_sync/gems/sshkit-1.7.1/lib/sshkit/runners/parallel.rb:12:in `block (2 levels) in execute'
SSHKit::Command::Failed: bundle exit status: 7
bundle stdout: Could not find ruby-oci8-2.2.0 in any of the sources
bundle stderr: Nothing written
/usr/local/rvm/gems/ruby-2.1.6#cals_db_sync/gems/sshkit-1.7.1/lib/sshkit/command.rb:95:in `exit_status='
/usr/local/rvm/gems/ruby-2.1.6#cals_db_sync/gems/sshkit-1.7.1/lib/sshkit/backends/netssh.rb:179:in `block in _execute'
/usr/local/rvm/gems/ruby-2.1.6#cals_db_sync/gems/sshkit-1.7.1/lib/sshkit/backends/netssh.rb:133:in `tap'
/usr/local/rvm/gems/ruby-2.1.6#cals_db_sync/gems/sshkit-1.7.1/lib/sshkit/backends/netssh.rb:133:in `_execute'
/usr/local/rvm/gems/ruby-2.1.6#cals_db_sync/gems/sshkit-1.7.1/lib/sshkit/backends/netssh.rb:66:in `execute'
/usr/local/rvm/gems/ruby-2.1.6#cals_db_sync/gems/capistrano-bundler-1.1.4/lib/capistrano/tasks/bundler.cap:35:in `block (5 levels) in <top (required)>'
/usr/local/rvm/gems/ruby-2.1.6#cals_db_sync/gems/sshkit-1.7.1/lib/sshkit/backends/abstract.rb:85:in `with'
/usr/local/rvm/gems/ruby-2.1.6#cals_db_sync/gems/capistrano-bundler-1.1.4/lib/capistrano/tasks/bundler.cap:26:in `block (4 levels) in <top (required)>'
/usr/local/rvm/gems/ruby-2.1.6#cals_db_sync/gems/sshkit-1.7.1/lib/sshkit/backends/abstract.rb:77:in `within'
/usr/local/rvm/gems/ruby-2.1.6#cals_db_sync/gems/capistrano-bundler-1.1.4/lib/capistrano/tasks/bundler.cap:25:in `block (3 levels) in <top (required)>'
/usr/local/rvm/gems/ruby-2.1.6#cals_db_sync/gems/sshkit-1.7.1/lib/sshkit/backends/netssh.rb:54:in `instance_exec'
/usr/local/rvm/gems/ruby-2.1.6#cals_db_sync/gems/sshkit-1.7.1/lib/sshkit/backends/netssh.rb:54:in `run'
/usr/local/rvm/gems/ruby-2.1.6#cals_db_sync/gems/sshkit-1.7.1/lib/sshkit/runners/parallel.rb:13:in `block (2 levels) in execute'
Tasks: TOP => deploy:updated => bundler:install
The deploy has failed with an error: Exception while executing as deploy_user#example.com: bundle exit status: 7
bundle stdout: Could not find ruby-oci8-2.2.0 in any of the sources
bundle stderr: Nothing written
** Invoke deploy:failed (first_time)
** Execute deploy:failed
Gemfile:
source 'https://rubygems.org'
# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '4.2.4'
gem 'exception_notification'
# Use mysql as the database for Active Record
gem 'mysql2', '0.3.20' # Of 9/2015, the '0.4.*' is BUGGY and BREAKS!
# Build Tabless Models
gem "activerecord-tableless" # , "~> 1.0"
# Due to upgrading this Rails 3 app to Rails 4, needed the below gem to work with
# Rails 4 Mass Assignment Security. (Rails 3 handled Mass Assignment security via Models)
gem 'protected_attributes'
# Using the "Chamber" gem to address Rails 4's "Secret Key Base"
# Install?
# 1- bundle
# 2- add to your project via "$ chamber init"
# a. creates a public key called .chamber.pem.pub
# b. creates a protected key called .chamber.pem.enc
# c. creates a private key called .chamber.pem
# d. adds the protected and private keys to your .gitignore file so they aren't accidentally checked in
# e. creates a settings.yml file to get you started
# Note: Keep the private key safe since anyone who has it will be able to decrypt any settings that Chamber encrypts for you.
gem 'chamber'
# Installed and currently using
# hashie 3.4.2
# chamber 2.8.0
# Whenver Gem needed for Cron Jobs
# run: wheneverize (dot) # or wheneverize . ... use after bundle to setup Whenever
# See whenever output in console by: bundle exec whenever
gem 'whenever', require: false # set to false b/c don't want to use directly within Rails App
gem 'ruby-oci8'
gem 'activerecord-oracle_enhanced-adapter', '~> 1.6.0'
# Rails 4.0 & 4.1 => '~> 1.5.0'
# Rails 4.2 => '~> 1.6.0'
# Not needed yet ... Add ability to database table field comments when migrating
#gem 'migration_comments'
# Add settingslogic to App for Global variables
# it's a simple configuration / settings solution that uses an ERB enabled YAML file.
gem 'settingslogic'
# Use SCSS for stylesheets
gem 'sass-rails', '~> 4.0.2'
# Use Uglifier as compressor for JavaScript assets
gem 'uglifier', '>= 1.3.0'
# Use CoffeeScript for .js.coffee assets and views
gem 'coffee-rails', '~> 4.0.0'
# See https://github.com/sstephenson/execjs#readme for more supported runtimes
# gem 'therubyracer', platforms: :ruby
# Use jquery as the JavaScript library
gem 'jquery-rails'
# Turbolinks makes following links in your web application faster. Read more: https://github.com/rails/turbolinks
gem 'turbolinks'
# Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder
gem 'jbuilder', '~> 1.2'
group :doc do
# bundle exec rake doc:rails generates the API under doc/api.
gem 'sdoc', require: false
end
# Use ActiveModel has_secure_password
# gem 'bcrypt', '~> 3.1.7'
# Use debugger
# gem 'debugger', group: [:development, :test]
# Bundle gems for the local environment. Make sure to
# put test-only gems in this group so their generators
# and rake tasks are available in development mode:
group :test do
gem 'rspec-rails' # rails generate rspec:install
gem 'shoulda'
gem 'shoulda-matchers'
gem 'capybara'
#gem 'selenium-webdriver'
gem 'factory_girl_rails'
gem 'database_cleaner'
end
group :development do
gem 'rspec-rails' # rspec in dev so the rake tasks run properly
gem 'factory_girl_rails'
# Call 'byebug' anywhere in the code to stop execution and get a debugger console
gem 'byebug' # for Ruby 2
# Deploy with Capistrano
# Setting as of 07/2015
gem 'capistrano', '~> 3.1' # , require: false # is using -v 3.4.0
gem 'capistrano-rails', '~> 1.1' # , require: false
gem 'capistrano-bundler', '~> 1.1.2'
gem 'capistrano-rvm'
gem 'capistrano-file-permissions'
# $ bundle
# $ cap install
end
It would sound like you have the Oracle Ruby gem in a development block. It would help if you posted your Gemfile.
I reverted the ruby-oci8 gem back to version 2.1.7 in the Gemfile instead of using the latest version of 2.2.0. And the deployment (bundle install) through Capistrano worked. On the Ubuntu servers I am using Oracle Instant Client and SDK version 11.2.0.3.0
After the successful deployment, I looked on the production server at the installed gems, the ruby-oci8 gem had a datestamp of this past February (when it was last installed) so I am curious if the ruby-oci8 had not previously existed and needed to be installed if the "bundle install" would work ...

How to setup puppet-rspec correctly?

I'm following the instructions from here
gem install rvm
gem install bundle
# Demo dir
# Gemfile
source "https://rubygems.org"
gem 'rspec-puppet', :require => false
gem 'puppetlabs_spec_helper', :require => false
gem 'puppet', '~> 3.7.5'
gem 'rspec-puppet-facts'
# spec_helper.rb
require 'puppetlabs_spec_helper/module_spec_helper'
require 'rspec-puppet-facts'
include RspecPuppetFacts
Now when I run bundle exec rake spec I get the following error:
/usr/bin/ruby -I/usr/lib64/ruby/gems/1.8/gems/rspec-core-3.3.1/lib:/usr/lib/ruby/gems/1.8/gems/rspec-support-3.3.0/lib /usr/lib64/ruby/gems/1.8/gems/rspec-core-3.3.1/exe/rspec --pattern spec/\{classes,defines,unit,functions,hosts,integration\}/\*\*/\*_spec.rb --color
Total resources: 0
Touched resources: 0
Resource coverage: -nan%
Untouched resources:
/usr/lib64/ruby/gems/1.8/gems/rspec-core-3.3.1/lib/rspec/core/hooks.rb:516:in `all_hooks_for': return from proc-closure (LocalJumpError)
from /usr/lib64/ruby/gems/1.8/gems/rspec-core-3.3.1/lib/rspec/core/hooks.rb:568:in `process'
from /usr/lib64/ruby/gems/1.8/gems/rspec-core-3.3.1/lib/rspec/core/flat_map.rb:12:in `map'
from /usr/lib64/ruby/gems/1.8/gems/rspec-core-3.3.1/lib/rspec/core/flat_map.rb:12:in `flat_map'
from /usr/lib64/ruby/gems/1.8/gems/rspec-core-3.3.1/lib/rspec/core/hooks.rb:567:in `process'
from /usr/lib64/ruby/gems/1.8/gems/rspec-core-3.3.1/lib/rspec/core/hooks.rb:433:in `register_globals'
from /usr/lib64/ruby/gems/1.8/gems/rspec-core-3.3.1/lib/rspec/core/example_group.rb:395:in `set_it_up'
from /usr/lib64/ruby/gems/1.8/gems/rspec-core-3.3.1/lib/rspec/core/example_group.rb:362:in `subclass'
from /usr/lib64/ruby/gems/1.8/gems/rspec-core-3.3.1/lib/rspec/core/example_group.rb:254:in `describe'
from /usr/lib64/ruby/gems/1.8/gems/rspec-core-3.3.1/lib/rspec/core/dsl.rb:43:in `__send__'
from /usr/lib64/ruby/gems/1.8/gems/rspec-core-3.3.1/lib/rspec/core/dsl.rb:43:in `describe'
from /usr/lib64/ruby/gems/1.8/gems/rspec-core-3.3.1/lib/rspec/core/dsl.rb:82:in `__send__'
from /usr/lib64/ruby/gems/1.8/gems/rspec-core-3.3.1/lib/rspec/core/dsl.rb:82:in `describe'
from /etc/puppet/modules/demo/spec/classes/example_spec.rb:3
from /usr/lib64/ruby/gems/1.8/gems/rspec-core-3.3.1/lib/rspec/core/configuration.rb:1327:in `load'
from /usr/lib64/ruby/gems/1.8/gems/rspec-core-3.3.1/lib/rspec/core/configuration.rb:1327:in `load_spec_files'
from /usr/lib64/ruby/gems/1.8/gems/rspec-core-3.3.1/lib/rspec/core/configuration.rb:1325:in `each'
from /usr/lib64/ruby/gems/1.8/gems/rspec-core-3.3.1/lib/rspec/core/configuration.rb:1325:in `load_spec_files'
from /usr/lib64/ruby/gems/1.8/gems/rspec-core-3.3.1/lib/rspec/core/runner.rb:102:in `setup'
from /usr/lib64/ruby/gems/1.8/gems/rspec-core-3.3.1/lib/rspec/core/runner.rb:88:in `run'
from /usr/lib64/ruby/gems/1.8/gems/rspec-core-3.3.1/lib/rspec/core/runner.rb:73:in `run'
from /usr/lib64/ruby/gems/1.8/gems/rspec-core-3.3.1/lib/rspec/core/runner.rb:41:in `invoke'
from /usr/lib64/ruby/gems/1.8/gems/rspec-core-3.3.1/exe/rspec:4
/usr/bin/ruby -I/usr/lib64/ruby/gems/1.8/gems/rspec-core-3.3.1/lib:/usr/lib/ruby/gems/1.8/gems/rspec-support-3.3.0/lib /usr/lib64/ruby/gems/1.8/gems/rspec-core-3.3.1/exe/rspec --pattern spec/\{classes,defines,unit,functions,hosts,integration\}/\*\*/\*_spec.rb --color failed
Any thoughts on how I can resolve this? Or can someone provide some clear instructions on how can go about getting this to work on a CentOS 6.5 machine?
Updating the Gemfile to the following and running bundle update worked:
source 'https://rubygems.org'
if puppetversion = ENV['PUPPET_GEM_VERSION']
gem 'puppet', puppetversion, :require => false
else
gem 'puppet', '3.7.5'
end
gem 'metadata-json-lint'
gem 'puppetlabs_spec_helper', '>= 0.1.0'
gem 'puppet-lint', '>= 1.0.0'
gem 'facter', '>= 1.7.0'
gem 'rspec-puppet-facts'
# rspec must be v2 for ruby 1.8.7
if RUBY_VERSION >= '1.8.7' and RUBY_VERSION < '1.9'
gem 'rspec', '~> 2.0'
end

vmc tunnel not working on api.cloudfoundry.com with Ruby 2.0

I am trying to tunnel the mysql service on api.cloudfoundry.com but facing the error below.
I have installed Ruby 2.0
installed gem versions :
* LOCAL GEMS *
addressable (2.3.3, 2.2.8),async_sinatra (0.5.0),bigdecimal (1.2.0),caldecott (0.0.5),caldecott-client (0.0.2),cf-uaa-lib (1.3.10),cfoundry (0.5.3.rc5),clouseau (0.0.2),
em-http-request (0.3.0),em-websocket (0.3.8),escape_utils (0.3.2),eventmachine (1.0.3 ruby x86-mingw32),interact (0.5.2),io-console (0.4.2),json (1.7.7, 1.6.8),json_pure (1.7.7),
manifests-vmc-plugin (0.6.3.rc2),mime-types (1.21),minitest (4.3.2),mothership (0.5.1),
multi_json (1.7.0),multipart-post (1.2.0),psych (2.0.0),rack (1.5.2),rack-protection (1.5.0),rake (0.9.6),rdoc (4.0.0),rest-client (1.6.7),rubygems-update (2.0.3),
rubyzip (0.9.9),sinatra (1.4.1),test-unit (2.0.0.0),tilt (1.3.6),tunnel-vmc-plugin (0.2.2),
uuidtools (2.1.3),vmc (0.5.1.rc4)
C:\Users\user>vmc tunnel
DL is deprecated, please use Fiddle
1: mongo-hello
2: mysql-hello
3: rabbit-hello
Which service instance?> 2
1: none
2: mysql
3: mysqldump
Which client would you like to start?> 2
Opening tunnel on port 10000... FAILED
CFoundry::BadResponse: 400: <h2>Client sent a bad request.</h2>
For more information, see ~/.vmc/crash
crash contents:
Time of crash:
2013-03-20 17:30:10 +0530
CFoundry::BadResponse: 400: <h2>Client sent a bad request.</h2>
<<<
REQUEST: GET http://api.cloudfoundry.com/apps/caldecott
REQUEST_HEADERS:
Accept : application/json
Authorization : bearer eyJhbGciOiJSUzI1NiJ9.eyJleHAiOjEzNjQwOTc3OTksInVzZXJfbmFtZSI6ImFtdWxsYXdvcmtAZ21haWwuY29tIiwic2NvcGUiOlsiY2xvdWRfY29udHJvbGxlci5yZWFkIiwib3BlbmlkIiwicGFzc3dvcmQud3JpdGUiXSwiZW1haWwiOiJhbXVsbGF3b3JrQGdtYWlsLmNvbSIsImF1ZCI6WyJvcGVuaWQiLCJjbG91ZF9jb250cm9sbGVyIiwicGFzc3dvcmQiXSwianRpIjoiOGEzYmNhYzEtOTdjMC00OGY2LWE1YjAtNmZhNjFkNTM1YzRiIiwidXNlcl9pZCI6Ijc1NGE0YmE0LTQxNDMtNDA1NC05OWE3LWRkOGJlYTA1NzMyOSIsImNsaWVudF9pZCI6InZtYyJ9.bgY7BUi7DpjKL4gy5YkbTJDYuYXHhHPzKPZApabeA_dpRLfcr1yhprlx2Yx1Shavdso-R9jYg3jiy9MuTUhZ6hvIVVoKcaFxcw43owb2ztXxb_VM6N2wmyXnLX5dmSXNIv7xa5hgbeuwE32rSR66sLNGEgHu-sreaKQIN9V6GbOe-Bj4WN-uux0O8AGmol5sp1QhD4Nf2nAmsiPHR63OhS6-SDBYgizcmpfWgwGeOMvcTumbYJ6PpvRNPa20pQomjDOqSY2Jn_tQM7RfZCklpyZKvdt2RIQK5fWAekMLWlnG3aJYHE90UHnxg0UclhwzgrgI0HiDWkQ_42dqOX446g
Content-Length : 297
Content-Type : application/json
REQUEST_BODY: {"name":"caldecott","instances":1,"staging":{"model":"sinatra","stack":"ruby19","command":"bundle exec ruby server.rb -p $VCAP_APP_PORT"},"resources":{"memory":64},"env":["CALDECOTT_AUTH=9d498baf-9102-4c80-851d-f400530a261f"],"uris":["caldecott-b58c1.cloudfoundry.com"],"services":["mysql-hello"]}
RESPONSE: [400]
RESPONSE_HEADERS:
content-type : text/html
RESPONSE_BODY:
<h2>Client sent a bad request.</h2>
>>>
cfoundry-0.5.3.rc5/lib/cfoundry/baseclient.rb:167:in `handle_error_response'
cfoundry-0.5.3.rc5/lib/cfoundry/baseclient.rb:137:in `handle_response'
cfoundry-0.5.3.rc5/lib/cfoundry/baseclient.rb:87:in `request'
cfoundry-0.5.3.rc5/lib/cfoundry/baseclient.rb:72:in `post'
cfoundry-0.5.3.rc5/lib/cfoundry/v1/model_magic.rb:46:in `block (2 levels) in define_client_methods'
cfoundry-0.5.3.rc5/lib/cfoundry/v1/model.rb:83:in `create!'
tunnel-vmc-plugin-0.2.2/lib/tunnel-vmc-plugin/tunnel.rb:145:in `push_helper'
tunnel-vmc-plugin-0.2.2/lib/tunnel-vmc-plugin/tunnel.rb:88:in `create_helper'
tunnel-vmc-plugin-0.2.2/lib/tunnel-vmc-plugin/tunnel.rb:28:in `open!'
tunnel-vmc-plugin-0.2.2/lib/tunnel-vmc-plugin/plugin.rb:41:in `block in tunnel'
interact-0.5.2/lib/interact/progress.rb:98:in `with_progress'
tunnel-vmc-plugin-0.2.2/lib/tunnel-vmc-plugin/plugin.rb:40:in `tunnel'
mothership-0.5.1/lib/mothership/base.rb:66:in `run'
mothership-0.5.1/lib/mothership/command.rb:72:in `block in invoke'
mothership-0.5.1/lib/mothership/command.rb:86:in `instance_exec'
mothership-0.5.1/lib/mothership/command.rb:86:in `invoke'
mothership-0.5.1/lib/mothership/base.rb:55:in `execute'
vmc-0.5.1.rc4/lib/vmc/cli.rb:150:in `block (2 levels) in execute'
vmc-0.5.1.rc4/lib/vmc/cli.rb:161:in `save_token_if_it_changes'
vmc-0.5.1.rc4/lib/vmc/cli.rb:149:in `block in execute'
vmc-0.5.1.rc4/lib/vmc/cli.rb:100:in `wrap_errors'
vmc-0.5.1.rc4/lib/vmc/cli.rb:145:in `execute'
mothership-0.5.1/lib/mothership.rb:45:in `start'
vmc-0.5.1.rc4/bin/vmc:11:in `<top (required)>'
D:/Ruby200/bin/vmc:23:in `load'
D:/Ruby200/bin/vmc:23:in `<main>'
Try deleting the caldecott application and then trying the tunnel again;
$ vmc delete caldecott
$ vmc tunnel