我正在尝试将Ruby服务器迁移到新服务器。我在mongrel.log
文件中看到错误:
/usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:36:in gem_original_require: no such file to load -- yahoo-weather (MissingSourceFile)
from /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:36:in require
from /usr/lib/ruby/gems/1.8/gems/activesupport-2.3.14/lib/active_support/dependencies.rb:184:in require
from /home/dianahot/rails_apps/dianahotels/config/initializers/included_libraries.rb:9
from /usr/lib/ruby/gems/1.8/gems/activesupport-2.3.14/lib/active_support/dependencies.rb:173:in load_without_new_constant_marking
from /usr/lib/ruby/gems/1.8/gems/activesupport-2.3.14/lib/active_support/dependencies.rb:173:in load
from /usr/lib/ruby/gems/1.8/gems/rails-2.3.14/lib/initializer.rb:622:in load_application_initializers
from /usr/lib/ruby/gems/1.8/gems/rails-2.3.14/lib/initializer.rb:621:in each
from /usr/lib/ruby/gems/1.8/gems/rails-2.3.14/lib/initializer.rb:621:in load_application_initializers
from /usr/lib/ruby/gems/1.8/gems/rails-2.3.14/lib/initializer.rb:176:in process
from /usr/lib/ruby/gems/1.8/gems/rails-2.3.14/lib/initializer.rb:113:in send
from /usr/lib/ruby/gems/1.8/gems/rails-2.3.14/lib/initializer.rb:113:in run
from /home/dianahot/rails_apps/dianahotels/config/environment.rb:12
from /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:36:in gem_original_require
from /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:36:in require
from /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/../lib/mongrel/rails.rb:147:in rails
from /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/mongrel_rails:113:in cloaker_
from /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/../lib/mongrel/configurator.rb:149:in call
from /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/../lib/mongrel/configurator.rb:149:in listener
from /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/mongrel_rails:99:in cloaker_
from /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/../lib/mongrel/configurator.rb:50:in call
from /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/../lib/mongrel/configurator.rb:50:in initialize
from /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/mongrel_rails:84:in new
from /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/mongrel_rails:84:in run
from /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/../lib/mongrel/command.rb:212:in run
from /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/mongrel_rails:281
from /usr/bin/mongrel_rails:23:in load
from /usr/bin/mongrel_rails:23
这些线是什么意思?
编辑:
我尝试手动安装yahoo-weather gem,我收到以下错误:
gem install yahoo-weather
Fetching: nokogiri-1.5.2.gem (100%)
Building native extensions. This could take a while...
ERROR: Error installing yahoo-weather:
ERROR: Failed to build gem native extension.
/usr/bin/ruby extconf.rb
checking for libxml/parser.h... yes
checking for libxslt/xslt.h... no
-----
libxslt is missing. please visit http://nokogiri.org/tutorials/installing_nokogiri.html for help with installing dependencies.
-----
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of
necessary libraries and/or headers. Check the mkmf.log file for more
details. You may need configuration options.
Provided configuration options:
--with-opt-dir
--without-opt-dir
--with-opt-include
--without-opt-include=${opt-dir}/include
--with-opt-lib
--without-opt-lib=${opt-dir}/lib
--with-make-prog
--without-make-prog
--srcdir=.
--curdir
--ruby=/usr/bin/ruby
--with-zlib-dir
--without-zlib-dir
--with-zlib-include
--without-zlib-include=${zlib-dir}/include
--with-zlib-lib
--without-zlib-lib=${zlib-dir}/lib
--with-iconv-dir
--without-iconv-dir
--with-iconv-include
--without-iconv-include=${iconv-dir}/include
--with-iconv-lib
--without-iconv-lib=${iconv-dir}/lib
--with-xml2-dir
--without-xml2-dir
--with-xml2-include
--without-xml2-include=${xml2-dir}/include
--with-xml2-lib
--without-xml2-lib=${xml2-dir}/lib
--with-xslt-dir
--without-xslt-dir
--with-xslt-include
--without-xslt-include=${xslt-dir}/include
--with-xslt-lib
--without-xslt-lib=${xslt-dir}/lib
Gem files will remain installed in /usr/lib/ruby/gems/1.8/gems/nokogiri-1.5.2 for inspection.
Results logged to /usr/lib/ruby/gems/1.8/gems/nokogiri-1.5.2/ext/nokogiri/gem_make.out
root@server2 [/usr/lib/ruby/gems/1.8/gems]# % gem install yahoo-weather
-bash: fg: %: no such job
root@server2 [/usr/lib/ruby/gems/1.8/gems]#
答案 0 :(得分:1)
猜测,你错过了雅虎天气宝石。
我强烈建议您使用bundler - 这使得将应用程序部署到具有所有依赖项的一致版本的新计算机上变得更加容易。
答案 1 :(得分:0)
Yahoo-weather gem未能安装,因为它对Nokogiri的依赖失败了。这发生的原因是:
libxslt is missing. please visit http://nokogiri.org/tutorials/installing_nokogiri.html for help with installing dependencies.
从错误输出中列出的路径名,我怀疑你是在Linux系统上。您需要确保安装了相应的libxml和libxslt。 Nokogiri页面应该有助于解决这个问题。