DhatchXIX
DhatchXIX

Reputation: 437

How do I rename a file in Heroku

I have an app on Heroku. At some point in time I accidentally name the folder "Admin" instead of "admin". Now it is stuck with the capitalized name instead of the lowercase. how do i resolve this?

here is the error in heroku logs

2013-06-10T15:18:48.223475+00:00 app[web.1]: Started GET "/admin/orders/new" for 173.78.15.104 at 2013-06-10 15:18:48 +0000
2013-06-10T15:18:48.296834+00:00 app[web.1]: 
2013-06-10T15:18:48.296834+00:00 app[web.1]: ActionView::Template::Error (Missing partial admin/orders/form, active_admin/resource/form, active_admin/base/form, inherited_resources/base/form, application/form with {:locale=>[:en], :formats=>[:html], :handlers=>[:erb, :builder, :arb, :haml]}. Searched in:
2013-06-10T15:18:48.296834+00:00 app[web.1]:   * "/app/app/views"
2013-06-10T15:18:48.296834+00:00 app[web.1]:   * "/app/vendor/bundle/ruby/1.9.1/bundler/gems/active_admin-fa7e4de2d5fa/app/views"
2013-06-10T15:18:48.296834+00:00 app[web.1]:   * "/app/vendor/bundle/ruby/1.9.1/gems/kaminari-0.14.1/app/views"
2013-06-10T15:18:48.296834+00:00 app[web.1]:   * "/app/vendor/bundle/ruby/1.9.1/gems/devise-2.2.4/app/views"
2013-06-10T15:18:48.296834+00:00 app[web.1]: ):

Upvotes: 5

Views: 2286

Answers (2)

thedanotto
thedanotto

Reputation: 7307

Ultimately, your directory is improperly capitalized within git, heroku reads git. You need to make the directory change within git, then push. However, git is case-insensitive by default. This is how you get around that.

git mv app/views/Admin app/views/admins
git mv app/views/admins app/views/admin
git commit -m 'changed case of admin folder for heroku'
git push heroku master

Upvotes: 0

Marek Lipka
Marek Lipka

Reputation: 51151

You should make git push with proper folder name commited.

Assuming your folder is in app/views:

mv app/views/Admin app/views/admin/
git add app/views/admin
git commit -am "rename admin directory"
git push heroku master

Upvotes: 5

Related Questions