2012-11-06 62 views
0

按照http://rubygems.org/gems/mobile-fu(“简单地将添加到您的Gemfile和运行捆绑安装”)的说明安装宝石工作正常,并且该宝石被列为已安装和所有必要的依赖也已到位据我所知,下面是项目Gemfile中的相关部分:手机福宝不工作在红宝石1.8.7 /轨2.3.14

source :gemcutter 
source 'http://gems.github.com' 

gem 'rails', '~> 2.3.14' 
gem 'aslakjo-comatose', '2.0.5.12', :require => 'comatose' 
gem 'adamwiggins-rest-client', '1.0.4' 
gem 'ruby-hmac', '0.4', :require => 'hmac' 
gem 'ruby-net-ldap', '0.0.4', :require => 'net/ldap' 
gem 'will_paginate', '2.3.11' 
gem 'hpricot', '0.8.2' 
gem 'oauth', '0.3.6' 
gem 'sanitize', '1.1.0' 
gem 'sunspot_rails', '1.1.0', :require => 'sunspot/rails' 
gem 'htmlentities' 
gem 'rdoc', :require => 'rdoc' 
gem 'to_xls' 
gem 'pusher' 
gem 'jammit' 
gem 'rabl', '~>0.6' 
gem 'paperclip', '~> 2.7' 
gem 'aws-sdk', '~> 1.3.4' 
gem 'mobile-fu', '~> 1.1.0' 
... 

这里是导致错误消息/启动服务器时记录:“没有这样的文件来加载 - 移动/ fu(MissingSourceFile)“是主要问题(恕我直言):

=> Booting WEBrick 
=> Rails 2.3.14 application starting on http://0.0.0.0:3000 
NOTE: Gem.source_index is deprecated, use Specification. It will be removed on or after 2011-11-01. 
Gem.source_index called from /home/work/.rvm/gems/[email protected]/gems/rails-2.3.14/lib/rails/gem_dependency.rb:21. 
/home/work/.rvm/gems/[email protected]/gems/bundler-1.2.1/lib/bundler/runtime.rb:74:in `require': no such file to load -- mobile/fu (MissingSourceFile) 
    from /home/work/.rvm/gems/[email protected]/gems/bundler-1.2.1/lib/bundler/runtime.rb:74:in `require' 
    from /home/work/.rvm/gems/[email protected]/gems/bundler-1.2.1/lib/bundler/runtime.rb:55:in `each' 
    from /home/work/.rvm/gems/[email protected]/gems/bundler-1.2.1/lib/bundler/runtime.rb:55:in `require' 
    from /home/work/.rvm/gems/[email protected]/gems/bundler-1.2.1/lib/bundler.rb:128:in `require' 
    from /home/work/web/srv/config/boot.rb:116:in `load_gems' 
    from /home/work/.rvm/gems/[email protected]/gems/rails-2.3.14/lib/initializer.rb:164:in `process' 
    from /home/work/.rvm/gems/[email protected]/gems/rails-2.3.14/lib/initializer.rb:113:in `send' 
    from /home/work/.rvm/gems/[email protected]/gems/rails-2.3.14/lib/initializer.rb:113:in `run' 
    from ./config/environment.rb:7 
    from /home/work/.rvm/gems/[email protected]/gems/activesupport-2.3.14/lib/active_support/dependencies.rb:182:in `require' 
    from /home/work/.rvm/gems/[email protected]/gems/activesupport-2.3.14/lib/active_support/dependencies.rb:182:in `require' 
    from /home/work/.rvm/gems/[email protected]/gems/activesupport-2.3.14/lib/active_support/dependencies.rb:547:in `new_constants_in' 
    from /home/work/.rvm/gems/[email protected]/gems/activesupport-2.3.14/lib/active_support/dependencies.rb:182:in `require' 
    from /home/work/web/srv/config.ru:1 
    from /home/work/.rvm/gems/[email protected]/gems/rack-1.1.3/lib/rack/builder.rb:46:in `instance_eval' 
    from /home/work/.rvm/gems/[email protected]/gems/rack-1.1.3/lib/rack/builder.rb:46:in `initialize' 
    from /home/work/web/srv/config.ru:1:in `new' 
    from /home/work/web/srv/config.ru:1 
    from ./script/server:3:in `eval' 
    from /home/work/.rvm/gems/[email protected]/gems/rails-2.3.14/lib/commands/server.rb:78 
    from ./script/server:3:in `require' 
    from ./script/server:3 

更新1

使用本Langfeld描述的解决方案(“为此,可以使用在你的Gemfile以下修正:gem 'mobile-fu', '~> 1.1.0', :require => 'mobile-fu'”)只产生一个新的错误如下图所示:

