I hope that vcap-service-base of cloudfoundry can visit database of cloud_controller, then I need provisioner.rb in vcap-service-base to require 'active_record'. So I added "gem "activerecord" "in the Gemfile of vcap-service-base and then ran 'bundle install'. In the provisioner.rb, I added "require 'active_record'",while starting cloudfoundry, it always threw an error:in `require': no such file to load -- active_record (LoadError), as below:
/root/cloudfoundry/.deployments/devbox/deploy/rubies/ruby-1.9.2-p180/lib/ruby/gems/1.9.1/bundler/gems/vcap-services-base-1077d35ef73b/lib/base/provisioner.rb:9:in `require': no such file to load -- active_record (LoadError)
from /root/cloudfoundry/.deployments/devbox/deploy/rubies/ruby-1.9.2-p180/lib/ruby/gems/1.9.1/bundler/gems/vcap-services-base-1077d35ef73b/lib/base/provisioner.rb:9:in `<top (required)>'
from /root/cloudfoundry/.deployments/devbox/deploy/rubies/ruby-1.9.2-p180/lib/ruby/gems/1.9.1/bundler/gems/vcap-services-base-1077d35ef73b/lib/vcap_services_base.rb:4:in `require'
from /root/cloudfoundry/.deployments/devbox/deploy/rubies/ruby-1.9.2-p180/lib/ruby/gems/1.9.1/bundler/gems/vcap-services-base-1077d35ef73b/lib/vcap_services_base.rb:4:in `<top (required)>'
from /root/cloudfoundry/vcap/bin/../services/mysql/bin/mysql_node:7:in `require'
from /root/cloudfoundry/vcap/bin/../services/mysql/bin/mysql_node:7:in `<main>'
According to the error, it was LoadError. But when I searched the gem "active_record" in /root/cloudfoundry/.deployments/devbox/deploy/rubies/ruby-1.9.2-p180/lib/ruby/gems/1.9.1/gems, it was there exactly. Now I am confused whether it is the LoadError or I missed something important. Why in vcap-service-base, can "require 'active_record'" not be found ?
require'./active_record'? - BlackHatSamurai