Wondering if anyone can help me with something which has me scratching my head...
I've successfully installed the gem:
$ gem list | grep createsend
Rubygems is working. (using a RUBYOPT env variable, but tried this with and without require 'rubygems' in my test file, in case that was the source of my problems).
For some reason, the "CreateSend" module just doesn't seem to exist...
Test script #1:
require 'rubygems' require 'createsend' require 'ruby-debug' debugger
==== OUTPUT ====
createsend.rb:3 require 'ruby-debug' (rdb:1) set autoeval autoeval is on. (rdb:1) CreateSend NameError Exception: uninitialized constant CreateSend
Test script #2 (showing that gem importing in general is working...)
require 'rubygems' require 'createsend' require 'ruby-debug' require 'capybara' debugger
==== OUTPUT ====
createsend.rb:3 require 'ruby-debug' (rdb:1) set autoeval autoeval is on. (rdb:1) Capybara Capybara (rdb:1) CreateSend NameError Exception: uninitialized constant CreateSend
I fear I'm making a small, n00bish, elementary mistake... But I can't spot what it is. Any ideas?
Can you do the following in your environment and let us know the result?
$ gem which createsend /Library/Ruby/Gems/1.8/gems/createsend-0.2.1/lib/createsend.rb $ irb >> l = CreateSend::List.new "blah" => #<CreateSend::List:0x101f3da48 @list_id="blah">
Fixed it, with help from your reply.
The problem was, my script was named createsend.rb - running `gem which createsend` showed this up instantly by reporting ./createsend.rb.
Renamed it to add_subscriber.rb, and rubygems loads in the correct file!
Thanks for your help,
From Australia to Zimbabwe, and everywhere in between, companies count on Campaign Monitor for email campaigns that drive real business results.Get started for free