错误无法加载此类文件 -- user_agent/browsers/playstation (LoadError)
Posted
技术标签:
【中文标题】错误无法加载此类文件 -- user_agent/browsers/playstation (LoadError)【英文标题】:Error cannot load such file -- user_agent/browsers/playstation (LoadError) 【发布时间】:2016-01-10 04:02:05 【问题描述】:在运行 rails s 或 rails c 时 在项目 ruby v2.1.4 和 rails 3.2.13
/home/kop/.rvm/gems/ruby-2.1.4@rails3213/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:251:in
require': cannot load such file -- user_agent/browsers/playstation (LoadError) from /home/kop/.rvm/gems/ruby-2.1.4@rails3213/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:251:in
block in require' 来自 /home/kop/.rvm/gems/ruby-2.1.4@rails3213/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:236:inload_dependency' from /home/kop/.rvm/gems/ruby-2.1.4@rails3213/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:251:in
require' 来自 /home/kop/.rvm/gems/ruby-2.1.4@rails3213/gems/useragent-0.16.0/lib/user_agent/browsers.rb:12:in<top (required)>' from /home/kop/.rvm/gems/ruby-2.1.4@rails3213/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:251:in
require' 来自 /home/kop/.rvm/gems/ruby-2.1.4@rails3213/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:251:inblock in require' from /home/kop/.rvm/gems/ruby-2.1.4@rails3213/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:236:in
load_dependency' 来自 /home/kop/.rvm/gems/ruby-2.1.4@rails3213/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:251:inrequire' from /home/kop/.rvm/gems/ruby-2.1.4@rails3213/gems/useragent-0.16.0/lib/user_agent.rb:2:in
' 来自 /home/kop/.rvm/gems/ruby-2.1.4@rails3213/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:251:inrequire' from /home/kop/.rvm/gems/ruby-2.1.4@rails3213/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:251:in
block in require' 来自 /home/kop/.rvm/gems/ruby-2.1.4@rails3213/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:236:inload_dependency' from /home/kop/.rvm/gems/ruby-2.1.4@rails3213/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:251:in
require' 来自 /home/kop/.rvm/gems/ruby-2.1.4@rails3213/gems/useragent-0.16.0/lib/useragent.rb:1:in<top (required)>' from /home/kop/.rvm/gems/ruby-2.1.4@rails3213/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:251:in
require' 来自 /home/kop/.rvm/gems/ruby-2.1.4@rails3213/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:251:inblock in require' from /home/kop/.rvm/gems/ruby-2.1.4@rails3213/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:236:in
load_dependency' 来自 /home/kop/.rvm/gems/ruby-2.1.4@rails3213/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:251:inrequire' from /home/kop/rails/howtobuyafranchise/lib/franchise_core/lib/franchise.rb:11:in
' 来自 /home/kop/.rvm/gems/ruby-2.1.4@rails3213/gems/bundler-1.10.6/lib/bundler/runtime.rb:76:inrequire' from /home/kop/.rvm/gems/ruby-2.1.4@rails3213/gems/bundler-1.10.6/lib/bundler/runtime.rb:76:in
block (2 个级别) in require' 来自 /home/kop/.rvm/gems/ruby-2.1.4@rails3213/gems/bundler-1.10.6/lib/bundler/runtime.rb:72:ineach' from /home/kop/.rvm/gems/ruby-2.1.4@rails3213/gems/bundler-1.10.6/lib/bundler/runtime.rb:72:in
block in require' 来自 /home/kop/.rvm/gems/ruby-2.1.4@rails3213/gems/bundler-1.10.6/lib/bundler/runtime.rb:61:ineach' from /home/kop/.rvm/gems/ruby-2.1.4@rails3213/gems/bundler-1.10.6/lib/bundler/runtime.rb:61:in
require' 来自/home/kop/.rvm/gems/ruby-2.1.4@rails3213/gems/bundler-1.10.6/lib/bundler.rb:134:inrequire' from /home/kop/rails/howtobuyafranchise/config/application.rb:7:in
' 来自/home/kop/.rvm/gems/ruby-2.1.4@rails3213/gems/railties-3.2.13/lib/rails/commands.rb:39:inrequire' from /home/kop/.rvm/gems/ruby-2.1.4@rails3213/gems/railties-3.2.13/lib/rails/commands.rb:39:in
' 来自脚本/rails:6:inrequire' from script/rails:6:in
'
我不知道修复这个错误 请帮助我
【问题讨论】:
Playstation 库未正确加载到您的项目中。你能过去你的gem文件吗 【参考方案1】:我认为文件路径错误,
而不是:user_agent/browsers/playstation
将其更改为:
useragent/browsers/playstation
由于我不知道您的 Gemfile 中有什么,我对此错误的假设之一是您没有在 Gemfile 中包含 gem 'useragent', '~> 0.14.0'
然后运行 bundle install
【讨论】:
tks :D ur save my day以上是关于错误无法加载此类文件 -- user_agent/browsers/playstation (LoadError)的主要内容,如果未能解决你的问题,请参考以下文章
Sinatra 应用程序中的“Rake 无法加载此类文件”错误
kernel_require.rb:55:in `require': 无法加载此类文件错误
乘客:无法加载此类文件 rubygems/builder
LoadError: 无法加载此类文件 -- test/unit/error
rails-rspec 错误无法加载此类文件 -- rspec/core/formatters/progress_formatter