How to run rails website permanently on Mac OS X - ruby-on-rails

i've developed small web app for personal use with Ruby on Rails. Now when i want to use it I open Terminal and run ruby script/server to run mongrel then i go to Safari and type localhost:3000 to see my app.
I'd like to have this site start automatically on startup of mac and possibly to use some other URL.. preferably just http://myapp/
I come from C#/asp.net world and don't know much about apache/mongrel stuff.
Do you know any step by step tutorial how to configure rails/mongrel/apache on mac os x leopard to work together and run after startup, please? (I have apache running, which was done just by checking checkbox in system preferences/sharing)

This page by apple should have all the information you need:
http://developer.apple.com/tools/deployonrailsleopard.html

The easiest method would be to install Passenger Phusion / mod_rails for Apache. This will allow you to use sidestep the usage of Mongrel/Thin/etc and deploy apps much like php (stick it in a folder and go).

If you want to run it on Mac OS X you can simply setup your webserver, I recommend nginx with Phusion's Passenger, and your database server to start on boot, that way whenever your computer has to restart it will have your site running. Of course if this is a laptop that will be changing networks and needs to be accessed by other people I would recommend getting a proper VPS for it, come to think of it, I would recommend that anyway if this is supposed to be a production environment.

Related

Running RoR in isolation on Ubuntu VPS

Apologies for these stupid questions (please explain why if you're going to downvote).
I have a site running on a LAMP stack on a Linode Ubuntu VPS and want to learn rails on the remote server without causing disruption to the site currently at mydomain.com.
1) Can I install rails the normal way (as I would on my own PC), and have it not effect the site that is currently up?
2) If a generate an app skeleton after installation, after starting the rails server, how can I navigate the default view?
1) Your test Rails app and the production PHP app can co-exist (hopefully you know your way around Linux) on the same server without interfering with each other. However, I would not recommend this. Bad idea to be trying experimental stuff on production VMs/VPSs. You are better off spooling a test VPS for Rails or better still use VirtualBox VMs on your local machine.
2) Rails apps start on port 3000 by default. So on the VPS, you can reach the Rails app root at http://xxx.xxx.xxx.xxx:3000 (replace the x's with your VPS's IP addr.)

Can someone please tell me a quick way to deploy a small rails app on Windows?

Yes I know there's not much support for deploying Rails apps in Windows but this is a requirement. I've searched online for hours looking for a solution to no avail! I don't need to use any particular server just anyway to get my app viewable on the company intranet.
I installed the WAMR (Windows, Apache, MySQL, Ruby) stack using the BitNami rubystack 1.9.3 installer. I can see my app using the WEBrick dev server just fine in localhost. I can even see the BitNami Welcome screen (index.html) when pointing to my Windows VM IP address from another computer on the intranet, but I can't figure out how to push the Rails app itself to production so that all other intranet computers can see it. Any solution would be appreciated! The server doesn't have to be Apache.
Thanks!
Quick and easy way to deploy a rails app on windows?
I would recommend virtualbox to run a linux virtual machine. Install vagrant and you'll be able to fully automate the download of the linux image and rails provisioning using tools like chef or puppet.

deploy ruby or rails on windows [duplicate]

I'm looking to run Redmine, a Ruby on Rails app, on a VPS windows box. The only thing I can really think of is running a virtual Linux machine and hosting it from there. If that is my only option, am I going to run into problems running a virtual machine inside of a virtual machine?
Also, this will be an internal app, so performance isn't my number once concern.
Windows is not the usual place to deploy production Rails apps, but there are people who do it. Mongrel was originally written to give better deployment options for Windows. As it turned out the UNIX deployment options weren't that good either. :)
Start with the Ruby One Click installer so you have a sane installation of ruby and rubygems.
From there, you install the rails gem and the gem for your database like you normally would. Most if not all of the databases have Windows gems.
Make sure to install mongrel_service to be able to control each mongrel like a normal windows service. See mongrel_rails service::install -h for details.
Once you have your mongrels set up, it's similar to a UNIX deployment. You set up a reverse proxy, such as Apache2 and you're set.
You might run into some gems (such as BackgroundRB) that will not work under Windows because they have C code that either rely on UNIX libraries or expect a UNIX-like build system at installation time. However, all of the really important Rails gems, such as Mongrel and the database adapters, have gems with pre-built binaries available, so you'll be fine.
Just grab the Bitnami RedMine stack.
Or the Bitnami Ruby on Rails stack.
Redmine ran fine on our Windows build server from the command line, sans IDE, using Mongrel and SQLite. Granted, ours isn't a VPS, but at any rate Linux isn't required for this app.
The BitNami Redmine Stack is a free, up to date Windows installer package for Redmine on Windows, Linux, OS X... give it a try. You can also download a VMWare Virtual Machine as well
I had good luck in the past with InstantRails, but I'm not sure how up-to-date it is now, as the project has changed hands several times.
You might also try ruby stack or flash rails, though I've not used either personally.
You can install SQLite and a Rails server like Mongrel on a Windows machine. I used Aptana to run a development environment, but I'm sure that there are better alternatives that don't require the IDE to be open to run. But this proves it is possible.
Try using a Rails distribution like: http://instantrails.rubyforge.org/wiki/wiki.pl
One download install for rails+ruby+mysql on Windows.

