Updating Phoenix from 0.3.1 to 0.4.0

Problem

You would like to upgrade to the latest version of Phoenix 0.4.0 from the previous version of 0.3.1. When you try to update the dependencies and try to start phoenix again (mix phoenix.start) you get the following error:

Solution

After upgrading your Elixir version to the latest (1.0.0-rc1), and updating the path to your elixir installation so that it uses the new one, clear the dependencies from your project:

Change the dependency in your mix.exs file to be as the following:

and then get the dependencies again with:

after that you should be able to start your phoenix project with tne new version.

Upgrading jquery-ui-rails from 4.2.1 to 0.5.0

Problem

You would like to upgrade your jquery-ui-rails gem from a version before 0.5.x to the latest version 0.5.0, but when you do that your tests are failing with error messages similar to the one below:

Solution

According to the changelog the naming between 4.2.1 and 0.5.0 has changed jquery-ui-rails

So if you were using something like the following in your app/assets/javascripts/applications.js file (as used in the depot example in the Agile Web Development with Rails 4 book):

you would need to change it to the following after upgrading your jquery-ui-rails gem to ~> 0.5.0:

Upgrading Ruby on Rails application from 1.2.3 to 2.0.2

Problem
Upgrading an existing Ruby on Rails application from 1.2.3, to 2.0.2, presents few problems. I will try and keep a record of the ones I encounter along the way, here.

Solution

  1. Change the config/environment.rb to let the application know to use the 2.0.2 gem rail version,
  2. change the following line from:

    to:

  3. Run the following to generate the secret key for the application:
  4. Copy the magic key in a new section in your config/environment.rb as in: