does RoR develpment need shell access? - ruby-on-rails

let's say that RoR development environment is set up and working
does the developer need shell access to develop the RoR application?
would ftp be good enough?
why? I don't want to give my future developers ssh access to my linux box. Or can I set up their file permission so they can read only their project directory?
UPDATE
the whole idea is to have below running on my VPS linux hosting
code repository
production environment
test environment
maybe development environment
for
few projects
that are looked after by different people
so I want the developers to be able to do their job and only be able to access their project files and maybe only I would be able do to deployment into production from test environment

As Tom mentioned, it makes life a lot easier on Rails developers if they have ssh access to the machine so they can migrate the database, run bundle install, check the logs, or just jump into console.
There are ways to segregate users though, through file/directory permissions, chroot, or but making your linux machine a bunch of virtual machines and giving them their own
You can take a look at how Heroku's client works for possible ideas, since Rails developers are able to deploy, migrate, check logs, and even get into the console without direct shell access. Deployment is all done via git hooks and then their client gives access to particular commands. This is not trivial to set up/get working, though.

Well it does not REQUIRE shell access, but it sure makes it easier.
Without it how can you migrate a db? You would have to manually create controllers, models, etc.
Short answer, you CAN develop without shell access, it is just awkward and more tedious.

This is a common situation - for instance, Network Solutions allows you to do the basic RoR install but only gives ssh access if you step up and pay extra for a VM hosting package. My suggestion is to create the app on a local machine, of course using shell commands, then FTP mirror the files up, then use mysqldump to export the local database. NSI allows you a database console whereby you can then import your database dump file. You will probably have to edit config/database.yml since the host database server is unlikely to be localhost. If the necessary gems aren't present, you will have to plead with your hosting customer service.

Related

I am working on creating a baseline of a developer's set up for them to 'plug and play'. What would be the best option? VM, Containers or else?

I am trying to find the best way to achieve the following scenario;
I am currently working on getting a complex enterprise web application that consist on:
DB
BPM Engine
SOA Engine
Reporting Engine
Web Application Server
IDE
The applications is currently running in non-prod and prod environment but each environment is independent (no infra as a code, and deployments go from dev -> ... -> prod).
When a new developer comes in, they can't run the system in their local machine as it involves too many components (will come to this later). So they do development in their local machine and to test, they need to publish and deploy to dev. Test, rinse and repeat.
I am currently working on reverse engineer the whole thing so I can get it working on my local machine provided that I can install and run all the components. I am nearly there after fiddling with a lot of configuration, settings, etc.
This work I would like others to use, so they can also run the project in their local machines. In fact, since we will be migrating soon, I would like to pack the whole thing in a way that I can deploy it anywhere (the app already working and configured) and parametrised somehow whether is DEV, SYS, UAT, PROD. This, according to my understanding is what a docker image would do for you correct? You do all the work and then you create an image out of it? Then you can have this image running in a container and that way, other people can 'reuse' your work?
Is this the correct way of doing it? Any hints / comments would be appreciated
Apologies for my writing.

Setting up a Docker-Compose that will set up a Rails dev enviroment for local development

I’m new to Docker, I think I’m getting it down for server setup using docker, however I want to use Docker so non-engineer staff in my company can more easily setup a Rails dev enviroment, database, installing libraries on the ruby and javascript end, that kind of thing.
I can do it using Docker, however it requires getting into the docker engine and tweaking databases and what not which I feel is asking a lot for a non-engineer persons and doesn’t lessen there burden as just setting them up natively.
I’ve looked around on guides to setup Rails environments but they all tend to have a lot of work required to get everything up and running, I wish to have a more easier way of just fire up terminal and go to the project folder, smack 1 or 2 commands in and have it all done, is there any guide or example setup to do something like this?

Rails: How to "publish" a website

