RoR + IIS. What kind of problems I would run into? [duplicate] - ruby-on-rails

This question already has answers here:
Ruby on Rails on IIS?
(6 answers)
Closed 8 years ago.
It looks like that most of the time people are running RoR behind nginx/Apache web servers. Right now our workshop uses only Microsoft's products. So most natural move would be to try and run RoR using IIS 7.5.
It does look that setting up RoR and IIS is a quite a pain. However, besides problems setting up IIS I could not find anyone pointing out problems with RoR behind IIS.
Are there any issues I would definitely run into if I would choose this "lovely" path of IIS?

Sure, it's possible, but you are setting yourself up for trouble. Configuration, deployment, and troubleshooting will be constant hassles under IIS. If you really want to host internally, I'd setup an Ubuntu server in Hyper-V, use Nginx, and be done with it. On the other hand, if your shop isn't built to deal with managing a Linux server or hosting a Rails app internally, I think it would be more reasonable to consider Heroku or another PaaS before dealing with IIS.
EDIT: Coming from a background in Windows IT, I know that setting up a Linux server and managing it isn't always as easy as "do it and be done with it," so don't think I'm not sympathetic to where you're coming from. The thing is, while the "natural move" might seem like trying to do it in IIS, it is an unnatural move as far as Rails is concerned. My suggestion to anyone who isn't ready to make the plunge into both Linux and hosting their own Rails apps really is Heroku. Even with the know-how to configure Linux for Rails, I still use Heroku for all of my Ruby MRI apps.

Related

Rails : Deploy using GoDaddy.com

I know this is a topic which is very delicate however the simple question is.... has anyone uploaded a rails app using godaddy.com and if so how did they do it. I'm literally clueless. This is my first time. I cannot use anything else due to my clients choice.
If you're looking for shared hosting, Heroku is your best bet. Although you will need to make some minor modifications to your application to fit this environment, the benefits are considerable.
I would not recommend using regular shared hosting, which is primarily intended for PHP applications, for Rails. You need a VPS at the very least, and if you're not prepared to manage this, you need a managed environment like Heroku or you'll end up in serious trouble.
For small scale or hobby projects, a 512MB VPS is usually sufficient to get started.
If your client is insisting on GoDaddy, Rails may not be a good choice for you. It does seem possible according to the documentation but you need to have the correct account type.

Best Way to Host a Rails App on a Windows Server?

I have a simple rails app that I need to deploy on a Window Server 2008 R2 server. I have looked around but have not found much on the topic. What are some simple / best ways of accomplishing this? Thanks!
I'm not sure if you can use Capistrano to deploy on windows. Otherwise you may want to have a look at kwatee (self-promotion). I haven't looked at deploying Rails app yet since Capistrano is the tool of choice there but kwatee is a free tool that can deploy pretty much anything from stand-alone applications, web applications on any platform, including windows.

Setting up a Ruby development environment [closed]

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 9 years ago.
I am currently trying to set up a development environment for learning Ruby. The environment will primarily be for getting to grips with the language, but I will most probably move on to development with Rails after long. With web development a target, I would like to hear about preferred web servers and databases.
I plan on setting up the environment on a virtual machine, so I'm not worried about trashing the thing. Therefore, I am open to using a Linux distribution, OSX or Windows as the operating system.
I'm moving from C#, so I'd like to be forced into the Ruby way of thinking to a certain extent. Obviously, that's easier said than done.
What OS do most Ruby developers use?
What is the easiest IDE to get to
grips with coming from a background
of using Visual Studio?
Which
database is used most within the Ruby
community?
Which database is most
likely to be supported by most web
hosts?
Which web server is the
easiest to configure? To get up and
running in the shortest amount of
time.
Hopefully I have provided all the information needed and hopefully this will aid others in setting up their own environments.
Thanks
Edit:
Thanks guys. Some really good
suggestions so far, all of which I'll
take on board. I'm currently wading
through the copious articles surrounding
initial RoR setup on Linux, as I like to
understand how things work and are
tied together. Also, because it's all
free...
I'm currently putting together a
virtual machine (so I can break stuff)
using:
Ubuntu
SQLite
No webserver, I plan on using whatever development server comes with Rails out of the box, initially
Redcar Editor
Edit 2
I have setup a couple of environments
now.
I have the ubuntu setup running in a
Virtual Machine on Windows and decided
to try decking my Mac out for ruby
development too.
Overall, I'd have to say setup for the
mac was a lot less painful than the
linux setup. On the mac I'm running
with:
SQLite that comes with OSX out of the box(!)
TextMate (trial version, but loving it)
Mongrel web server
I've progressed from learning the ways
of Ruby to writing some simple
websites with Rails and am finding
development with Rails really simple
to use. I have also set up a GIT
repository on my working directory and
am currently trying out Heroku.
Thanks for the help, everyone.
If anyone would like any more information about setting up on either environment, I'd be happy to provide more detail.
What OS do most Ruby developers use?
Mac OS for most, but any Linux distro will do (Ubuntu/Fedora etc).
What is the easiest IDE to get to grips with coming from a background of using Visual Studio?
Textmate is quite popular if you're on Mac. Netbeans and Aptana are there if you need something similar to enterprise world. Emacs/Vim is ok too.
Which database is used most within the Ruby community?
So far most Ruby / RoR guys I know use open source databases. sqlite for local development while Mysql or Postgresql for production. My advice, sqlite is easy to learn, while give a try with Mysql or Postgresql, you might not know when your clients going to ask you to develop on them. Mysql is very popular. Postgresql I think has lot more features (personal preference).
Which database is most likely to be supported by most web hosts?
Mysql is most supported by shared hosting hence the M in LAMP (Linux/Apache/Mysql/Php). But Postgresql is getting more support too. Some hosting companies even support both but Rails developers usually prefer to use VPS (slicehost.com/linode.com) and manage all these themselves. Checkout heroku.com too for deploying your Rails app without needing much knowledge in sys admin stuffs.
Which web server is the easiest to configure? To get up and running in the shortest amount of time.
Developing with Rails you'll get webrick as a development server where you can test ur app locally. But for production I prefer modrails.com where you can choose between apache/nginx. I prefer to use apache since that is what I'm used to.
You'll want to look at RVM from the start, this takes away a lot of the pain of managing Ruby versions and gems.
Judging from the laptops I saw at Railsconf last June, Rails developers are about 90% OSX, 9.9% Linux, and there's like 1 or 2 guys on Windows.
Personally I use Textmate when I'm at home on OSX and gedit and redcar when I'm at work on Ubuntu Linux. I use sqlite for development mainly with mysql in production, but mongodb seems to be the new hotness, but I haven't done much more than some sample apps with it so I can learn it.
Virtual hosting providers will probably give you a choice of whatever database you want. Heroku is awesome and is used for deploying Rails applications via git, and uses postgres but has plugins to use mongodb if you want to go that way.
For what the community at large is doing, check out Thoughbot's survey results at: http://robots.thoughtbot.com/post/308239139/2009-ruby-survey-results
You might have a look at the Bitnami installer, which claims to create a full Ruby/Rails stack. There's also a VM version, so in theory you could just grab their VM and start coding your app. (YMMV -- personally I haven't tried it).
OS
Most ruby developers seem to gravitate towards Macs for some reason, with a few linux and some windows devs. That said, I use windows for all my ruby work and haven't really run into any huge roadblocks. Your safest option will probably be a Mac, if you want to be on the same side as most of the community.
IDE
You don't really need a full-blown IDE for ruby, as you would for something like C#. Most mac users seem to use textmate. I personally use redcar. It's not fully completed yet, but it can be used on Windows, Linux or Mac, and I've yet to run into a feature I need that isn't provided. It is written in ruby, can be extended through plugins, and supports textmate themes and snippets. To supplement redcar, I've actually written a shell in ruby for my own use. It's still in alpha stage, but I've got features like grep and ls working, and capabilities for working with and manipulating files. You can extend it with ruby, and actually use any ruby command inside the shell. It's hosted here, and is currently for use on windows. After I get some more features in, I might start looking at Mac or Linux ports.
Database
Open source options like sqlite and mysql are used widely. I don't have enough experience on them to really comment on the differences. For what it's worth, Heroku (which is great for hosting) uses Postgresql.
Server
You should use a lightweight server like Thin for development, to test your app. For production, have a look at modrails.com (as a few other answers have suggested).
Good luck with whatever you choose.
OS
80-20 Mac-Linux. I've seen one Windows ruby dev so far. If you use and debian (ubuntu is a debian), take a look at rvm, because debian cripples rubygems.
IDE
You can code ruby without an IDE, grab an editor of your choice. We've got emacs, vim, textmate, gedit here. If you really want an IDE, get rubymine.
Depends on how good your shell-fu is ;-)
DB
sqlite >:)
Server
For development, rails server should do. For production, my recommendation is unicorn, paired with nginx.
Further stuff:
http://github.com/edgecase/ruby_koans
And go for rails 3 beta.
Tutorials
ruby-lang.org/en/documentation/quickstart
Ruby community
ruby-lang.org/en/community/
I think Linux(Fedora) would be best for you
For data base mysql is very popular
most prefered web server
http://www.modrails.com/
http://github.com/fauna/mongrel
Ruby mine is good IDE
http://www.jetbrains.com/ruby/

Ideal Rails Server

