Filezilla uploaded files to rails via sftp won't show up

February 7, 2017 486 views
Ruby on Rails Ubuntu 16.04

hi,

I'm a Ruby on Rails noob, I am using the one click application which I can access via terminal ssh and browser.

I downloaded the rails project file (via SFTP Filezilla) to my local machine (Mac OS X Yosemite), I want to make changes to these files then re-upload it back to the same location via SFTP Filezilla. Therefore practically changing the file (View>Home>index.html.erb). I added a simple line of code which is a heading. But when I checked my rails home page, the change I did on the code is not reflecting. (my H1 tag is not showing up).

Is there something that I missed doing for me to edit my code and re-upload it back to my digitalocean ip directory?

Thanks!

3 Answers

@robertcristobal

When you login to SFTP using root, the first directory you'll be dropped in to is /. From there you'd have to navigate to your project directory and then upload the files.

If the files are not uploading, you'd need to check the logs to see if there's something being logged that details the issue. In FileZilla, at the top, there's also output that should shed some light as to what is going on.

The default log directory is /var/log. We can run

tail -20 /var/log/auth.log

and

tail -20 /var/log/syslog

To see if anything pops up there.

thanks for the feedback @jtittle

I'm not sure what logging in using root means but this is the screenshot of my Filezilla connection setting

Image

The files actually uploaded, I right click on the file via Filezilla and edit it, I can see the <h1>Hello world</h1> code I inserted on my local so the file uploaded, i'm not sure why that is not showing up when I visit my droplet IP because it is still showing the page in its original state.

Thank you!

@robertcristobal

Ah, the one-click image may use rails as the default user instead of root (which is standard for base OS installations). If the files are uploading without any errors, and it's to the correct directory, unless there's some degree of caching, then all should work.

To test things out, I just deployed a fresh RoR one-click and logged in with rails as the user, using SFTP on Port 22, and then the password I was provided with and then navigated to:

./rails/rails_project/app/views/home

.. then downloaded the index.html.erb file, removed the logo from the default file, uploaded it, and then refreshed the page and it was gone as expected.

So if you're not seeing the changes, it would appear that the file isn't uploading despite what may be showing.

  • thanks @jtittle

    this is what I am exactly doing, except that the page is not showing the changes. I will probably try to destroy my RoR droplet and upload a fresh one..

    thanks for your help!

    • @robertcristobal

      Give it a shot and let me know the results. If this is persistent and you're positive there's no logs showing up saying that access is denied, then I would get in touch with support and see if they can look in to it.

      Make sure you specify the data center in the ticket just in case there's some variance across DC's (normally, there's not that I've seen but I tend to stick with the NYC and SF DC's -- so I can't speak for the others yet).

      • thanks @jtittle

        it's working fine now after I created a new RoR droplet. Though the refresh is a bit delayed by a few seconds, I can already see the changes I am making. Thanks for your help!

Have another answer? Share your knowledge.