So, I am almost done with my website. I created it using ruby on rails on the Cloud9 IDE. Is there a way to publish it? To go on it, a user has to be signed on Cloud9 and then I need to run the code on the terminal...
rails server -b $IP -p $PORT
How would I be able to publish my website? I am very new to rails and I have no idea.
To publish your website you need to host it somewhere.
There are multiple ways to do this. For instance you can use Heroku. They provide PaaS (Platform as a service), which means they will handle the installation of the app for you and the maintenance of the virtual machine it resides (updates and whatnot).
Heroku also gives you a very nice admin view for the status of your app, online log display and some other goodies.
Another alternative would be Amazon Web Services, DigitalOcean or Linode (among many others!). They provide IaaS(Infrastructure as a Service). They only give you a virtual machine with your choice of operating system, you will have to manually publish your app and provide manual maintenance of the VM and pretty much anything including the database itself.
Using Heroku would be your best choice for the moment as they are very straightforward with the publishing part. Once you get the grip you can go to the other platforms for customization.
You will also need some deployment tools such as capistrano or mina.
If you're going to host your app in heroku, it's much easier to deploy. As simple as pushing your codes with git.

How to preview rails?

A website is shared to me on github. I'm working on it, but I can't do modifications on the actual site page yet. I need to see how the changes I make look like.
How can I have a live preview from rails? I was used to use xampp for the html/css stuff. Is there anything similar to that? If not, what are my choices?
The usual workflow is to setup a development environment on your local machine. The tools you will need for this are roughly:
git, to clone the github repository to your local machine
ruby (what version you need depends on the project), preferably you use a version manager such as rvm or rbenv
the correct database (again depending on your project, e.g. mysql or postgresql)
Once you have a ruby version installed, the first step will be to run 'bundle' to install all dependent ruby libraries. If that was successful you can configure your database in a file that either exists already or should be added: config/database.yml in which you configure the database connection.
You would use the command 'rake db:create db:migrate' to setup the database according to the projects migrations (=> specifying the database layout).
You might want to make yourself a bit familiar with ruby on rails, by following some good beginners tutorial. In the official rails guides that would be: http://guides.rubyonrails.org/getting_started.html
It is not as 'out-of-the-box' as you might be used to from xampp , so there might be a bunch of pitfalls in the way (especially if you're running on windows and not linux / mac).
It is hard to give you a complete walkthrough without knowing the application and your system.
Depending on who's developing the application you might also ask them to provide you with a VM, e.g. using a tool called 'vagrant' to simplify the setup for you. You will still need to get more familiar with git, in case you aren't yet.
Hi you can first keep your apache on xampp running normal.
Go to command prompt if you are on windows. Go to the root of your application on your computer.
Then run
rails server
To open the server. If you done all that correctly it should open on your browser at
Localhost:3000
Then you can take it from there.

deploying a rails project to a remote server

is it possible to deploy a rails project to a remote server using FileZilla ? the server is running nginx/1.4.6 (ubuntu)
if no what is the best way to deploy the project if there is already a running version !
To answer your question yes, the code needs to be up, so FTP should do the trick. You might need to restart nginx to pick up the changes, usually touching a restart.txt is enough, but that's particular to your setup.
Is this the best way? Possibly not!
Others suggested capistrano and that would be a good fit for a server you maintain, or go Heroku (or similar) service for a simpler setup.
Deploying a Rails app is a tough job. There is always the easy way (heroku) however shared servers don't deal well with rails. Theoretically you can but usually this shared servers have really outdated ruby and rails versions and are absolutely useless. And you can try to connect via ssh and try to update it but i doubt you will be able to do that. So... If you are a rails developer i can suggest.
1- For small apps run Heroku (easy and free) however cost grows like hell with the app's growth
2- If you're thinking about developing big apps get a dedicated server (you can get cheap ones for 5€/month) and configure it as u would for your computer except when you run rails you run it in production.
3- Trust me... i fought enough Rails and shared servers and i quit... I just gave up

Resources