Casecommons/chef_cap — Issue #5: uninitialized constant Spice (NameError)
Author: tightwork
Created: 2011-12-05 22:55:30+00:00
State: open

Hi,

I am attempting the basic connection script to my chef server, although I get an error:

```
./chef_get.rb:7: uninitialized constant Spice (NameError)
````

I have tried using straight gem install, and building the gem from git directly. I have specified the gem and the version in the code but same error.

Please help,
Bryan

```ruby
#!/usr/bin/env ruby

require 'rubygems'
#gem 'spice', '= 0.7.3'
gem 'spice'

Spice.server_url = "http://chef.domain.com:4000"
Spice.client_name = "chef-validator"
Spice.key_file = "/etc/chef/client.pem"
Spice.connect!
```

```
root@tools1:~# ruby -v
ruby 1.8.7 (2010-08-16 patchlevel 302) [x86_64-linux]
root@tools1:~# gem -v
1.8.12
```

```
root@tools1:~# ls -lha /usr/lib/ruby/gems/1.8/gems/spice-0.7.3/
total 64K
drwxr-xr-x 4 root root 4.0K 2011-12-05 17:40 .
drwxr-xr-x 137 root root 4.0K 2011-12-05 17:40 ..
-rw-r--r-- 1 root root 445 2011-12-05 17:40 CHANGELOG.md
-rw-r--r-- 1 root root 55 2011-12-05 17:40 .document
-rw-r--r-- 1 root root 391 2011-12-05 17:40 Gemfile
-rw-r--r-- 1 root root 78 2011-12-05 17:40 .gitignore
-rw-r--r-- 1 root root 261 2011-12-05 17:40 Guardfile
drwxr-xr-x 3 root root 4.0K 2011-12-05 17:42 lib
-rw-r--r-- 1 root root 1.1K 2011-12-05 17:40 LICENSE.txt
-rw-r--r-- 1 root root 433 2011-12-05 17:40 Rakefile
-rw-r--r-- 1 root root 3.7K 2011-12-05 17:40 README.md
-rw-r--r-- 1 root root 21 2011-12-05 17:40 .rspec
drwxr-xr-x 4 root root 4.0K 2011-12-05 17:43 spec
-rw-r--r-- 1 root root 1.5K 2011-12-05 17:40 spice.gemspec
-rw-r--r-- 1 root root 111 2011-12-05 17:40 TODO.md
-rw-r--r-- 1 root root 385 2011-12-05 17:40 .watchr
```

```
root@tools1:~/spice# gem build spice.gemspec
Successfully built RubyGem
Name: spice
Version: 0.7.3
File: spice-0.7.3.gem
root@tools1:~/spice# gem install spice-0.7.3.gem
Successfully installed spice-0.7.3
1 gem installed
Installing ri documentation for spice-0.7.3...
Installing RDoc documentation for spice-0.7.3...
```