I’ve found the easiest way to manage the config/database.yml file in a Rails + Capistrano configuration is to add the following line to your capistrano config/deploy.rb configuration file: set :linked_files, %w{config/database.yml} Then add config/database.yml to your .gitignore file. After which, add your environment’s database.yml file to the appropriate location on the remote server(s): #{deploy_to}/appname/shared/config/database.yml Where deploy_to is the deploy_to capistrano configuration setting. This way the configuration parameters are not stored [...]
Read More
If you’re running into the following error attempting to deploy via Capistrano with rbenv, foreman, and upstart: -su: bundle: command not found Then, be sure to take the export and eval rbenv statements in your ~/.bashrc file and copy them to the bottom of your ~/.profile export PATH="$HOME/.rbenv/bin:$PATH" eval "$(rbenv init -)"   As this path will not be available to the user to run the necessary commands otherwise.
Read More
If you’re running into this error when attempting to install twitter-bootstrap-rails on Rails 4.2.x: undefined method `register_preprocessor’ Note that there is currently a bug between less-rails and the 3.x version of sprockets-rails. To resolve this issue, update your gemfile with: gem 'sprockets-rails', '
Read More
If you’re installing twitter-bootstrap-rails 3.x on Rails 4.x.x and running into the following error: ‘twitter/bootstrap/bootstrap.less’ wasn’t found First, remember that Rails 4.x has removed the :asset group from the Gemfile syntax, so if you’re using the group :assets, you can simply remove the gems from the assets group and it should work. In my case, I initially loaded a new rails application with 4.0.x, then upgraded to 4.2.5, without also [...]
Read More
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
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