Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!


Can someone help me figure out how to run this ruby thingummy?
New on LowEndTalk? Please Register and read our Community Rules.

All new Registrations are manually reviewed and approved, so a short delay after registration may occur before your account becomes active.

Can someone help me figure out how to run this ruby thingummy?

DroidzoneDroidzone Member
edited May 2014 in Help

I've got reasonable command over perl, bash and couple of other stuff. But when it comes to ruby, I have absolutely no idea how to differentiate a snake from a rope.

I created a neat little site (not spamming the link here) to get Indian railway PNR enquiry (a passenger booking status) page, based on an API, and now that API seems to have gone to dust. I'd like to use an alternate API, and found one here, based on ruby-https://github.com/alagu/pnrapi-ruby

Can anyone tell me what to do to install it on a server? The only experience I have with ruby is setting up gitlab, and that was rather heavily documented. How hard is it to include a README? Sigh..

Comments

  • Looks like it uses unicorn to deploy RoR (Ruby On Rails).

    Thanked by 1linuxthefish
  • @0xdragon said:
    Looks like it uses unicorn to deploy RoR (Ruby On Rails).

    Ok. I can install nginx, ruby and unicorn. What next?

  • @joelgm said:
    Ok. I can install nginx, ruby and unicorn. What next?

    Nope, not quite! If there is no load balancing involved etc then:

    Unicorn is an HTTP server for Ruby, similar to Mongrel or Thin. It uses Mongrel’s Ragel HTTP parser but has a dramatically different architecture and philosophy.

    Just install rvm, RoR and the gem unicorn and you should be good to run the start.sh bash script.

  • To run it once (or occasionally), you can use Rails built in web server (web brick?) by cd'ing into it and typing rails s. If you don't have rails, you'll need to do gem install rails. For something more permanent, see this tutorial for installing Mongrel or Thin and back-proxying to nginx.

  • Me and @0xdragon are silly, this doesn't use Rails. It uses Sinatra. See this instead.

  • @AThomasHowe said:
    Me and 0xdragon are silly, this doesn't use Rails. It uses Sinatra. See this instead.

    That's what I get for not looking at both the directory structure and anything else but the start.sh file.. ;)

  • 0xdragon said: That's what I get for not looking at both the directory structure and anything else but the start.sh file.. ;)

    The description does say

    PNR API, Ruby version. With Sinatra and Mongodb.

    It's easy to forget Sinatra exists though lol.

  • @joelgm said:
    I've got reasonable command over perl, bash and couple of other stuff. But when it comes to ruby, I have absolutely no idea how to differentiate a snake from a rope.

    I created a neat little site (not spamming the link here) to get Indian railway PNR enquiry (a passenger booking status) page, based on an API, and now that API seems to have gone to dust. I'd like to use an alternate API, and found one here, based on ruby-https://github.com/alagu/pnrapi-ruby

    Can anyone tell me what to do to install it on a server? The only experience I have with ruby is setting up gitlab, and that was rather heavily documented. How hard is it to include a README? Sigh..

    The clue would be the included start.sh.

    This uses bundler to hold all the required gems.

    Simply clone (or download) the repository and then cd to it.

    From there run gem install bundler this will install bundler to then install the required gems (packages).

    Then in the directory run bundle install and then bash start.sh.

    The app will then be accessible on ::3001

    Thanked by 2jebber Droidzone
  • @definedcode Thanks for explaining as you would to a newb! I needed that.

    Thanks AThomasHowe, 0xdragon for helping out! Now to check if this thing actually works!

Sign In or Register to comment.