Getting rails console on an amazon aws server when using rvm

Email this to someoneShare on Google+Share on FacebookTweet about this on TwitterShare on LinkedIn

Problem

You would like to get access to your rails application console on an Amazon ec2 instance, and you are also using rvm.

Solution

  • Login with ssh to your server as normal:
  • Go to your application’s current folder:
  • Run the following replacing the environment with your specific environment (ie production,beta,staging etc):

Error in staging environment with tr8n and will_filter

Email this to someoneShare on Google+Share on FacebookTweet about this on TwitterShare on LinkedIn

Problem
You are using the tr8n translation engine, which works fine in your local development environment, and you want to use it in an environment called ‘staging’, but after deployment you get the following error in your log files;

Solution

The default configuration file for will_filter includes an environment called ‘stage’ and not ‘staging’.
So you can add the following into the config/will_filter/config.yml file in your application (just afer the stage: line):

Rails Passenger Staging environment problem in Dreamhost

Email this to someoneShare on Google+Share on FacebookTweet about this on TwitterShare on LinkedIn

Problem
You want to deploy your rails application using Passenger in Dreamhost, but on a staging environment. It doesn’t work just changing your Capistrano recipe or your environment files, as the default environment for passenger is ‘production’.

Solution
Looking at the Passenger documentation here, there are four different ways of achieving that by changing the RailsEnv option. If you don’t want to change the Apache configuration files, and as long as the option AllowOverride is on (which should be on Dreamhost), then you would need to create an .htaccess file in your application’s public folder with the following:

RailsEnv staging