我希望cloudfoundry的vcap-service-base可以訪問cloud_controller的數據庫,然後我需要vcap-service-base中的provisioner.rb來要求' active_record」。 因此,我在vcap-service-base的Gemfile中添加了「gem」activerecord「」,然後運行「bundle install」。 在provisioner.rb中,我添加了「require'active_record'」,在啓動cloudfoundry時,它總是拋出一個錯誤:在'require'中:沒有要加載的文件--active_record(LoadError),如下所示:in'require':no such file to load --active_record(LoadError)
/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>'
根據錯誤,它是LoadError。 但是,當我在/root/cloudfoundry/.deployments/devbox/deploy/rubies/ruby-1.9.2-p180/lib/ruby/gems/1.9.1/gems中搜索gem「active_record」時,它確實在那裏。 現在我很困惑它是LoadError還是我錯過了一些重要的東西。 爲什麼在vcap-service-base中,可以「require'active_record'」找不到?
你試過'需要」 ./ active_record''? – BlackHatSamurai 2013-03-08 18:47:21