from Hacker News

Help with Rails?

by jrbeal on 7/14/13, 7:40 PM with 52 comments

This is my first post and I hope it's appropriate for the site. My son admires HN and recommended I ask for help here. I'm an "old" CS guy (graduated back in the 80's) and have NOT kept my skills up-to-date as my career led me from development to mostly sysad stuff. So for the last few years, I've had this web site idea and spent the last year designing it while trying to learn Ruby on Rails (using Mark Hartl's tutorial). Setting up a Linux VDI and getting the environment right is driving me crazy. It's always one problem after another. I'm normally a very persistant guy but Hartl's recommended problem solving algorithm (google it) doesn't always work. I'm at the point where I'll do anything just to get this project off the ground. Any ideas or suggestions? I'd pay someone to help me but I don't know where to find such a person.
  • by jrbeal on 7/14/13, 8:21 PM

    Wow! My son was right! This site is awesome! Thanks SO much everyone! Good question wintermute. I wanted a Linux development environment but only have Windows at home. I was thinking about buying another box just for this purpose and load native Linux thinking this would be less ghetto but I don't know...

    Thanks for the offer benigeri! I'll hit you up later...

    thinkful.com sounds like a great resource.

    shail: There were way too many problems to list here. Basically, the pattern I was falling into was as follows: I'd start a new project, start setting everything up, run into problems, fix them, run into more problems, fix them, etc... I'd have problems with everything from running bundle successfully, to deploying successfully. Then I'd get to the point where nothing would work and I'd eventually start over. Very frustrating.

    The suggestions here are giving me hope and renewed enthusiasm. I'll check back later...

  • by losvedir on 7/14/13, 9:19 PM

    Oh, boy. I've gotten our rails dev environment set up on a dozen different machines now and there's always a little problem here or there. One thing I can say right off the bat: I could never get it fully up and running on Windows, unfortunately.

    But we have had success on both OS X and Linux machines.

    The trick is to 1) install rbenv or rvm, 2) build the right version of ruby, 3) install the right gems, 4) make sure your PATH is set up properly.

    The rails consultancy thoughtbot has a script you can run to just magically set up a new laptop for rails development. I don't do this (too magical, and too little control), but I usually pull up the script[1] just to remind myself of what things I need to attend to and install.

    Feel free to hit me up at my email address in my profile if you're stumped on something. I've probably seen most issues by now...

    [1] https://raw.github.com/thoughtbot/laptop/master/linux

  • by charlesju on 7/14/13, 8:23 PM

    1. Use Heroku or Engine Yard 2. Start with a hello world and build from there one feature at a time 3. When you get stuck, use Stack Overflow or other Ruby on Rails forums for help as opposed to HN, we're not a terribly good source.

    Good luck :)

  • by chrismealy on 7/14/13, 9:00 PM

    Don't worry, it's like this for everybody. Just hang in there. Suddenly it'll all come together and you'll forget what was so hard about it.
  • by adamzerner on 7/14/13, 8:21 PM

    I started learning Rails this summer too! Chapter 1 (the set up) was very annoying, like he warns. StackOverflow is great though! People often answer your questions within minutes (if you word them well and put thought into them). That's the best advice I've got for chapter 1. It's something that is going to be annoying.

    I'd recommend going through his tutorial rather briefly first. Like a skim. Then read through http://guides.rubyonrails.org/. Then go through is tutorial one more time. Then try building your website, while using Railscasts and StackOverflow for help.

    See http://fast-reaches-9399.herokuapp.com/how-to-learn-to-progr... for more information. Good luck!

  • by awongh on 7/14/13, 9:39 PM

    you could try vagrant, not sure if its the VDI that you were referring to, but I would say that setup generally seems smoother inside of linux vs. other environments (so it's worth it to deal with the extra complexity of a vm)

    there are a bunch of github projects that you can get that has everything to setup a VDI- this one seems popular: https://github.com/amaia/rails-starter-box

    there's also a railscast about it: http://railscasts.com/episodes/292-virtual-machines-with-vag...

  • by cpursley on 7/14/13, 8:51 PM

    I highly recommend Action.io - a cloud-based linux development environment and IDE that I wish were around when I got started. I literally created a new box, cloned a rails app from github, raked the db and fired up rails server in less than three minutes.

    Really, check it out if you're having difficulty getting your environment set up. Here's a link to get started https://www.nitrous.io/join/BiSdgSxLjIk (full disclosure: it's a referral link that will get me No2 credits).

    And when you're ready to deploy, just use Heroku. Good luck and keep at it!

  • by dreyfiz on 7/14/13, 8:27 PM

    1. Get on IRC, people hang out there all day waiting to help people for free.

    2. Here's a volunteer hotline to call for help: http://rails.pockethotline.com/

  • by w1ntermute on 7/14/13, 8:07 PM

    Why do you need a Linux VDI? Test locally with the Rails server, then deploy to Heroku.
  • by benigeri on 7/14/13, 7:59 PM

    Hey jrbeal, I've had the same problems. I taught myself ROR over the past year and I had huge issues getting it off the ground. I've been through over 20 different sets of tutorials, so I'm sure I can help out.

    I also had a lot of initial difficulty setting up my environments, but I've gotten a lot better at it now.

    If you'd like, send me an email benigeri@stanford.edu and I can try to help you and point you to good resources. It's a little hard to suggest anything right now since I don't have any context.

    So send me an email and I'll try to help you as much as I can, pro-bono.

  • by gtani on 7/14/13, 9:10 PM

    Are there ruby or rails user groups/meetups around you? If not, there's a bunch of mentor groups, or reddit seems pretty supportive. Stackoverflow is pretty good but there aren't enought people answering questions for the volume they're getting

    http://www.railsmentors.org/

    https://github.com/rails-oceania/roro/wiki/Available-mentors

    http://www.reddit.com/r/rails/

    http://installfest.railsbridge.org/installfest/ (Railsbridge is a fantastic organization, if you emailed i bet they would help

    I've been going thru same thing, my MBP hard drive died, so i installed RVM, bundler, and rails 3.2 on a couple ubuntu 12.04 laptops while i'm waiting for my Snow leopard install DVD. The key insight is to write down every step if you have to back out. And read 2 or 3 blogs and see what they agree on before starting install. These are good for 12.04

    http://excid3.com/blog/setting-up-ubuntu-12-04-with-ruby-1-9...

    http://footyntech.wordpress.com/2012/09/19/installing-ruby-r...

  • by eccp on 7/14/13, 9:13 PM

    Coming from a Windows-only background you'll find it's probably a much smoother experience while developing on a Linux desktop or in Mac OS X.

    Installing a nice Ubuntu 13.04 desktop is not complex, there a video which explains installing Virtualbox and Ubuntu under ten minutes: http://www.youtube.com/watch?v=0WiiswmOH1Q ... note that a desktop is not required but given your background you would feel more comfortable having a desktop, graphical text editor (eg. gEdit or Sublime Text) and one or more terminals to run the commands.

    Another option would be to install Cygwin, an Unix-like environment for Windows: http://www.youtube.com/watch?v=WRB9t2tSsjY and continue the tutorial from there.

    Honestly, I think that if you have sysadmin skills, it's likely you'll have some Unix exposure, and if you don't have yet, learning Ubuntu and Linux will be a benefit on the long run.

  • by titlex on 7/14/13, 7:49 PM

  • by kot-behemoth on 7/15/13, 11:42 AM

    This thread turned out to be a great source of information right when I needed it! Thanks, everyone!

    However, I'm just starting to work on a webapp for a client (learning from scratch, this is my first big project in Rails), and I was wondering which version to start with. Since I'm starting with no pre-existing codebase, it's very tempting to go with Rails 4.0 as opposed to 3.2, but I'm afraid not all essential gems support it yet. Also, there probably isn't as much information for bugs and problems etc.

    Any advice would be greatly appreciated!

  • by benackles on 7/14/13, 7:57 PM

    Michael is very responsive to questions although you should first use his debugging tips. He'll usually fix your problem with one line of code.

    http://ruby.railstutorial.org/help

    If you don't find your answer from either the debugging tips or a Google search, try writing your question on StackOverflow. Most of the issues you face are probably solvable by knowing what line of your error to search for.

  • by tjbiddle on 7/14/13, 10:16 PM

    I've always found it's a lot easier if you learn the language (And others' habits & conventions) before picking up the framework. Rails will come a lot easier after you're familiar with Ruby and getting the correct environment setup (RVM/RBEnv, Familiarity with popular libraries, etc)

    Best of luck!

  • by rfelix2121 on 7/14/13, 9:24 PM

    Maybe I can help! http://askabootstrapper.com
  • by gverri on 7/14/13, 8:11 PM

    My tip: DON'T USE RVM. (rbenv is a good alternative)

    RVM is the nÂș1 source of problem in Ruby envs.

  • by zengr on 7/14/13, 7:57 PM

    I stumbled across thinkful recently: http://www.thinkful.com and I think having a mentor while learning to code (especially web dev) is really helpful.

    PS: I have not used thinkful before.

  • by mcx on 7/14/13, 9:19 PM

    I follow this guide to set up rvm, ruby, and rails: http://ryanbigg.com/2010/12/ubuntu-ruby-rvm-rails-and-you/
  • by shail on 7/14/13, 7:52 PM

    Could you describe the problems you are facing in more detail?

    I guess you would not have to pay to get directions. One-on-one help might need payment.

  • by groundCode on 7/14/13, 7:56 PM

    Maybe stackoverflow or serverfault could help if you are having specific issues with the code or the server setup?
  • by gary4gar on 7/14/13, 8:26 PM

    Hey, I would love to help. no need of payment, just a thank you is enough. Contact me, email in profile
  • by troels on 7/14/13, 9:06 PM

    I love Rails, but I think it might be better for you to go with a PHP framework. PHP is just dead simple to get running and deploy. I would suggest something like Yii or Codeigniter, both of which are somewhat similar to Rails in their architecture.
  • by heldrida on 7/14/13, 8:21 PM

    jrbeal, you can try Laravel, it's a Php Framework and you can setup everything in a couple of minutes and probably develop your idea without having to deal with all those issues.
  • by woah on 7/14/13, 9:19 PM

    Use node.js! It's as easy as npm install, npm start. Few other steps for the mongodb as well. None of this weird rvm crap. 90% of the time we're just putting text on the screen in various arrangements. Doesn't need to be rocket science.