Diese Anleitung setzt eine voll funktionsfähige Installation von CMS Fiona voraus. Bitte beachten Sie die Installationsvorraussetzungen.
$ rails new meinProject --skip-bundle
$ cd meinProject
Gemfile
hinzu:
gem 'mysql2' gem 'infopark_rails_connector', '~> x.y.z' gem 'infopark_fiona_connector', '~> x.y.z'
$ bundle install
license.xml
in das Verzeichnis config
.
# Der voreingestellte Instanzname lautet "default". $ cd FIONA/instance/Instanzname $ ./bin/CM -railsify
$ mysql -u root -p Enter password: Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 18 Server version: 5.0.41-community MySQL Community Edition (GPL) Type 'help;' or '\h' for help. Type '\c' to clear the buffer. mysql> grant read on fiona_cm.* to fiona_cm_ro@localhost identified by 'fiona_cm_ro';
development
, production
, preview
und test
) eine solche Datenbank.
$ mysql -u root -p Enter password: Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 18 Server version: 5.0.41-community MySQL Community Edition (GPL) Type 'help;' or '\h' for help. Type '\c' to clear the buffer. mysql> create database meinProject_development; Query OK, 1 row affected (0.00 sec) mysql> grant all on meinProject_development.* to fiona@localhost identified by 'fiona'; Query OK, 1 row affected (0.00 sec) mysql> create database meinProject_production; Query OK, 1 row affected (0.00 sec) mysql> grant all on meinProject_production.* to fiona@localhost identified by 'fiona'; Query OK, 1 row affected (0.00 sec) mysql> create database meinProject_preview; Query OK, 1 row affected (0.00 sec) mysql> grant all on meinProject_preview.* to fiona@localhost identified by 'fiona'; Query OK, 1 row affected (0.00 sec) mysql> create database meinProject_test; Query OK, 1 row affected (0.00 sec) mysql> grant all on meinProject_test.* to fiona@localhost identified by 'fiona'; Query OK, 1 row affected (0.00 sec) mysql> exit Bye
cms
)development
, production
, preview
oder test
)database.yml
, befindet sich im Verzeichnis config
. Passen Sie die Konfigurationen darin an Ihr Datenbank-Setup an.
cms: adapter: mysql2 database: fiona_cm username: fiona_cm_ro password: fiona_cm_ro encoding: utf8 host: IHR_CMS_DATENBANK_SERVER development: adapter: mysql2 database: meinProject_development username: fiona password: fiona encoding: utf8 host: IHR_RAILS_DATENBANK_SERVER test: adapter: mysql2 database: meinProject_test username: fiona password: fiona encoding: utf8 host: IHR_RAILS_DATENBANK_SERVER production: adapter: mysql2 database: meinProject_production username: fiona password: fiona encoding: utf8 host: IHR_RAILS_DATENBANK_SERVER preview: adapter: mysql2 database: meinProject_preview username: fiona password: fiona encoding: utf8 host: IHR_RAILS_DATENBANK_SERVER
$ cd meinProject $ rails generate rails_connector:install create config/initializers/rails_connector.rb create app/models/obj.rb create config/local/configuration.rb append app/assets/javascripts/application.js gsub app/assets/stylesheets/application.css remove public/index.html remove app/assets/images/rails.png gsub app/views/layouts/application.html.erb gsub app/views/layouts/application.html.erb
generate
-Kommando erstellt die erforderlichen zusätzlichen Dateien, die der Rails Connector benötigt oder bereitstellt.
default
-Instanz verwenden, muss der Instanzname explizit in der Datei config/initializer/rails_connector.rb
angegeben werden:
RailsConnector::Configuration.instance_name = "Instanzname"
$ cp config/enviornments/production.rb config/environments/preview.rb
RailsConnector::Configuration.mode = "editor"
development
-Umgebung:
$ rails s => Booting WEBrick => Rails 3.2.19 application starting in development on http://0.0.0.0:3000 Call with -d to detach => Ctrl-C to shutdown server
http://localhost:3000/
aufrufen.