Running multiple Rails projects on Ubuntu - ruby-on-rails-3

I'm brand new to Rails. I have one Rails project on my machine, but I'd like to create a 2nd project from scratch and I'm having trouble figuring out where and how to set it up. Specifically:
My current project is located in the Projects/project1 directory. I'd like to have it located in Projects/project2. Do just reinstall Rails into that directory?
I still need access to project1. How do I switch back and forth between the two projects in terms of browser access? Will it be a separate server? Do I have to edit a file to switch?
Anything else you think I might need to know in order to manage multiple projects. Please assume that I know nothing about the setup as I'm just getting started.

My current project is located in the Projects/project1 directory. I'd like to have it located in Projects/project2. Do just reinstall Rails into that directory?
Just create a new Rails project in that directory by running rails new:
$ cd Projects
$ rails new project2
You'll have a new (empty) Rails application in project2.
I still need access to project1. How do I switch back and forth between the two projects in terms of browser access? Will it be a separate server? Do I have to edit a file to switch?
Assuming you're running local servers via rails server, you can specify which port your server is running on via -p.
Given a Rails project, you can listen on localhost:3001 by executing
$ ./script/rails server -p 3001
To run multiple Rails projects locally, make sure they're all running on a unique port.
Anything else you think I might need to know in order to manage multiple projects. Please assume that I know nothing about the setup as I'm just getting started.
Depending on your platform, you should look into Pow or Passenger which automate the process of deploying multiple Rails apps to a single server.

Related

how to build and deploy angular 8 application in tomcat server?

basically i am java web developer , now i change one old web application into angular and spring boot microservices. i learn basic angular form youtube tutorials and other sources , but i have big confusion on deployment , when we run command ng build --prod ,it compress all files and create dist folder.
i copy all file from dist folder and paste inside tomcat webapps folder and application run fine ,
now i want to know it is necessary to build whole project every time ? and repeat same process again and again when we make any changes on our local development machine.
i try to find the solution a lot search on google but did not get any solution please suggest me what is the proper way for deployment from local machine to production server
You can use another external front server as node.js instead of embedding the front whitin a tomcat.
with a node.js server maybe you will be able to use the ng serve -o to change files and hot swap these changes easy
Another thing you can do is to set a devops environment, but this is more difficult.

How to change the local folder for an App Engine project?

TIA for your help.
I recently started experimenting with Google App Engine, and I have been able to set up a project successfully.
However, I made a mistake with the location of my local files and I would like to change it.
This is the output from my console when I deploy:
jnkrois#dev:~/Development/My_Project$ gcloud app deploy
Initializing App Engine resources...done.
You are about to deploy the following services:
My_Project/default/1234567890 (from [/home/jnkrois/Development/My_Project/app.yaml])
Notice that the local folder is /home/jnkrois/Development/My_Project/app.yaml
I want to change the gcloud settings in order to pull the files from my /var/www/html/My_Project/
That way I can run the project locally via my Apache server.
Thanks for your help.
That way I can run the project locally via my Apache server.
In the vast majority of cases you won't be able to run your GAE project through apache. Except, maybe, for a totally static website with a very particular config.
The proper way to run your GAE project locally is using the development server, see Using the Local Development Server
But to answer your question - there is no extra dependency of the project outside the project directory, so just move the project directory to where you want (up to you to check address any permission issues, assuming all permissions are met in the example below) and run the gcloud cmd from the new project location:
mv /home/jnkrois/Development/My_Project /var/www/html
cd /var/www/html/My_Project/
gcloud app deploy
Again, donno if this will help you run it through apache or not.

Is there a way to clear IBM MobileFirst Platform server Cache?

I'm working on an IBM MobileFirst Platform 7.1 project where there are many name value pairs in the worklight.properties file.
Say for example,
HOST_NAME = www.google.com
I access these variables form the MobileFirst adapter.
var hostName = WL.Server.configuration["HOST_NAME"]
There will be cases where I'll have to change the HOST_NAME in the worklight.properties to a different value. But sometimes, even after the value is changed in the worklight.properties file, they are not getting updated in the adapter.
Every time when I change the values I do the following,
Clean the project
Restart the server
Deploy the adapter again
Nothing seemed to change the value.
I suspect, the MobileFirst server caches the values and reuses the old values without updating the new ones. I say this because, I tried deleting the values in the worklight.properties file, and even tried deleting the file itself. Still the adapter was using the old value.
I tried deleting the MobileFirstServerConfig Folder in my workspace. Even that didn't work.
It would be great if someone could help me clear the cache or find a work around to this issue. Thanks in advance.
I kind of followed the above method but initially it didn't work.
But later I tried to follow these steps in this exact order and it seemed to work.
Stop Worklight Server.
Remove your project from Mobile First Development Server.
Go to the "bin" directory and remove your project war.
Clean and Build the entire workspace.
Start the server
Deploy the adapters
Run your app.
The worklight.properties file is embedded into the project runtime WAR file. So, if you change anything in worklight.properties, you must rebuild the WAR file and redeploy it. Based on your description, it sounds like you're only building the adapter (and not the app). At minimum, I would suggest to remove the runtime WAR file from the project "bin" directory (just to ensure that it gets rebuilt) and build all app environments. That should build / redeploy the WAR file and restart the server, and then what you're doing should work.
Here are the steps to follow:
1. If worklight server is up and running, stop it or restart your system.
2. Clear bin folder.
3. Do Clean Project and Build for enviournment.
4. Open Mobile first Console(Start server)
5. Deploy All adapters
6. Run your app.
If wlq or wl error is comming we can give an alert message 'test' in our main file where we have all the javascript files.

Deployment from within IntelliJ IDEA

Deployments from IDEA are possible, e.g. I can connect to remote server and I can upload a package. The deployment process I have involves a little bit more than just deploying a file on server.
Once the file is uploaded I need to run certain commands to complete the deployment which mean I need to connect to the server and run those commands one by one and I am looking to do that through one click from the IntelliJ IDEA.
Is that possible?
This is how the project directory looks like:
This is how I am trying to setup deployment:
if you click on that little "Fix" button that's what I see
Even if I try to remove the unwanted entries they come back and never go away.
Finally this is what my project structure looks like in idea
Yes, you can use Remote SSH External tools. Make a script that will run your commands, deploy it to the server as well, then run this script remotely via a tool.
In the Run/Debug configuration Before Launch steps you can add your remote external tool to run automatically.
You can find some more details in my another answer.

Running rails project on another machine

I am developing a website on rails. I tried to move my project on another machine and start the rails server but the server doesn't start. Instead when I enter the command rails s in terminal it creates various files. Please let me know the steps I should follow to run my project on another machine. I have rails installed there.
sounds like the other machine has rails 2 (instead of 3) installed, where running rails <something> would generate a new rails app called <something>