What is the ideal rails server? Lets assume its on a VPS, such as Linode. Lets assume that any of the sites won't become the next twitter, but they should scale well. It must also support multiple sites and all sites are rails 3. And the database must be on the same server (for now).
Should it use apache or nginx?
Ruby Enterprise Edition or just normal Ruby?
Ideal linux distro?
MySQL, PostgreSQL or something else?
How should the directories be laid out (where to put your rails sites or anything else)?
Deployment options?
Anything else?
Should it use apache or nginx?
Nginx seems to be the preferred route here, unless you need specific Apache features. If you're using Passenger, both Apache and Nginx are supported. More on Passenger here.
Ruby Enterprise Edition or just normal Ruby?
I'm pretty sure REE is only available for Ruby 1.8, which isn't really the preferred version for Rails 3 anymore. Rails 3 had some problems with 1.8, but they might have fixed them by now. Generally, though, Ruby 1.9.2 runs Rails 3 well.
Ideal linux distro?
This really doesn't matter. If you're not sure, Ubuntu is a good choice as there's a lot of knowledge out there, and it's pretty easy to use. Slicehost has a bunch of great articles on getting started with a VPS, and a lot of them focus specifically on Ubuntu: http://articles.slicehost.com/.
MySQL, PostgreSQL or something else?
This is definitely subjective. MySQL is definitely the most common out there, and if you're really unsure, it's a good starting point. However, people often argue that PostgreSQL is cleaner and easier to use that MySQL. If you're just starting, I would recommend MySQL just because of the amount of information out there already.
How should the directories be laid out (where to put your rails sites or anything else)?
You can put your rails project anywhere you like, so I like to just put it in my home directory. Just make sure that your web server has access to your static assets.
Deployment options?
Capistrano is popular. You just commit your changes and cap deploy, and you'll be up and running.
Anything else?
If this all seems overwhelming, look into a simpler solution like Heroku. They set everything up for you, and, while you loose some flexibility, you won't have to worry about any of this. Their pricing isn't too bad, and they offer a free option.
I think kyl summed it up pretty well. But I figured I would let you know exactly what I have been using since rails beta4 (and now with RC). This setup has worked well for me:
Rackspace Cloud servers - Gives you full control of the server. You can resize your servers on the fly. You can also take snapshot images if you want to duplicate your setup for another site. Its cheap and in my opinion better than Amazon cloud.
CentOS 5.4 - solid, but as kyl mentioned probably any distro will work fine.
Ruby 1.9.2RC 2 - no problems so far on Rails 3 for me. Will definitely use Ruby Enterprise when they port it to 1.9.2 (not sure if that is in the works, though??)
Nginx - fast and lightweight. I like it much better than apache. Works well in front of Passenger, mongrel and thin.
MySQL - just personal preference for this. I have been using it for years. It is easy to set up a master/slave or master/master config if you need to scale. Some people have success just using sqlite, but I prefer something a bit more robust.
Github - a must for me for source code control. Bundler works very well with github
Application Server - I am still debating what to do about this. I was happy with Passenger 2.2.15 until I saw how long it took to spawn new ruby processes to handle concurrency. It takes up to 30 seconds to spawn a new process for me and the app is locked, so no requests can go thru while it is spawning. I am investigating right now if it is my app or Rails 3 that takes so long to load. This problem is fixed with Passenger 3, though. Hopefully that will be released soon. As a result of this, I am probably going to use Thin or Mongrel until Passenger 3 comes out.
Capistrano - works great for Rails 3. I would recommend finding some cap recipes for versioning your app with git tags... or just write your own.
Anything else? Not really related to the server, but I would recommend using the new plugin API for any part of your app that is reusable. Read up on railties and engines. Its simple to create a gem with Jeweler and version it with github using jeweler rake tasks. Then you can deploy from a github tag or from master, by adding the gem and github source in your Gemfile and bundle install or update it. I recently ported all of my common app code (blog, authentication, etc..) to Rails 3 engines and it is working great. And any time I need to reuse that code, I just drop it in the new app's Gemfile.

Using rails or ASP.NET for website on Windows

I need to create a site that interact with some windows applications.
Currently this is done through direct calls so I would like these to run on the webserver.
This means that the site will have to run on a Windows based system.
I have been doing some ruby lately and am very keen on using rails for the site, but have at the same time seen plenty of discouraging posts regarding this.
Should I rather use ASP.NET (MVC) for a windows system or is rails stable enough to handle this?
Ruby on Rails on Windows is not ideal, but it does work, and works just fine for most purposes. The biggest issue you will likely run into is that the community of people running RoR on Windows is very small, so the issues you do run into which are specific to RoR+Windows may be harder to get help on.
If leveraging existing community is very important to you and/or your project, then I do recommend going with ASP.NET MVC. The community there is much larger and easier to connect with than RoR+Windows, which is fairly niche. Although it's difficult to put an objective value on the added benefit of having a community of support, it's clearly one of the biggest selling points for any platform - the RoR community in general, for example, is a huge part of its continuing success.
I would add to Rex's answer that RoR+Windows is fine for development, but i would not use that as a production setup. In my case i do a lot of work in Flash/Flex/Photoshop while working on the backend at the same time, and of course running those graphics heavy apps on Linux is not very ideal, but the server i deploy to is Linux which is the only part that really matters.

Resources