0

我在 localhost:3000 上加载了 rails 服务器,但出现以下错误。我发现这是导致问题的“rails_12factor”gem。我正在使用这个 gem 让我的 css 在我的 herokuapp 上工作,但它在 localhost 上引起了问题。有没有办法让 rails_12factor 也可以在本地工作?

我正在运行 rails 4.0/ruby 2.0,我听说我需要 'rails_12factor' 让 css 与 rails 4 和 heroku 一起工作。

这是错误:

    wrong number of arguments (0 for 1)

Rails.root: /home/brice/rails_projects/blog

Application Trace | Framework Trace | Full Trace
activesupport (4.0.0.rc1) lib/active_support/core_ext/kernel/reporting.rb:82:in `capture'
activerecord (4.0.0.rc1) lib/active_record/migration.rb:363:in `call'
actionpack (4.0.0.rc1) lib/action_dispatch/middleware/callbacks.rb:29:in `block in call'
activesupport (4.0.0.rc1) lib/active_support/callbacks.rb:392:in `_run__553013214532738530__call__callbacks'
activesupport (4.0.0.rc1) lib/active_support/callbacks.rb:80:in `run_callbacks'
actionpack (4.0.0.rc1) lib/action_dispatch/middleware/callbacks.rb:27:in `call'
actionpack (4.0.0.rc1) lib/action_dispatch/middleware/reloader.rb:64:in `call'
actionpack (4.0.0.rc1) lib/action_dispatch/middleware/remote_ip.rb:76:in `call'
actionpack (4.0.0.rc1) lib/action_dispatch/middleware/debug_exceptions.rb:17:in `call'
actionpack (4.0.0.rc1) lib/action_dispatch/middleware/show_exceptions.rb:30:in `call'
railties (4.0.0.rc1) lib/rails/rack/logger.rb:38:in `call_app'
railties (4.0.0.rc1) lib/rails/rack/logger.rb:21:in `block in call'
activesupport (4.0.0.rc1) lib/active_support/tagged_logging.rb:67:in `block in tagged'
activesupport (4.0.0.rc1) lib/active_support/tagged_logging.rb:25:in `tagged'
activesupport (4.0.0.rc1) lib/active_support/tagged_logging.rb:67:in `tagged'
railties (4.0.0.rc1) lib/rails/rack/logger.rb:21:in `call'
actionpack (4.0.0.rc1) lib/action_dispatch/middleware/request_id.rb:21:in `call'
rack (1.5.2) lib/rack/methodoverride.rb:21:in `call'
rack (1.5.2) lib/rack/runtime.rb:17:in `call'
activesupport (4.0.0.rc1) lib/active_support/cache/strategy/local_cache.rb:83:in `call'
rack (1.5.2) lib/rack/lock.rb:17:in `call'
actionpack (4.0.0.rc1) lib/action_dispatch/middleware/static.rb:64:in `call'
railties (4.0.0.rc1) lib/rails/engine.rb:511:in `call'
railties (4.0.0.rc1) lib/rails/application.rb:96:in `call'
rack (1.5.2) lib/rack/lock.rb:17:in `call'
rack (1.5.2) lib/rack/content_length.rb:14:in `call'
rack (1.5.2) lib/rack/handler/webrick.rb:60:in `service'
/home/brice/.rvm/rubies/ruby-2.0.0-p195/lib/ruby/2.0.0/webrick/httpserver.rb:138:in `service'
/home/brice/.rvm/rubies/ruby-2.0.0-p195/lib/ruby/2.0.0/webrick/httpserver.rb:94:in `run'
/home/brice/.rvm/rubies/ruby-2.0.0-p195/lib/ruby/2.0.0/webrick/server.rb:295:in `block in start_thread'

我也可以提供其他文件,但我不知道去哪里找。如果有人知道如何解决这个问题,我将不胜感激!

4

1 回答 1

0

答案是将 'group: :production' 附加到 rails_12factor 的末尾

所以它在你的 gemfile 上看起来像这样:

gem 'rails_12factor', group: :production
于 2013-06-24T06:07:24.127 回答