1

我正在尝试在 Heroku 上播种我的应用程序。我使用像这样的种子:

Word.create 
  :name => "Name", 
  :description =>"Im a description", 
  :example => "Im an example", 
  :icon => File.open("public/images/exp/example.png"), 
  :audio => File.open("public/sounds/example.mp3")

这在我的开发机器上效果很好,但我无法在 Heroku 上完美运行它(它确实创建了一个新记录,只是它没有上传图像)。

我运行“heroku run rake db:seed”

我得到

/app/vendor/bundle/ruby/2.0.0/bin/rake:

我尝试更新到 Ruby 2.0.0,我之前使用的是 1.9.3;我做了一些研究,有些人声称有同样的问题,但通过运行解决了它:

heroku config:set PATH=bin:vendor/bundle/ruby/2.0.0/bin:/usr/local/bin:/usr/bin:/bin

嗯......它对我不起作用。

顺便说一句,我正在使用 Rails 4。

4

1 回答 1

4

Heroku 是一个只读文件系统,所以你不能上传图片。可能这会有所帮助

https://devcenter.heroku.com/articles/read-only-filesystem

于 2013-08-28T02:23:39.937 回答