我有一个类似的问题,多次报告,例如: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/public/assets/application-a51a53658dfaa975cb4363f51d14bccf24d66c3d90c2186bf834c157151c4bd1.js rake资产:预编译I,2018-05-08T01:26:06.195454 #7876信息NoMethodError:用于nil的未定义方法“`post”:NilClass任务:顶级=>资产:预编译
同样的错误发生在不同的应用程序中。
与其他报告问题的不同之处:
-- 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安装程序是有区别的。
问:这能有什么区别?这两台机器最初都是由相同的OS映像(由我公司的IT部门设置)设置的,但它们当然并不新鲜。
乌利
发布于 2018-05-08 11:41:31
检查系统当前用户的ruby版本
rvm list确保在捆绑过程中采取同样的方法。如果需要其他版本,请为用户正确安装ruby。
此外,还以更好的方式捆绑。
bundle exec rake assets:precompile RAILS_ENV=production包的ruby版本应该与当前系统用户的ruby版本匹配。可在
/usr/bin/或
/usr/local/https://stackoverflow.com/questions/50223937
复制相似问题