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 10 years ago.
I'm new to Ruby on Rails, and I just finished following the getting started guide at http://guides.rubyonrails.org/getting_started.html. In the guide I ran the development server on http://localhost:3000. Now I just moved the project folder to the directory of my website, but I cannot access the pages of the project by entering a URL. What steps do I need to do?
You will need to host your Rails application on a server that has Rails installed. Then you will need to make sure that you start whatever web server you are running on that web server so that it can start accepting requests.
If you haven't already done it, I would suggest that you find a Rails-friendly web host that will handle the server configuration for you.
Suppose your web server is Apache 2, you can use Phusion Passenger.
See, Rails comes with its own little web server called Webrick, that isn't really suitable for production for various reasons. So when you run rails server you start that server.
You need to tell your server (e.g. Apache 2) what pages to process via your application, and how. And Passenger makes that very easy.
The best guide to rails deployment is covered in chapter one of the rails tutorial book. It covers, source code version control as well as setting up the environment for deployment. Here is the link to chapter one: http://ruby.railstutorial.org/ruby-on-rails-tutorial-book#top
Hope this helps.
Related
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.
Im a beginner in Ruby on Rails and i asked me on which servers i can deploy the framework!
I heard a lot about Heroku, but they was asking me if i can start a ruby on rails application with a database of 4000-10000 entries (i mean little traffic!) on a local server for example from the german company protonet here is the link:
http://protonet.info
Or on an simple windows,linux server? With an Xeon Processor?
Or can somebody suggest a solution for a local server without binding to the internet? the website itself only needs to be visible in the local network!
I thank you a lot!
Yes, you can deploy locally. First thing you'll want to try is 'rails s -p 3000'. Bingo. You now have a fully functional rails server working on your local network. Try accessing it with your ip address and the port. You can deploy on both Windows and Linux, but based on my own experience, you'll prefer Linux (faster and easier).
Windows, with Thin server as a service : http://www.dixis.com/?p=140
Linux : Ideal Rails Server
In general any Unix(y) or Windows server (not recommended) should do it. Most shared hosting companies don't suport ruby so a VPS might be in order for public internet. I deploy always on Ubuntu and just moved to digitalocean.com ($5 / month for a basic VPS) - not endorsing as just moved last week. For internal, I'd suggest a Unix server and possibly rvm for having dedicated ruby install for app.
Heroku / Engine Yard also options.
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 wanted to know which is the best web server to use with heroku running ruby 2.0.
I'm currently running puma but cannot take full advantage of it without rubinius or jruby. I don't want to change my interpreter from ruby 2.0 native.
My goal is to have a web server that scales efficiently as I scale up my heroku dynos.. Thus, helping me serve as many concurrent users as possible.
The first part of the decision is if your application is considered thread safe.
Out of the box Rails < 4.0 is not! If you want it to work on multiple requests at the same time, you need a server that is capable of forking. Most prominent example: Unicorn. Heroku suggests that for Rails apps.
However, if your app is not limiting itself to one thread:
I suggest to use puma. It does support multiple threads on a single dyno. Even with MRI.
As said on pumas official website it uses significantly less memory than unicorn.
I honestly don't know what you mean by "cannot take full advantage". The only problem you might run into is, independent of the platform it runs on, that your application is thread safe.
My goal is to have a web server that scales efficiently as I scale up my heroku dynos.. Thus, helping me serve as many concurrent users as possible.
Once you spin up multiple dynos, the webservers will be started on each dyno independent of each other. I don't see any special needs for this scenario.
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'm working on a Ruby on Rails project that acquires and displays information on how undervalued stock mutual funds and ETFs are (by price/book ratio, price/cash flow ratio, etc.). My source code is at https://github.com/jhsu802701/bargainstockfunds-scrape .
At the moment, my focus is mainly on the Ruby side. I am new to the world of Ruby on Rails development, and I'm heeding the advice to learn Ruby first.
I need to use a database to store data acquired by my Ruby script. I know that there are several options (MySQL, NoSQL, PostGres, etc.), but I have no prior experience with databases. What do you recommend using and why? (Best support? Best performance? Easier to work with? Other reasons?)
SQLite is very convenient during development in Rails. It is small, file-based, and portable.
As a bit of a "perfectionist" I tend to spend a whole lot of time in development, on my local machine.
I, too, have far more experience with MySQL and use it for my production database on Rails projects. Remember that you can configure a different db for each Rails environment ("development", "production", "test").
Rails migrations make it really easy to build up a new database once you switch from development to production.
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 10 years ago.
I used to use the Webrick server for Ruby on Rails, but now my boss asked me to run the ROR code on apache server, I see there are some difference between these two servers, and I don't know how to access the controller/action on apache, so anyone happens to know any book about ROR on apahce? Thx!
To run directly in Apache, your best bet is to use Phusion Passenger, which can act as an Apache module.
However, I think you're missing a bit of conceptual information as well. Here's some of the common Rack servers used to host rails:
WEBrick: A web server implemented purely in Ruby (that ships with Ruby). It is not very performant, and is relatively limited. It makes for a great development webserver, but most people don't use it in production.
Thin: A very performant evented web server that is particularly easy to get up and running.
Unicorn: A forking web server that is widely used and recommended (written by GitHub) - but requires a bit more management to get up and running in production.
In nearly all cases, however, people generally have Nginx or Apache in front of their Rails webserver of choice (as a proxy):
Nginx/Apache do a much better job of serving static files than any of the options above. If you are not using a CDN to host your assets, you should definitely configure the proxy to host them.
Nginx/Apache are great at managing large volumes of requests and queueing them so that your app server can focus on in-flight requests rather than a deluge of queued-up requests.
Less surface area for security vulnerabilities.
My configuration of choice is Nginx+Unicorn; I find Apache too unwieldy to administrate, and Unicorn is particularly great.
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 10 years ago.
I have small rails application with mysql2 database (2 tables), backbone and bootstrap. I think, that that amount of visits will be max 50ppl per week, so I want to find cheap (~10 $/m or cheŠ°per) hosting for it. I found dreamhost, is it good or not? What else you can suggest to me?
I usually run all my small rails apps off heroku.com if your app is under 100meg(images you put on amazon s3 wich is also free if you use the free tier). Heroku has very easy deployment aswell :D Hope this helps.
here is a how to for heroku
https://devcenter.heroku.com/articles/rails3
here is how to for amazon s3 (to store your images or whatever you like to store there)
http://doganberktas.com/2010/09/14/amazon-s3-and-paperclip-rails-3/
Alternatives to heroku
EngineYard - http://www.engineyard.com/products/cloud
Openshift - https://openshift.redhat.com/app/
Amazon - Tutorial On Deploying Rails Apps to the Amazon Cloud?
http://www.heroku.com/ - 0$/m for small projects.
I have two projects on heroku for more then one year. Not one of them has not yet become a hightloaded. And I paid 0$ for all time.
I've used Linode (linode.com) for many years with hardly any problems. Their cheapest plans do start at $19.9 though.
Check out Heroku and Amazon Web Services.