Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $ client = Databasedotcom::Client.new("config/databasedotcom.yml")
- $ client.authenticate :username => 'login@domain.com',:password => 'mypassword_authtoken'
- TypeError: can't convert Pathname into String
- from /Users/jordanbaucke/.rvm/rubies/ruby-1.9.2-p320/lib/ruby/1.9.1/net/http.rb:658:in `init
- ialize'
- from /Users/jordanbaucke/.rvm/rubies/ruby-1.9.2-p320/lib/ruby/1.9.1/net/http.rb:658:in `new'
- from /Users/jordanbaucke/.rvm/rubies/ruby-1.9.2-p320/lib/ruby/1.9.1/net/http.rb:658:in `conn
- ect'
- from /Users/jordanbaucke/.rvm/rubies/ruby-1.9.2-p320/lib/ruby/1.9.1/net/http.rb:637:in `do_s
- tart'
- from /Users/jordanbaucke/.rvm/rubies/ruby-1.9.2-p320/lib/ruby/1.9.1/net/http.rb:626:in `star
- t'
- from /Users/jordanbaucke/.rvm/rubies/ruby-1.9.2-p320/lib/ruby/1.9.1/net/http.rb:1168:in `req
- uest'
- from /Users/jordanbaucke/.rvm/rubies/ruby-1.9.2-p320/lib/ruby/1.9.1/net/http.rb:978:in `post
- '
- from /Users/jordanbaucke/.rvm/gems/ruby-1.9.2-p320/gems/databasedotcom-1.3.2/lib/databasedot
- com/client.rb:110:in `authenticate'
- from (irb):2
- from /Users/jordanbaucke/.rvm/gems/ruby-1.9.2-p320/gems/railties-3.2.12/lib/rails/commands/c
- onsole.rb:47:in `start'
- from /Users/jordanbaucke/.rvm/gems/ruby-1.9.2-p320/gems/railties-3.2.12/lib/rails/commands/c
- onsole.rb:8:in `start'
- from /Users/jordanbaucke/.rvm/gems/ruby-1.9.2-p320/gems/railties 3.2.12/lib/rails/commands.r
- b:41:in `<top (required)>'
- from script/rails:35:in `require'
- from script/rails:35:in `<main>'
- host: login.salesforce.com # Use test.salesforce.com for sandbox
- client_secret: *** # This is the Consumer Secret from Salesforce
- client_id: *** # This is the Consumer Key from Salesforce
- sobject_module: SFDC_Models # See below for details on using modules
- debugging: true # Can be useful while developing
- username: ***
- password: ***
- require 'rubygems'
- require 'rails/commands/server'
- require 'rack'
- require 'webrick'
- require 'webrick/https'
- module Rails
- class Server < ::Rack::Server
- def default_options
- super.merge({
- :Port => 3000,
- :environment => (ENV['RAILS_ENV'] || "development").dup,
- :daemonize => false,
- :debugger => false,
- :pid => File.expand_path("tmp/pids/server.pid"),
- :config => File.expand_path("config.ru"),
- :SSLEnable => true,
- :SSLVerifyClient => OpenSSL::SSL::VERIFY_NONE,
- :SSLPrivateKey => OpenSSL::PKey::RSA.new(
- File.open("server.key").read),
- :SSLCertificate => OpenSSL::X509::Certificate.new(
- File.open("server.csr").read),
- :SSLCertName => [["CN", WEBrick::Utils::getservername]]
- })
- end
- end
- end
- require 'open-uri'
- require 'net/https'
- module Net
- class HTTP
- alias_method :original_use_ssl=, :use_ssl=
- def use_ssl=(flag)
- self.ca_file = Rails.root.join('server.crt')
- self.verify_mode = OpenSSL::SSL::VERIFY_PEER
- self.original_use_ssl = flag
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement