English 中文(简体)
无法在发动机中装载 g
原标题:Unable to load gem in engine

I ve got是利用savongem的发动机。 当我在<代码>/测试上管理my时。 在发动机内,所有机器都只做罚款,但当我试图在我的申请中将其装成发动机时,我就错了:

`require : no such file to load -- savon (LoadError)

我曾把“savon”> > 要求“savon”>>> / 编号列入该模型的顶端,即: 编号:soap_model.rb>>> / 编号。 见https://stackoverflow.com/questions/ 753383/rails-cant-find-image-monick-gem。 员额I.n t 添加该模型,但“条形” 这似乎像在开始服务机时操作的“条形”栏目“环境”。

uninitialized constant EngineName::SOAP::Savon

因此,我补充说,在尝试用<条码>铁路/条码”开始服务器时,这会产生同样的错误。

环境:

Mac OS 10.7.3
ruby 1.9.2p290 (2011-07-09 revision 32553) [x86_64-darwin11.3.0]
Rails 3.1.4
savon (0.9.9)

注:当然,我已经确保 b安装正确,并重新启用服务器。

最佳回答

灰.已被列入发动机Gemfile,但并未作为对地壳的依赖添加,因此,在主要仪器运行的<代码>bundle stal/code>时没有列入。

添加到<条码>。

s.add_dependency "savon"

做了一切工作。

它在 du子中工作的原因是,它与发动机分享Gemfile。

问题回答

我不知道为什么Gem是这样 we,但你可以尝试这一法典:

You have first to require and then to include it.

# config/initializers/application.rb
require  savon 

include EngineName::SOAP::Savon

希望会有所帮助。





相关问题
Ruby net-dns reverse lookups

I am trying to get reverse DNS lookups working with the net-dns gem for ruby. From the rdoc res = Net::DNS::Resolver.new ip = IPAddr.new("172.16.100.2") packet = res.search(ip) packet = res.search("...

How can I show updates with gem?

I want on my webserver a script that checks automatical over cron if there are gem updates without installing updates. I don t find anything about this task in the gem docs.

missing rake tasks?

I have ran gem install rails and am running 2.3.4 but i am missing some rake tasks like db and gems if i run rake -T i get the following tasks. How can i get all the others ? rake apache2 # ...

Ruby Daemons Gem

I installed the ruby gem Daemons. To make sure it was working I created a script that would print to a file every 5 seconds. I then created another file to run the script using the trivial example ...

Ruby gems repository

I m trying to set a gem repository on one of our local servers. Here are the steps I m running, that I ve followed from several guides. 1) I create the BASEDIR folder /var/www/html/gems 2) sudo cp -...

Search logic functionality

The functionality I m looking for: I have a form that will search my Proposal model. I want the form to contain a select box and display the categories I have. Now, category is merely a column in ...

Ruby Geolocation Gem/Plugins [closed]

What are the available (best) ruby IP-based geolocation gem/plugins? How do they compare to one another in terms of functionality, performance and ease of use (e.g. do they interact with a web ...

How do I find gems that depend on a given gem?

Is it possible to search for all gems that rely on a certain rubygem? For example, I d like to ask for all gems in gemcutter that rely on the test-unit gem. Background: I m looking to see how other ...

热门标签