Old website is being loaded instead of the new one - ruby-on-rails

PS: I'm a complete Noob at servers stuff
So Initially I had this directory on amazon ec2, I did run the rails server using the terminal by connecting with ssh. Everything was working fine as expected when I hit the domain URL(I added the elastic IP in the A records of domain provider)
Now I rebuilt the website from scratch, it's on a different git repository, in order to replace the old one with the new one, I logged into ec2 via terminal, shut down the previously running rails server, cloned the new repository, navigated to the root directory and ran the server again.
when I visit the registered domain, it's showing the HTML file of the old code(no stylesheets nothing, just the index.html), if I visit amazon_public_DNS:port_number, I'm getting the new website loaded.
Do I need to change anything else ?

Related

Are all my Ruby files in my Rails project stored on the server I specify? (eg. Puma, Webrick)

When I enter a URL into my browser, and it sends a request to the server (in this case, the host is salty-headland-18854.herokuapp.com), are all my Rails files stored at this host?
How does Puma come into play? I understand Puma to be a web server and I've included its gem. What is the distinction here between the host and Puma?
Does Heroku have a bunch of physical computers somewhere, that house my literal .rb files?
Visual of my question
It depends on the files, but pretty much the answer is yes. Heroku pulls down your app from the git repository specified (or you push it to Heroku's git repository) and Heroku has all the files from that. Without a security exploit, no one is able to access their source.
You can think of a Heroku Dyno as a Linux server with the complete Rails application. When it is launched for the first time, a linux server is built and the Rails application copied to it and the app server launched.
You code actually lives in the Github repository you have linked to Heroku. Persistant data is stored either in the database or an external file service such as S3.
It is possible to run commands on the Dynos using heroku run
Reference

Deploy Rails server on Digital Ocean, works with direct IP address only, not with domain name

Got server deployed in production mode through this tutorial.
It works on my direct Digital Ocean IP address, but my domain name still shows ZPanel
Have you installed mod_passenger?
Have you created the virtual host in your apache httpd.conf?
Have you restarted apache?
Hint: put a index.html file in your application - public/ directory and some gibberish in it, then see if it loads fine in your browser. If it does not, then your apache config needs work, if it does but the Rails app still won't work, you should look at that one instead.

Rails still hitting old database IP, even after restarting apache

I have a Rails app on a windows machine that also has a SQLServer that it used to use as it's database.
However I am trying to transition the app to use a new SQL server on a different Windows machine.
The new Machine is reachable (ping)
After changing the database.yml file with the new IP I can go into Rails console and make queries on the new machine.
However, Running the code still queries the local(old) database.
I have restarted apache.
This is driving me nuts. Why is my code still hitting the old configuration? Do I need to restart the machine completely?
Thanks
Just Try printing the TARGET_ENV and the URI that you are targeting in the Ruby code. It will tell you which IP is being hit everytime.

ASP.NET MVC Deployment Referencing Development Environment

I am trying to deploy my ASP.NET MVC 3 application using Visual Studio 2010's "Publish Web" option (build/Publish App). This generates deployment/bin, deployment/scripts, deployment/views etc.
I loaded these resulting deployment files/folders to a web server running IIS 6. Afterwards, everything seemed to run just fine on this web server.
I then started to make new updates, just to my local environment. After doing that, the deployed version of the site stopped working. I looked at the stack trace and the web server seemed to be referencing controllers.cs from my local environment, as opposed to the dll's in the bin directory on the web server.
Is there something else I need to do before deployment to tell the web server to use it's own bin files as opposed to files on my development environment?
BTW both my development machine and the web server live on the same network.
Update:
Another thing that made me suspect that the web server was referencing my local dev environment was that when a new user tried to access the application she got an IOFileNotFoundException in regards to a reference to "Interop.ActiveDs.dll". The stack trace mentioned my_local_path/Interop.ActiveDs.dll. This file was in fact not on the web server so I added it and then her error went away. The Odd thing was that all other users before her did not recieve an error about this missing reference.

How to deploy a rails app with no domain name. (trying to create a test server)

Ok so what i'm trying to do is deploy my first rails project. I've asked this question and i think i figured out that you can't configure apache to work using an ip and you have to have a domain name.
The reason i can't use the domain name yet is because i'm recreating a site for someone and they don't want it to be down in between switching the domain from their current site to their new rails site.
I'd like to get my rails app running on a server so I can test it out and then once it's ready, switch the domain name.
How can i setup a server to run a rails project without using the domain name?
If you want to run the rails project locally in development mode, then just run the command rails s from the root of your project.
It is possible to deploy two apps to the same server, or two versions of the same app, I typically use sub-domains for this, website.com and then testing.website.com.
You will just need to have seperate databases and seperate virtualhost files.
You could also try to access the apache machine by it's IP address if it is on the local network.

Resources