簡體   English   中英

Ruby on Rails捆綁執行rake資產:預編譯錯誤-沒有要加載的此類文件— Gelf

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

當我運行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!

如果我用--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)>'

我還無法找到任何解決方案或具有相同錯誤的問題,因此我認為這可能是基本的事情。

有誰遇到過同樣的問題並解決了這個問題,或者知道出了什么問題嗎?

您在gemfile中缺少gelf gem,從而導致錯誤:

no such file to load -- gelf

只需將以下行添加到您的gemfile中:

gem 'gelf'

並從應用程序的根目錄運行bundle install

我意識到這個響應太晚了,但是如果有人遇到這個問題,我想我會分享我的解決方法-一旦解決,這很容易(就我而言,這花了幾個小時:( )。我決定將我的rails應用程序部署在EC-2上,並遵循了橡膠+ rails + EC2教程,但是我無法使其正常工作,我回到了較早的git checkpoint,以為它可以擺脫系統中所有來自橡膠的東西-但是不是。每次嘗試運行“ rails server”時,我都會遇到一個與橡膠有關的錯誤,第一個是您上面提到的錯誤:
in require': cannot load such file -- gelf (LoadError)

刪除以下文件后,一切恢復正常:

config/rubber

config/initializers/graylog.rb

以防萬一它可以幫助其他人。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM