Posted by superuser
Thu, 15 Oct 2009 04:22:00 GMT
Την Πέμπτη 15 Οκτωβρίου 2009, και ώρα 16:00 – 18:00, στη Τεχνόπολη, Γκάζι στα πλαίσια των εκδηλώσεων του Athens Digital Week θα γίνουν οι ακόλουθες παρουσιάσεις από τα μέλη της ομάδας μας:
- A blink into the Rails magic [Nick]
- Ruby on Rails and Web on Python [john]
- Creating administrator pages in a breeze [Panos]
- From PHP to Ruby On Rails [jim]
Περισσότερες λεπτομέρειες στη λίστα ηλεκτρονικού ταχυδρομείου
Φυσικά μην ξεχάσετε τη δεύτερη εκδήλωση αύριο 16/10 στο ΤΕΙ ΠΕΙΡΑΙΑ
-
Posted in RubyOnRails, News, Ruby | Tags Παρουσίαση, ΤΕΙ_Πειραιά, Rails, Ruby, RubyOnRails | no comments
Posted by superuser
Sun, 29 Jun 2008 10:43:00 GMT
a Ruby On Rails app
In this article you can find how to install & create your blog with Typo (v. 4.1.1) easily in a few steps. The only requirement is that you have already installed on your machine Ruby, Ruby on rails and some required gems by typo (mongrel, mysql, mysql, rcov, rspec, xmpp4r, flexmock, hoe, ruby-debug and ruby-debug-base). My local gem reports the following packages (with version):
*** LOCAL GEMS ***
actionmailer (1.3.6)
actionpack (1.13.6)
actionwebservice (1.2.6)
activerecord (1.15.6)
activeresource (2.1.0)
activesupport (1.4.4)
cgi_multipart_eof_fix (2.5.0)
cmdparse (2.0.2)
columnize (0.1)
daemons (1.0.10)
ezcrypto (0.7)
fastercsv (1.2.3)
fastthread (1.0.1)
flexmock (0.8.2)
gem_plugin (0.2.3)
highline (1.4.0)
hoe (1.5.3)
linecache (0.43)
mime-types (1.15)
mini_magick (1.2.3)
mongrel (1.1.5)
mongrel_cluster (1.0.5)
mysql (2.7)
rails (1.2.6)
rake (0.8.1)
rcov (0.8.1.2.0)
rspec (1.1.4)
ruby-debug (0.10.1)
ruby-debug-base (0.10.1)
rubyforge (1.0.0)
rubygems-update (1.1.1)
sources (0.0.2)
xmpp4r (0.3.2)
As you can see i use rails v. 1.2.6 and this is main reason that i use the 4.1.1 version of Typo (the last Typo version is 5.0.3 and is fully documented on the
official site of Typo, but you'll need RoR 2.x version.
Let's start building our Typo-4.1.1 blog:
Download typo-4.1.1.tgz (use fetch or wget or via ftp)
$ fetch http://rubyforge.org/frs/download.php/20466/typo-4.1.1.tgz
Extract this in your rails work directory
$ cd my-rails-work-dir
$ tar -zxvf typo-4.1.1.tgz
If now you look in your rails work directory you'll see that typo-4.1.1
rails app directory is created. Before proceeding i suggest you to rename your blog in order to add later more blogs in the same rails work dir.
$ mv typo-4.1.1 MyWonderfulBlog
That's it. Now i'm ready to configure in a few step my new blog. All work
will be done inside MyWonderfulBlog directory.
Go in ~/MyWonderfulBlog/config/ and copy database.yml.example as
database.yml
$ cp database.yml.example database.yml
The app is already developed so you can choose to work directly in production environment. Truely, there is no need to select development, but if you do so, there is always an easy way to switch from development in production environment. If you prefer to work in development environment In the following description just replace prod with dev.
Let's check database.yml with our favorite editor. In production environment you'll only need to leave the production section. I'll change the database names - i'll use more than one blogs in the same system - so i don't want my databases to have the same name. I'll use a safe mysql username &
password as the following:
production:
adapter: mysql
encoding: utf8
database: wonderfulblog_prod
username: safesql
password: mysqlko9
socket: /tmp/mysql.sock
Note: I use freebsd (is a unix system) so maybe the socket /tmp/mysql.sock could be different in your case.
It's time to create my database
$ mysqladmin -u root -p create wonderfulblog_prod
Enter password: [enter your mysql root password here]
...and it's done.
Grant privileges at the db user: safesql for the production database wonderfulblog_prod
$ mysql -u root -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is xxx
Server version: 5.0.51a FreeBSD port: mysql-server-5.0.51a
Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
mysql> grant all privileges on wonderfulblog_prod.* to 'safesql'@'localhost'
identified by 'mysqlko9';
Query OK, 0 rows affected (0.09 sec)
mysql> flush privileges;
Query OK, 0 rows affected (0.05 sec)
mysql> \q
Bye
Populate your database with the typo app data. The right way to act
is with the magic "rake db:migrate" command, but with the version 4.1.1
this doesn't work. Use instead:
$ rake migrate RAILS_ENV='production'
(note: in development environment use simply "rake migrate")
Rake will extract all necessary items in your database.
That's all! Now Typo is ready to run! I use Mongrel to fire up my rails apps, because Mongrel it's easy to setup, run & control. Once Mongrel is set up with a single command i get in production my application (the typo in this case, but similarly works with any app). You have only to select a port (default 3000, i use 8921 in this example), use the flag -d (daemonized - runs in background) and specify the production environment (if you don't use the flag -e, Typo select development environment by default).
$ mongrel_rails start -d -p 8921 -e production
Open your browser and point to http://localhost:8921/admin . It's important to put a username & password in order to safe your blog.
After that you can access the administration interface ( http://localhost:8921/admin ), and view the results in http://localhost:8921 .
In the next article i'll see you how i manage the interface. Until then have a good time!
Posted in RubyOnRails | Tags 4.1.1, Blog, install, migrate, Rails, RAILS_ENV, rake, RoR, Ruby, TYPO | 2 comments