简体   繁体   English

Ruby on Rails捆绑执行rake资产:预编译错误-没有要加载的此类文件— Gelf

[英]Ruby on Rails bundle exec rake assets:precompile error - no such file to load — gelf

When I run RAILS_ENV=production bundle exec rake assets:precompile I get: 当我运行RAILS_ENV = production bundle exec rake asset:precompile时,我得到:

Rake aborted!
no such file to load -- gelf

Tasks: TOP => environment
(See full trace by running task with --trace)
rake aborted!

if I run it with --trace I get: 如果我用--trace运行它,我得到:

** Invoke assets:precompile:all (first_time)
** Execute assets:precompile:all
** Invoke assets:precompile:primary (first_time)
** Invoke assets:environment (first_time)
** Execute assets:environment
** Invoke environment (first_time)
** Execute environment
rake aborted!
no such file to load -- gelf
/Users/gareth/.rvm/gems/ruby-1.9.2-p320/gems/activesupport-3.2.3/lib/active_support/dependencies.rb:251:in `require'
/Users/gareth/.rvm/gems/ruby-1.9.2-p320/gems/activesupport-3.2.3/lib/active_support/dependencies.rb:251:in `block in require'
/Users/gareth/.rvm/gems/ruby-1.9.2-p320/gems/activesupport-3.2.3/lib/active_support/dependencies.rb:236:in `load_dependency'
/Users/gareth/.rvm/gems/ruby-1.9.2-p320/gems/activesupport-3.2.3/lib/active_support/dependencies.rb:251:in `require'
/Users/gareth/enghance/config/initializers/graylog.rb:1:in `<top (required)>'

I havent been able to find any solution, or question with the same error so I'm thinking it might be something basic. 我还无法找到任何解决方案或具有相同错误的问题,因此我认为这可能是基本的事情。

Is there anyone who has had the same problem and figured it out or knows what's going wrong? 有谁遇到过同样的问题并解决了这个问题,或者知道出了什么问题吗?

You are missing the gelf gem, in your gemfile, resulting in the error: 您在gemfile中缺少gelf gem,从而导致错误:

no such file to load -- gelf

Simply add the following line to your gemfile: 只需将以下行添加到您的gemfile中:

gem 'gelf'

And run bundle install , from the root of your app. 并从应用程序的根目录运行bundle install

I realize that this response is outrageously late, but if someone eles comes across the problem, I thought I'd share how I got around it - it's very easy once you've worked it out (in my case that took several hours :( ). I had decided to deploy my rails app on EC-2 and was following a rubber + rails + EC2 tutorial, but I couldn't get it to work. I reverted to an earlier git checkpoint, thinking that it would get rid of all the stuff from rubber on my system - but it didn't. Each time I'd try to run "rails server", I'd get an error relating to rubber, the first of which was the one you mentioned above: 我意识到这个响应太晚了,但是如果有人遇到这个问题,我想我会分享我的解决方法-一旦解决,这很容易(就我而言,这花了几个小时:( )。我决定将我的rails应用程序部署在EC-2上,并遵循了橡胶+ rails + EC2教程,但是我无法使其正常工作,我回到了较早的git checkpoint,以为它可以摆脱系统中所有来自橡胶的东西-但是不是。每次尝试运行“ rails server”时,我都会遇到一个与橡胶有关的错误,第一个是您上面提到的错误:
in require': cannot load such file -- gelf (LoadError)

After deleting the following files, everything went back to working: 删除以下文件后,一切恢复正常:

config/rubber

config/initializers/graylog.rb

Just in case it helps anyone else. 以防万一它可以帮助其他人。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 命令捆绑exec rake asset:precompile错误 - error with the command bundle exec rake assets:precompile 捆绑exec rake资产:预编译 - bundle exec rake assets:precompile Rails Rake 资产上的另一个 Ruby:预编译错误 - Another Ruby on Rails Rake assets:precompile error Ruby on Rails Rake资产:预编译错误 - Ruby on Rails Rake assets:precompile error 运行时遇到错误cmd RAILS_ENV =生产包exec rake资产:预编译 - got error when run cmd RAILS_ENV=production bundle exec rake assets:precompile 耙资产:预编译,耙中止-推送到heroku时出错-Ruby on Rails - rake assets:precompile, rake aborted - error pushing to heroku - ruby on rails 捆绑exec rake资产:预编译失败 - bundle exec rake assets:precompile fails 捆绑exec rake资产:预编译-不断失败 - bundle exec rake assets:precompile - keeps failing Capistrano:KILL RAILS_ENV =生产RAILS_GROUPS =资产捆绑执行rake资产:预编译 - Capistrano: Killed RAILS_ENV=production RAILS_GROUPS=assets bundle exec rake assets:precompile Rails 4,Capistrano 3在捆绑exec rake资产期间失败:预编译并返回rake stdout:Nothing - Rails 4, Capistrano 3 fail during bundle exec rake assets:precompile and returns rake stdout: Nothing
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM