This guide shows you how to configure a Rails 4 app with AWS’s elastic beanstalk and RDS. First, install the elastic beanstalk command line tool on your local development box: $ sudo apt-get install git $ sudo apt-get install python-dev $ curl "https://bootstrap.pypa.io/get-pip.py" -o "get-pip.py" $ sudo python get-pip.py $ sudo pip install awsebcli   Next, initialize a GIT repository for your project if you haven’t already: $ git init [...]
Read More
In Ruby/Rails, if you’re running into the following error: Net::HTTPBadResponse: wrong status line When attempting to post data to a secure (https) url, with something similar to: Net::HTTP::post_form("https://www.example.com",{})   Then you can rewrite your request to avoid the exception like this: url = URI.parse("https://www.example.com") http = Net::HTTP.new(url.host,url.port) http.use_ssl = true request = Net::HTTP::Post.new(url.path,{}) request = http.request(request)   After which, you can access the request response in the same way as [...]
Read More
To run a rake task within a shell script using a cron job, do the following: First, specify the shell at the top of your .sh script #!/bin/sh   Then, change your directory to your rails application in your .sh script cd /home/user/app/current   Now, you need to manually define your PATH within the script: PATH=/your/paths:/etc/etc   To see your user’s PATH, do the following in your terminal: echo $PATH [...]
Read More