“require_tree argument must be a directory” rails 3.1.1 precompile assets

前端 未结 2 1078
别跟我提以往
别跟我提以往 2021-01-30 14:13

I\'ve been round and round here with trying to get the assets to pre-compile on my production server (straightforward ubuntu install with ruby 1.9.2 and Rails 3.1.1, and tried 3

相关标签:
2条回答
  • 2021-01-30 14:49

    I ran into this exact same issue you described. My production server was Heroku (cedar stack). In my case the issue was that one of my:

    require_tree ./mobile
    

    Was pointing to a legitimate directory, but this directory had no files. On dev it didn't matter but something about the production setup was resulting in the error, “require_tree argument must be a directory”.

    Hopefully that helps.

    0 讨论(0)
  • 2021-01-30 14:50

    require_tree must be given an existing folder, but git doesn't store empty folders, therefore when you deploy on heroku, those empty folders doesn't exist.

    one trick is to add an empty .keep file to the folders you want to keep.

    0 讨论(0)
提交回复
热议问题