5

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]: ):
DhatchXIX
  • 437
  • 1
  • 3
  • 17

2 Answers2

5

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
Marek Lipka
  • 50,622
  • 7
  • 87
  • 91
  • I did this and when I clone the app from heroku, it doesnt change and im still getting errors in heroku. – DhatchXIX Jun 10 '13 at 15:02
  • Are you sure your commit changed what it was supposed to change? And that heroku received push properly? – Marek Lipka Jun 10 '13 at 15:29
  • It is hard to know for sure if the commit changed what i needed it to. Locally, the directory is correct and working. But after i commited this and sent it to heroku. I then cloned it and it still had the capitalized version of the directory. – DhatchXIX Jun 10 '13 at 15:35
  • 2
    @MarekLipka git won't properly keep track of directory renaming when it's just lower/uppercase changes. Have you tried your example above to see if it works? It doesn't for me on 1.7.10.2. What I've done in the past, which is not ideal at all, is moved it to a new name, for instance `admin2`, committed that, and then moved it to `admin`. AFAIK, git is pretty much case insensitive. Some further reading: http://stackoverflow.com/questions/3011625/git-mv-and-only-change-case-of-directory – theIV Jun 10 '13 at 15:38
  • That's weird. I tried this on 1.7.9.5 and it kept changes. I even sent push to github and then I made git clone - directory was renamed. – Marek Lipka Jun 10 '13 at 15:55
  • you can say that : mv old_path_with_folder_name new_path_with_folder_name – HaRsH Sep 09 '14 at 14:59
0

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
thedanotto
  • 6,895
  • 5
  • 45
  • 43