=> Booting WEBrick 
=> Rails 2.3.14 application starting on http://0.0.0.0:3000 
NOTE: Gem.source_index is deprecated, use Specification. It will be removed on or after 2011-11-01. 
Gem.source_index called from /home/work/.rvm/gems/[email protected]/gems/rails-2.3.14/lib/rails/gem_dependency.rb:21. 
/home/work/.rvm/gems/[email protected]/gems/activesupport-2.3.14/lib/active_support/dependencies.rb:182:in `require': no such file to load -- rails (MissingSourceFile) 
    from /home/work/.rvm/gems/[email protected]/gems/activesupport-2.3.14/lib/active_support/dependencies.rb:182:in `require' 
    from /home/work/.rvm/gems/[email protected]/gems/activesupport-2.3.14/lib/active_support/dependencies.rb:547:in `new_constants_in' 
    from /home/work/.rvm/gems/[email protected]/gems/activesupport-2.3.14/lib/active_support/dependencies.rb:182:in `require' 
    from /home/work/.rvm/gems/[email protected]/gems/mobile-fu-1.1.0/lib/mobile-fu.rb:1 
    from /home/work/.rvm/gems/[email protected]/gems/bundler-1.2.1/lib/bundler/runtime.rb:68:in `require' 
    from /home/work/.rvm/gems/[email protected]/gems/bundler-1.2.1/lib/bundler/runtime.rb:68:in `require' 
    from /home/work/.rvm/gems/[email protected]/gems/bundler-1.2.1/lib/bundler/runtime.rb:66:in `each' 
    from /home/work/.rvm/gems/[email protected]/gems/bundler-1.2.1/lib/bundler/runtime.rb:66:in `require' 
    from /home/work/.rvm/gems/[email protected]/gems/bundler-1.2.1/lib/bundler/runtime.rb:55:in `each' 
    from /home/work/.rvm/gems/[email protected]/gems/bundler-1.2.1/lib/bundler/runtime.rb:55:in `require' 
    from /home/work/.rvm/gems/[email protected]/gems/bundler-1.2.1/lib/bundler.rb:128:in `require' 
    from /home/work/web/srv/config/boot.rb:116:in `load_gems' 
    from /home/work/.rvm/gems/[email protected]/gems/rails-2.3.14/lib/initializer.rb:164:in `process' 
    from /home/work/.rvm/gems/[email protected]/gems/rails-2.3.14/lib/initializer.rb:113:in `send' 
    from /home/work/.rvm/gems/[email protected]/gems/rails-2.3.14/lib/initializer.rb:113:in `run' 
    from ./config/environment.rb:7 
    from /home/work/.rvm/gems/[email protected]/gems/activesupport-2.3.14/lib/active_support/dependencies.rb:182:in `require' 
    from /home/work/.rvm/gems/[email protected]/gems/activesupport-2.3.14/lib/active_support/dependencies.rb:182:in `require' 
    from /home/work/.rvm/gems/[email protected]/gems/activesupport-2.3.14/lib/active_support/dependencies.rb:547:in `new_constants_in' 
    from /home/work/.rvm/gems/[email protected]/gems/activesupport-2.3.14/lib/active_support/dependencies.rb:182:in `require' 
    from /home/work/web/srv/config.ru:1 
    from /home/work/.rvm/gems/[email protected]/gems/rack-1.1.3/lib/rack/builder.rb:46:in `instance_eval' 
    from /home/work/.rvm/gems/[email protected]/gems/rack-1.1.3/lib/rack/builder.rb:46:in `initialize' 
    from /home/work/web/srv/config.ru:1:in `new' 
    from /home/work/web/srv/config.ru:1 
    from ./script/server:3:in `eval' 
    from /home/work/.rvm/gems/[email protected]/gems/rails-2.3.14/lib/commands/server.rb:78 
    from ./script/server:3:in `require' 
    from ./script/server:3 

有没有列出这个宝石的最低版本的红宝石或铁轨,但我怀疑问题是由我们正在运行的旧版本引起的。但是,升级红宝石或导轨不是一种选择,因为这是一个维护项目。

如果存在已知可用于我们的ruby & rails version/config的具有类似功能的Mobile Fu的替换宝石,那么我们愿意查看这个问题是否可以解决。

回答

0

为此,可以使用修复您的Gemfile如下:

gem 'mobile-fu', '~> 1.1.0', :require => 'mobile-fu' 
+0

感谢您的快速响应,但不幸的是,我已经尝试过这种解决方案,它只会导致另一个类似的错误(见上面添加更新1)。 – ultrafunk