Ruby on rail migration - ruby-on-rails

I have a backup of ruby on rail server working with mysql databse.
backup Folder contain many subfolder like Vendor, node_modules, lib, config, bin, app, db, public and some files.
Now i have configured a new ubuntu server with fresh install of ubuntu server and ruby on rail is showing welcome page on port 3000 on server ip.
Can you guide how i can restore that backup app to this server so the app starts working from this new server.

Copy the root folders of the app to your new computer
with the terminal go to the root of the directory
cd path/to/your/root/directory
check that you are in the root directory by running pwd in the terminal, it should return the root directory of your app
run the bundle install command in the terminal, it will install all the gems required for you app
trouble shoot potential errors by searching online for instructions, install all software required and read every error
run rails s and go to your webbrowser to test the development version of your app

Related

How to run Heroku rails app locally without access to source code

My Heroku app is created and it also runs in my big commerce store but I want to run in locally.
Basically, I want to get all file in local machine from Heroku app.
Please help..
Since you have access to git repository, you just need to clone it
git clone GIT_URL
then move into the app root directory
cd my_app
and then do
bundle install
now start the server
rails server
goto localhost:3000 from your browser..
Update
Since you have access to heroku, in the app dashboard goto settings near the bottom page you will find Heroku Git URL, clone that.
In a new empty folder just type this from cmd
git clone https://github.com/bigcommerce/hello-world-app-ruby-sinatra.git

Rails server not working when copying back from staging deploy

I ssh copied a rails app from a staging server because the development repository has been lost. My goal is to create a new development code base using the deployed code as a source. So far I have removed a hidden .bundle folder and replaces several aliases with folders and files. I then ran bundle install. For the database I did a sql dump from staging and used it to build a development database. I think I'm ready to run rails server. But when I try to run rails server in the base directory. It gives me the rails command line help as if I was running rails s in a directory with no app.
I'm not even sure if it is possible to reverse a deploy this way. I've looked at the rails guide on the app initialization process and all the files seem to be in place.
Remember that for Rails to start up, you need bin/rails, bin/bundle, config/boot, etc.
If you restore those files, it should work again.

libruby.so.1.9: cannot open shared object file: No such file or directory - vendor/bundle/ruby/1.9.1/gems/pg-0.17.1/lib/pg_ext.so (LoadError)

I have a RoR (4.1) app that I'm trying to deploy, using Passenger & Nginx. I'm trying to avoid running "bundle install" on the web server. I ran "bundle install --deployment" on my build server, zipped up the whole folder and shipped it to the web server. But now I'm getting this error:
libruby.so.1.9: cannot open shared object file: No such file or directory - /var/www/foo_app/vendor/bundle/ruby/1.9.1/gems/pg-0.17.1/lib/pg_ext.so (LoadError)
The file does exist, and has read & execute permissions for all users (and rwx for the user I think passenger is running as). Any ideas what I'm missing?
I've had no end of problems getting this working, should I just give in and bundle on the target machine?

Ruby Passenger displays content from public instead of the app

I have a server in the cloud. I've set up a Linux machine with Apache2 + Passenger(with the apache module installed).
I've configured by the book, set up the VirtualHost as the Passenger instructions tell me to.
I've created a default Ruby on Rails project in "RubyMine"(on the local machine), synchronized it with the server.
Here is the project file hierarchy:
Since the instructions ask me to point in the configuration file to /projectFolder/public, I did so. If there is no index.html in the public folder, it throws me an error, if I create one it displays it when I access the link.
But when on the local machine I deploy it, it instead launches the app from app->views->layouts.
How to make it run on the remote server my ruby code? My ruby "app"?
First try:
sudo passenger-status
This should show you if passenger is loaded and the applications group. If that is all good, delete the index.html from /public and restart apache.

How to Move A Ruby On Rails Website To New Server

I have a Ruby on Rails website which I have successfully tar the apps directory which included the current folder ect. Which I Wget to transfer the files over. The server I have moved to is setup to run Ruby on Rails but is there anything else I need todo to get it running?
Any commands via SSH?
My new server setups is Ubuntu 11.04 running ISPConfig 3 as the server admin.
Current the file are in the correct location with the correct permissions and owners. But all I'm getting is the default ISPConfig page.
(This is the default index page of your website.
This file may be deleted or overwritten without any difficulty. This is produced by the file index.html in the web directory.)
If anyone can point me in the right direction that would be great.
Have you tried creating a symbolic link on the server to the application something like
cd ~/public_html;
ln -s ~/rails-test-application/public rails3
http://www.site5.com/blog/programming/ruby-rails/how-to-deploy-phusion-passenger-to-a-subdirectory-routing-errors-and-restarting/20090414/

Resources