0
我有兩個rails應用程序運行在不同的端口上。從一個應用程序,我試圖消耗其他應用程序的API。 以下是APP_1中Product.rb模型的代碼。在rails中消費剩餘的API 3.2.13
class Product < ActiveResource::Base
self.site = "https://localhost:3000"
self.ssl_options = {:cert => OpenSSL::X509::Certificate.new(File.open(pem_file)),
:key => OpenSSL::PKey::RSA.new(File.open(pem_file)),
:ca_path => "/path/to/OpenSSL/formatted/CA_Certs",
:verify_mode => OpenSSL::SSL::VERIFY_PEER}
end
我有一個控制器和路由設置爲產品模型。當我運行APP_1我得到
undefined local variable or method `pem_file' for Product:Class
任何人都可以告訴我如何編寫一個pem文件,什麼是pem文件?