Getting rails console on an amazon aws server when using rvm


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


  • 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):

Spree loading countries in production

You have installed Spree in a production server but haven’t populated the database with the default seed data, and you want to add the countries (or any other seed data) that come as default in spree in the vendor/spree/db/default_countries.yml file.

On your production server, after logging in with ssh and going to the application directory run the following rake task:

rake db:load_file[vendor/spree/db/default/countries.yml] RAILS_ENV=production

Running script/runner in production environment

Following from a previous post about email scheduling with runner and cron, it turns out that the runner default behaviour is to run in the development environment.

Although by reading the help for the script/runner, there is a suggestion to run it with the -e production added to the end, it doesn’t seem to be working.

The solution to make it running in the production environment was to delete the first line (shebang) from step 3 on this post

and then use the following in the cron setup:

Have a look on paragraph Alternative Usage here

cap deploy_with_migrations default behaviour

When using cap deploy_with_migrations, the default behaviour is to deploy with the migrations in the production environment.

To change this behavior add:

in your config/deploy.rb