The brendan lims instructions for setting up the sms_fu gem say to run either
sms_fu = SMSFu::Client.configure(:delivery => :action_mailer)
or
sms_fu = SMSFu::Client.configure(:delivery => :pony, :pony_config => { :via => :sendmail })
or
PONY_CONFIG = { :via => :smtp, :via_options => { :address => 'smtp.gmail.com', :port => '587', :user_name => 'username', :password => 'password', :authentication => :plain, :enable_starttls_auto => true, :domain => "localhost.localdomain" }} sms_fu = SMSFu::Client.configure(:delivery => :pony, :pony_config => PONY_CONFIG)
I tried the first one (assuming the actionmailer is configured by default, maybe this is wrong). Then the second (after installing the pony and mailing something to make sure that it works, which was good) and the last. No errors are displayed in all of the above. Instructions say after this setting, a command like this should work
sms_fu.deliver("5558675309","at&t","message")
In all settings I get this error
NameError: uninitialized constant RAILS_ROOT from /Users/name/.rvm/gems/ ruby-1.9.2-p290@rails3tutorial /gems/sms_fu-1.1.2/lib/sms_fu/sms_fu.rb:102:in `template_directory' from /Users/name/.rvm/gems/ ruby-1.9.2-p290@rails3tutorial /gems/sms_fu-1.1.2/lib/sms_fu/sms_fu.rb:55:in `config_yaml' from /Users/name/.rvm/gems/ ruby-1.9.2-p290@rails3tutorial /gems/sms_fu-1.1.2/lib/sms_fu/sms_fu.rb:65:in `from_address' from /Users/name/.rvm/gems/ ruby-1.9.2-p290@rails3tutorial /gems/sms_fu-1.1.2/lib/sms_fu/sms_fu.rb:41:in `deliver' from (irb):28 from /Users/name/.rvm/gems/ ruby-1.9.2-p290@rails3tutorial /gems/railties-3.1.0/lib/rails/commands/console.rb:45:in `start' from /Users/name/.rvm/gems/ ruby-1.9.2-p290@rails3tutorial /gems/railties-3.1.0/lib/rails/commands/console.rb:8:in `start' from /Users/name/.rvm/gems/ ruby-1.9.2-p290@rails3tutorial /gems/railties-3.1.0/lib/rails/commands.rb:40:in `<top (required)>' from script/rails:6:in `require' from script/rails:6:in `<main>'
How can i solve this.
PS
Im on rails 3
Now I get by changing RAILS_ROOT to Rails.root on line 102 lib / sms_fu / sms_fu.rb (according to Dogbert's answer)
Psych::SyntaxError: couldn't parse YAML at line 7 column 11 from /Users/name/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/psych.rb:148:in `parse' from /Users/name/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/psych.rb:148:in `parse_stream' from /Users/name/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/psych.rb:119:in `parse' from /Users/name/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/psych.rb:106:in `load' from /Users/name/.rvm/gems/ ruby-1.9.2-p290@rails3tutorial /gems/sms_fu-1.1.2/lib/sms_fu/sms_fu.rb:55:in `config_yaml' from /Users/name/.rvm/gems/ ruby-1.9.2-p290@rails3tutorial /gems/sms_fu-1.1.2/lib/sms_fu/sms_fu.rb:65:in `from_address' from /Users/name/.rvm/gems/ ruby-1.9.2-p290@rails3tutorial /gems/sms_fu-1.1.2/lib/sms_fu/sms_fu.rb:41:in `deliver' from (irb):6 from /Users/name/.rvm/gems/ ruby-1.9.2-p290@rails3tutorial /gems/railties-3.1.0/lib/rails/commands/console.rb:45:in `start' from /Users/name/.rvm/gems/ ruby-1.9.2-p290@rails3tutorial /gems/railties-3.1.0/lib/rails/commands/console.rb:8:in `start' from /Users/name/.rvm/gems/ ruby-1.9.2-p290@rails3tutorial /gems/railties-3.1.0/lib/rails/commands.rb:40:in `<top (required)>' from script/rails:6:in `require' from script/rails:6:in `<main>'
my sms_fu.yml looks like
config: from_address: noreply@domain.com carriers: alltel: name: Alltel value: @message.alltel.com ameritech: name: Ameritech value: @paging.acswireless.com at&t: name: AT&T value: @txt.att.net bell-atlantic: name: Bell Atlantic value: @message.bam.com bellsouthmobility: name: Bellsouth Mobility value: @blsdcs.net blueskyfrog: name: BlueSkyFrog value: @blueskyfrog.com boost: name: Boost Mobile value: @myboostmobile.com cellularsouth: name: Cellular South value: @csouth1.com comcast: name: Comcast PCS value: @comcastpcs.textmsg.com cricket: name: Cricket value: @sms.mycricket.com kajeet: name: kajeet value: @mobile.kajeet.net metropcs: name: Metro PCS value: @mymetropcs.com nextel: name: Nextel value: @messaging.nextel.com powertel: name: Powertel value: @ptel.net pscwireless: name: PSC Wireless value: @sms.pscel.com qwest: name: Qwest value: @qwestmp.com southernlink: name: Southern Link value: @page.southernlinc.com sprint: name: Sprint PCS value: @messaging.sprintpcs.com suncom: name: Suncom value: @tms.suncom.com t-mobile: name: T-Mobile value: @tmomail.net tracfone: name: Tracfone value: @mmst5.tracfone.com telus-mobility: name: Telus Mobility value: @msg.telus.com virgin: name: Virgin Mobile value: @vmobl.net verizon: name: Verizon Wireless value: @vtext.com
read the comments on the correct answer to find out the complete solution