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

Spree loading countries in production

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

Problem
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.

Solution
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

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

Problem
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.

Solution
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