4

I am using ubuntu and as per instruction I use 'apt-get isntall cakephp-scripts'

I am using latest stable release of cake v 2.2.1, but when I run cake bake -app , I always get console for v1.3.2

Why do I get CakePHP v1.3.2 Console on cakephp v 2.2.1

tereško
  • 58,060
  • 25
  • 98
  • 150
Harshit
  • 1,207
  • 1
  • 20
  • 40

4 Answers4

6

As the others already pointed out, CakePHP from the repositories is v1.3.2 which doesn't work with your 2.1.

After uninstalling (sudo apt-get remove cakephp-scripts) it, do the following:

  1. Download CakePHP 2.1 and extract it somewhere globally available (e.g. /usr/share/php/cakephp/
  2. Check the permissions: /usr/share/cakephp/ and all subfolders should be readable for everyone and /usr/share/cakephp/app/Console/cake should be executable.
  3. Now link your executable from /usr/bin/:

    cd /usr/bin
    ln -s /usr/share/php/cakephp/app/Console/cake cake
    
  4. You should now be able to use the right version of the script everywhere from the console.

If you want to make the version of cake switchable comfortably, you should put the sources in a subfolder, i.e. /usr/share/php/cakephp/2.1/ and link there: ln -s 2.1 current. Now you can link from /usr/bin to your current directory: ln -s /usr/share/php/cakephp/current/app/Console/cake cake. If you ever want to switch versions, the only thing you have to do is to change, where current links to.

bfncs
  • 10,007
  • 4
  • 32
  • 52
  • 1
    I would recommend, if using Git, to clone the repo into this folder, as then if you want to change version you can just checkout a different tag. – David Yell May 30 '13 at 19:22
0

Check your PATH variable in Linux, it might be pointing to an old version of cake

elliot
  • 772
  • 1
  • 5
  • 14
  • whre do I set path variables .bashrc or .profile . when I run cake bake from /var/www/cake/lib/Cake/Console it gives me v1.3.2 console . – Harshit Aug 15 '12 at 12:52
0

Instead of running cake bake directly run it fromcakeDir/app by doing Console/cake bake. The thing is that install cakephp-scripts installs and old version of the cake scripts.

Hugo Dozois
  • 8,147
  • 12
  • 54
  • 58
0

Go to your terminal

1. sudo apt-get remove cakephp-scripts 
2.cd /var/www/html/yourproject/app/Console/
3.sh cake bake

I think you will be able to use cake bake console with your cakePHP same version.

Henrik Aasted Sørensen
  • 6,966
  • 11
  • 51
  • 60
Sarwar Sikder
  • 71
  • 1
  • 4