【问题标题】:rake assets:precompile fails on windows machinerake assets:windows 机器上的预编译失败
【发布时间】:2018-10-17 20:01:27
【问题描述】:

我遇到过多次报告的类似问题,例如这里:rake assets:precompile RAILS_ENV=production not working as required

我的设置如下:

-- rails 5.1
-- any application (e.g. an empty one, just generated the app, bundle, rake assets:precompile)
-- error: 

c:\RailsApps\asset_pipeline_test>bundle exec rake assets:precompile 我,[2018-05-08T01:26:06.195454 #7876] INFO -- : 写 c:/RailsApps/asset_pipeline_test/public/assets/application-a51a53658dfaa975cb4363f51d14bccf24d66c3d90c2186bf834c157151c4bd1. 耙中止! NoMethodError:nil 的未定义方法“post”:NilClass 任务:TOP => 资产:预编译

不同的应用会出现同样的错误。

与其他已报告问题的区别:

-- I am using two similar w7pro machines
-- on one machine rake assets:precompile is working
-- on the other machine it's failing

我将应用程序和 Ruby/Rails 安装文件夹的 1:1 副本从工作机器放到失败的机器上。

我检查了任何类型的环境变量,没有发现任何差异。

我猜应用程序之外的机器和 Ruby 设置之间存在差异。

问题:这可能有什么不同?两台机器最初都是由相同的操作系统映像(由我公司的 IT)设置的,但它们当然不是新鲜的

乌力

【问题讨论】:

    标签: ruby-on-rails assets precompiler


    【解决方案1】:

    查看系统当前用户的ruby版本

    rvm list
    

    确保在捆绑过程中采用相同的方式。如果需要其他版本,请为用户正确安装 ruby​​。

    另外捆绑以更好的方式

    bundle exec rake assets:precompile RAILS_ENV=production
    

    bundle 的 ruby​​ 版本应该与当前系统用户的 ruby​​ 版本匹配。 捆绑包可以在

    找到
    /usr/bin/
    

    或

    /usr/local/
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2013-09-05
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2013-03-15
      • 2013-03-10
      • 2021-07-01
      • 2016-03-31
      相关资源
      最近更新 更多