Just wanted to give symfony a try and ran into some issues to set it up the way I wanted. Therefore I’d like to note the required steps.
First, install symfony via PEAR.
pear channel-discover pear.symfony-project.com
pear install symfony/symfony-1.2.4
This sould install symfony and make the symfony executable available in your PATH.
~$ symfony -V
symfony version 1.2.4 (/usr/share/php/symfony)
Create a directory for your vhost and create a new project.
mkdir /var/www/myproject
cd /var/www/myproject
symfony generate:project myproject
Create an example application in your project.
symfony generate:app frontend
Link the symfony resources to the project’s document root.
cd web
ln -s /usr/share/php/data/symfony/web/sf/
This should get you up and running with symfony. You just need to configure your server for the vhost. For personal preference, I’d like to have my document root directory named public instead of web. The following steps are needed to achive this.
Rename the document root directory.
mv web public
Add this line to config/ProjectConfiguration.class.php:
public function setup()
{
$this->setWebDir($this->getRootDir() . '/public');
// for compatibility / remove and enable only the plugins you want
$this->enableAllPluginsExcept(array('sfDoctrinePlugin', 'sfCompat10Plugin')$
}
Ich wollte soeben auf meinem frisch installierten Ubuntu 8.04 folgendermaßen Ruby On Rails installieren, um mal wieder zu versuchen, mich darin einzuarbeiten ;-)
maff@mafftop:~$ sudo apt-get install ruby rubygems irb ri rdoc
> ruby1.8-dev build-essential
maff@mafftop:~$ sudo gem install rails --include-dependencies
Die Installation der Pakete über apt verlief gewohnt problemlos, aber gems erwartete mich mit einer netten Fehlermeldung:
maff@mafftop:~$ sudo gem install rails --include-dependencies
Bulk updating Gem source index for: http://gems.rubyforge.org
ERROR: While executing gem ... (Gem::GemNotFoundException)
Could not find rails (> 0) in any repository
Hmm, komisch. Gerade Rails wird nicht gefunden? Das kanns doch fast nicht sein. Also hab ich ein bisschen gesucht und einen Post gefunden, der das Problem beheben soll. Also hab ich mal schön Schritt für Schritt alles nachgemacht :-) Durch ein gem env wird das Installationsverzeichnis von gems ausgespuckt, in dem der cache-Pfad gelöscht werden soll:
maff@mafftop:~$ sudo gem env
RubyGems Environment:
- VERSION: 0.9.4 (0.9.4)
- INSTALLATION DIRECTORY: /var/lib/gems/1.8
- GEM PATH:
- /var/lib/gems/1.8
- REMOTE SOURCES:
- http://gems.rubyforge.org
maff@mafftop:~$ sudo rm -f /var/lib/gems/1.8/source_cache
Ok, und nun? Ein erneuter Versuch, rails zu installieren scheiterte mit der selben Fehlermeldung. Also hab ichs mit einem Update von gems versucht:
maff@mafftop:~$ sudo gem update
Updating installed gems...
Bulk updating Gem source index for: http://gems.rubyforge.org
Gems: [] updated
Et voilà:
maff@mafftop:~$ sudo gem install rails --include-dependencies
INFO: `gem install -y` is now default and will be removed
INFO: use --ignore-dependencies to install only the gems you list
Bulk updating Gem source index for: http://gems.rubyforge.org
Successfully installed rake-0.8.1
Successfully installed activesupport-2.0.2
Successfully installed activerecord-2.0.2
Successfully installed actionpack-2.0.2
Successfully installed actionmailer-2.0.2
Successfully installed activeresource-2.0.2
Successfully installed rails-2.0.2
7 gems installed
Installing ri documentation for rake-0.8.1...
Installing ri documentation for activesupport-2.0.2...
Installing ri documentation for activerecord-2.0.2...
Installing ri documentation for actionpack-2.0.2...
Installing ri documentation for actionmailer-2.0.2...
Installing ri documentation for activeresource-2.0.2...
Installing RDoc documentation for rake-0.8.1...
Installing RDoc documentation for activesupport-2.0.2...
Installing RDoc documentation for activerecord-2.0.2...
Installing RDoc documentation for actionpack-2.0.2...
Installing RDoc documentation for actionmailer-2.0.2...
Installing RDoc documentation for activeresource-2.0.2...
Jetzt gehts ans Doku und Tutorials lesen ;-)