2

我正在学习铁轨。我从https://github.com/diaspora/diaspora下载了代码,但它无法运行。这是错误代码:

/home/a1/.rvm/rubies/ruby-2.1.7/web/diaspora/config/environments/development.rb:42:in `block in <top (required)>': uninitialized constant TurboDevAssets (NameError)
    from /home/a1/.rvm/gems/ruby-2.1.7/gems/railties-4.2.6/lib/rails/railtie.rb:210:in `instance_eval'
    from /home/a1/.rvm/gems/ruby-2.1.7/gems/railties-4.2.6/lib/rails/railtie.rb:210:in `configure'
    from /home/a1/.rvm/gems/ruby-2.1.7/gems/railties-4.2.6/lib/rails/railtie.rb:182:in `configure'
    from /home/a1/.rvm/rubies/ruby-2.1.7/web/diaspora/config/environments/development.rb:1:in `<top (required)>'

config/environments/development.rb是:

Diaspora::Application.configure do
    [...]
    # Speed up asset serving
    config.middleware.insert 0, TurboDevAssets
 end

如何解决问题?

4

2 回答 2

2

打开您的 Gemfile 并确保此行在其中:

  gem "turbo_dev_assets", "0.0.2"

如果是,但您收到该错误,请将该行移到条件之外或移动到您知道在运行命令时将被拾取的条件部分之一:

RAILS_ENV=development bin/bundle install --deployment --with "development test postgresql"

然后在该命令的输出中验证您是否看到此行:

Installing turbo_dev_assets 0.0.2

这应该可以解决错误:

Name error ,uninitialized constant TurboDevAssets (NameError)
于 2016-11-19T19:39:37.273 回答
0

您必须运行捆绑安装。

TurboDevAssets 是 gemfile 中的一个 gem:

  gem "turbo_dev_assets", "0.0.2"

捆绑安装将设置它。

于 2016-07-02T18:26:53.710 回答