How to use a VM to create a Rails staging environment

My app is in development and I do all my testing using WEBrick (I like the terminal output).
On the production server it will run on Phusion Passenger.
I'm running Snow Leopard and wish to test the app in an environment similar to the production environment.
Can I use Parallels to run a Debian install with Apache and Passenger and configure Capistrano to deploy to that?
Thanks!
I have been using VMware for that sort of thing. Its really easy to deal with network wise. I have recently switched to Virtualbox which is much nicer to actually work in (at least for me), does the same things, and is free. Download the Debian iso and create a new VM that uses it as its CDrom. Thats about all you need to do. Good luck.
This may not be the answer you're looking for but I've found it very straightforward to just run passenger locally for development. You can always tail the development.log, it's really just as easy as watching the terminal output from webrick.
Dev setup is made all the easier with the drag and drop ease of the phusion passenger pref pane.
http://www.fngtps.com/passenger-preference-pane
Seems like it would be easier than setting up the VM and all. Though yes, there could still be differences if your not hosting on OS X server I suppose.

Is there anyway to run Ruby on Rails applications on a Windows box?

I'm looking to run Redmine, a Ruby on Rails app, on a VPS windows box. The only thing I can really think of is running a virtual Linux machine and hosting it from there. If that is my only option, am I going to run into problems running a virtual machine inside of a virtual machine?
Also, this will be an internal app, so performance isn't my number once concern.
Windows is not the usual place to deploy production Rails apps, but there are people who do it. Mongrel was originally written to give better deployment options for Windows. As it turned out the UNIX deployment options weren't that good either. :)
Start with the Ruby One Click installer so you have a sane installation of ruby and rubygems.
From there, you install the rails gem and the gem for your database like you normally would. Most if not all of the databases have Windows gems.
Make sure to install mongrel_service to be able to control each mongrel like a normal windows service. See mongrel_rails service::install -h for details.
Once you have your mongrels set up, it's similar to a UNIX deployment. You set up a reverse proxy, such as Apache2 and you're set.
You might run into some gems (such as BackgroundRB) that will not work under Windows because they have C code that either rely on UNIX libraries or expect a UNIX-like build system at installation time. However, all of the really important Rails gems, such as Mongrel and the database adapters, have gems with pre-built binaries available, so you'll be fine.
Just grab the Bitnami RedMine stack.
Or the Bitnami Ruby on Rails stack.
Redmine ran fine on our Windows build server from the command line, sans IDE, using Mongrel and SQLite. Granted, ours isn't a VPS, but at any rate Linux isn't required for this app.
The BitNami Redmine Stack is a free, up to date Windows installer package for Redmine on Windows, Linux, OS X... give it a try. You can also download a VMWare Virtual Machine as well
I had good luck in the past with InstantRails, but I'm not sure how up-to-date it is now, as the project has changed hands several times.
You might also try ruby stack or flash rails, though I've not used either personally.
You can install SQLite and a Rails server like Mongrel on a Windows machine. I used Aptana to run a development environment, but I'm sure that there are better alternatives that don't require the IDE to be open to run. But this proves it is possible.
Try using a Rails distribution like: http://instantrails.rubyforge.org/wiki/wiki.pl
One download install for rails+ruby+mysql on Windows.

Resources