Can't include the createsend gem (feels like a n00b error)

Hi,

Wondering if anyone can help me with something which has me scratching my head...

I've successfully installed the gem:
$ gem list | grep createsend
createsend (0.2.1)

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?

Thanks,
Chris.

jamesd jamesd, 5 years ago

Hey Chris,

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">
skipchris, 5 years ago

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,
Chris.

Join 150,000 companies around the world that use Campaign Monitor to run email marketing campaigns that deliver results for their business.

Get started for free
1-888-533-8098