Skip to content
Advertisement

How to run python script inside rails application in heroku?

I have a rails application hosted in heroku. I also wrote a web scraper using scrapy in python. I need to run the python script from the rails application in heroku,I will explain with an example.

Eg:The user will input the url to scrape in my rails app.Then the rails app give control to python script to scrape data which sends response as json object.Then we have to render the json result in the web app.I have to host this application in heroku.

Advertisement

Answer

There is a great gem called rubypython. It embeds a running Python interpreter in the Ruby application.

FYI their homepage

User contributions licensed under: CC BY-SA
9 People found this is helpful
Advertisement