Luis Ortega Araneda
Luis Ortega Araneda

Reputation: 875

Cant' seed files to my Rails app on Heroku

I'm trying to seed my app on Heroku. I use a seed like:

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")

This works great on my dev machine but I can't manage to run it flawlessly on Heroku (it does create a new record, just it doesn't upload an image).

I run 'heroku run rake db:seed'

and I get

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

I tried updating to Ruby 2.0.0, I was using 1.9.3 previously; I've done some research and some people claim to have the same problem but solved it by running:

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

well... it didn't work for me.

I'm using Rails 4 by the way.

Upvotes: 1

Views: 551

Answers (1)

techvineet
techvineet

Reputation: 5111

Heroku is a read-only filesystem, so you cannot upload images. Probably this will help

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

Upvotes: 4

Related Questions