Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialJohn Weland
42,478 PointsRails and Node.js on the Raspberry Pi
I've been doing some research on installing Rails and / or Node.js on my Raspberry Pi. A lot of jobs are contacting me but require Node.js, Backbone.js, Angular.js, and Ember.js so I thought I'd get to learning those.
Rails looks fun an a lot of cool odds and ends I want to install and get more proficient with are often rails gems. I am confused though as most of the guides I find act as it Rails and Node are independent of a web server. So I wouldn't need Apache or lighttpd or Cherokee installed. Do they run along side web server software, or require web server software, or maybe they are web server software in their own rights?
If anyone can help clear this up for me that'd be great.
5 Answers
Andrew Kiernan
26,892 PointsHey John:
I am by no means an expert, so take what I say with a fair bit of salt.
Node.js does not need separate webserver software to run. When you build a back-end in node you build out the server, such as setting up which port to listen to, routing, etc. A quick Google shows there are apparently ways to integrate it into apache and such, but it adds an unnecessary complication.
Rails only works on its own because it comes bundled with the WEBrick webserver software (this is what starts up when you "rails s" in your terminal). However, from what I have read you do not want to rely on WEBrick for a production ready app. So for rails you need an apache, lighttpd, etc. There are other tools/frameworks to make this easier. I believe Unicorn and Passenger are two such tools.
So to sum up, if you want to just mess around with either on your rPi, you don't need extra webserver tech. But if you wanted to push a rails app live, you would want a different webserver (or use heroku, etc )
I hope that helps, and please anyone correct me if I got any of that wrong!
-Andrew
John Weland
42,478 PointsThanks that does help out a little. I wonder which would be least system intensive. Running a web server, Node.js and Rails separately on the same Pi or tie then all together so they use the same web server maybe just different ports... ? My end goal is two fold. One learn Rails and Node as well are the other JavaScript listen in my first post. But also build various home use things like a web enabled shopping list (make a list go to the store buy the stuff and check it off the list from a phone), set bill reminders and appointments etc. I know there are already apps out there for this sort of thing but I'm a maker. It's good practice and its fun.
John
Andrew Kiernan
26,892 PointsHey John:
Those all sound like great ideas for projects! I'm actually working on some similar stuff. If you want to bounce ideas or maybe work together on them sometime, give me a shout!
If your goal is to get those up and running I believe you can run them both on the Pi. For your goals I imagine you would be fine with WEBrick running your rails project. Just set up your rails and node projects to listen to different ports and you should be good to go!
-Andrew
John Weland
42,478 PointsOver all I think I would like to make a whole home solution a collection of tiny 'apps' to do/monitor/report various things around the house. My wife an I currently use mint.com to track all of our finances but I think it could be made better maybe I'll go as far as to try to make my own in house version. Collaboration sound great man.
I wish tree house had a built in messenger like hangouts
Andrew Kiernan
26,892 PointsYeah a messenger would be a good feature. Maybe we can build one and sell it to them?! :P
I think I put my email in my profile, but its apkiernan@gmail.com if you want to get in touch!