How did this Ruby on Rails app get deployed? - ruby-on-rails

I have a Ruby on Rails app running on my server, and I can't figure out how it was deployed (someone else set it up).
The app is located in /var/www/myapp. Before it was deployed, I had been able to go in there and make minor edits to the app. The person helping me out with RoR then "deployed" it. It was unclear what deploying actually did, since it points to the same database and is on the same server. However, I can no longer edit it (or at least, the files I am editing are not being pointed to by the server).
Any way to figure out how this thing was deployed so I can take it down to edit it? Or should I basically just start over?

Was it maybe running in development mode before, and now it's in production? When it's in development mode, all of the files are loaded on each request, so your changes show up immediately. In production mode, you have to restart the server to see your changes.

Related

How to clean RoR database yml cache?

I've just set out to creating my first RoR project, using MySQL. Obviously after the first visit to browser the site informed me about not being able to connect to the DB with the current settings. I've quickly updated them in the config/database.yml, however it still complained about the old settings.
Eventually, it updated and was working fine, but I'm sure there's a cache somewhere that could have been cleared to make this less of a nuisance.
I have commented it earlier, Now adding it to my answer ;)
It seems like you have not restarted the server after done the changes in database.yml. Because, database.yml is being loaded once at the time of server start-up. So please try with restarting your rails server.

Rails - Do we need to restart server everytime a change is made?

I am running a Rails app (with Passenger in Apache) in production mode. When I make changes to a erb file and refresh the site in browser, changes are not reflected. I need to restart the server to see the change reflected. This is annoying.
What is the right way to make changes deploy automatically?
You should not be using the production mode as a "development" mode. If you are making changes regularly, you should test on development mode and then if no bugs are found, you should push your code to your production environment.
Yes, In the production mode without restart your server, your changes not reflect.
I faced similar issue and i resolved it by following way.
My website is used by Americans only, so i push the code at midnight of US timezone.
Before i restart, i checked there how many users are loggedin now? If no users found then i restart my server.
Above technique helped me a lot.

Ruby on Rails. How do I change view file in production without restarting server

I made feature that allows to change one of view files through browser.
It changes file and doesn't use DB. In development mode all works well.
But as far as I know rails caches all files in production mode.
Does somebody know solution?
I have found this post
http://railshints.tumblr.com/post/1559660060/reload-rails-templates-dynamically-in-production-mode but it seems not work or I do something wrong.
I use Rails 2.3.5

Deploy Rails App

I have been asked to make a few cosmetic changes to our production deployment. I have access to our linux box where I can see the files I need to change. I only need to change html.erb files, but when I add, for instance a simple <p> tag, it does not show up live.
I know I probably have to reset the server or redeploy the code, but I have no idea what to do.
Our production deployment is not fully live, so I am making changes on the fly (I know that this is not the best practice). Our app is running in a shared hosting environment for the moment.
I have seen threads where people use Capistrano to deploy but how? We do not currently use it.
Can anyone help?
Whenever you make changes in production files, you have to restart the server to see the changes.
In production environment cache_classes is set to true. One can disable it and changes will be reflected without restarting the server.
So to reflect the change restart the server.
thanks......
I found a good guide on the Capistrano github wiki and also used this guide # kris.me.uk about a complete rails setup, including the Capistrano deployment aspect. I used them when learning how to deploy rails apps effectively. They should tell you what you need to know to get a basic deployment setup up and running.
Just incase someone is looking for the answer:
When rails is in development mode it will automatically reload changed files. When in production I need to restart it.
I eventually found out that we use God (A proces monitoring framework for rails - link here).
I had to restart our app with the following command: 'god restart APP_NAME'
Hope that helps someone :)
I wrote a Capistrano // NGINX guide and posted it on my blog. It's 85% correct, and should help you understand the big picture of the server/Rails/SSH configurations.
http://westonplatter.com/blog/2012/08/19/rails-slash-nginx-rackspace-deployment/

Why don't my views update?

I'm new to Ruby on Rails and am creating a test application. So far, it's working, but when I make some minor changes to my views, the page doesn't change.
My problem may be related to this question, but I'm not sure what is meant by setting the date and time in the VM. My code is on a remotely hosted server, so I assume it would use the system time of that machine.
Is there a caching issue here? What can I do about it?
If you don't have control over the server environment yourself (no shell access, etc.), you can set the following at the top of config/environment.rb:
ENV['RAILS_ENV'] = 'development'
Development doesn't cache much, so while it's slower it's much nicer to develop in.
You'll still need to restart your app after making changes to anything outside the app/ folder though (configs, plugins, etc.).
You need to restart your Rails app (or Apache if you are using Passenger) if you are in production mode!

Resources