Ruby on rails 有些图像没有加载到heroku上?

Ruby on rails 有些图像没有加载到heroku上?,ruby-on-rails,heroku,ruby-on-rails-4,Ruby On Rails,Heroku,Ruby On Rails 4,所以,我有一个应用程序在heroku上运行,由于一些奇怪的原因,与评级系统相关的图像没有加载。换句话说,用户有能力对电影进行评级,应该显示5颗星的图像,他们可以选择对电影进行评级的明星数量 现在,明星们在发展中表现得非常出色,但这就是他们在制作中的表现: 当我右键单击并检查元素时,它表示加载给定url失败 我还运行了以下程序: locally: rake assets:precompile locally: RAILS_ENV=production bundle exec rake assets

所以,我有一个应用程序在heroku上运行,由于一些奇怪的原因,与评级系统相关的图像没有加载。换句话说,用户有能力对电影进行评级,应该显示5颗星的图像,他们可以选择对电影进行评级的明星数量

现在,明星们在发展中表现得非常出色,但这就是他们在制作中的表现:

当我右键单击并检查元素时,它表示加载给定url失败

我还运行了以下程序:

locally: rake assets:precompile
locally: RAILS_ENV=production bundle exec rake assets:precompile
production: heroku run bundle exec rake assets:precompile
图像仍然没有显示,我做错了什么

谢谢

编辑,所以路径是错误的,现在我应该使用资产路径的图像,但他们在一个查询插件!!!我如何绕过这一点,以便将它们从资产路径中拉出?顺便说一句,它们是star-off.png:

$.fn.raty.defaults = {
        cancel          : false,
        cancelHint      : 'cancel this rating!',
        cancelOff       : 'cancel-off.png',
        cancelOn        : 'cancel-on.png',
        cancelPlace     : 'left',
        click           : undefined,
        half            : false,
        halfShow        : true,
        hints           : ['bad', 'poor', 'regular', 'good', 'gorgeous'],
        iconRange       : undefined,
        mouseover       : undefined,
        noRatedMsg      : 'not rated yet',
        number          : 5,
        path            : 'img/',
        precision       : false,
        round           : { down: .25, full: .6, up: .76 },
        readOnly        : false,
        score           : undefined,
        scoreName       : 'score',
        single          : false,
        size            : 16,
        space           : true,
        starHalf        : 'star-half.png',
        starOff         : 'star-off.png',
        starOn          : 'star-on.png',
        target          : undefined,
        targetFormat    : '{score}',
        targetKeep      : false,
        targetText      : '',
        targetType      : 'hint',
        width           : undefined
    };

我也遇到了同样的问题,结果只是用实际的预编译链接更正了raty.js中的直接链接

    starHalf        : 'star-half.png',
    starOff         : 'star-off.png',
    starOn          : 'star-on.png',
对此

starHalf     : 'star-half-db15fb9b3561d5c741d8aea9ef4f0957bd9bc51aa1caa6d7a5c316e083c1abd5.png',
starOff      : 'star-off-6aaeebdaab93d594c005d366ce0d94fba02e7a07fd03557dbee8482f04a91c22.png',
starOn       : 'star-on-fd26bf0ea0990cfd808f7540f958eed324b86fc609bf56ec2b3a5612cdfde5f5.png',

这解决了我的问题,在我重新编译所有内容后,Heroku上的开始显示正确。

检查html并查看它试图从何处加载图像。然后看看在那个位置是否有什么东西。你肯定给我指明了正确的方向,请参阅更新的帖子。你能挑选一张不工作的图片并处理它吗?比如src设置在哪里,以及它相对于/public文件夹在文件系统中的实际位置。因此,源代码是:/assets/star-off.png,但实际上,它应该像其他文件一样存储在Amazon S3存储桶中。但是因为资产路径没有被使用,我认为这是问题的根源。我们如何将它上传到S3,我很困惑,因为它在实际的JQuery中。我的回答更像是一个一般的调试技巧。如果你的解决方案能帮助其他使用该插件的人,那么最好写下你自己的解决方案作为答案。