Feb18

Kebetulan sy disuruh boss, apgred Rails di situs statis punyanya dia dari Rails 1.2.3 ke Rails 2.0.2, nah karena isinya statis, jadi tidak perlu membutuhkan database, kalau di Rails 1.2.3 mongrel dsbnya bisa jalan dengan mulus dan tak akan terjadi error, namun di Rails 2.0 lain ceritanya dan bakal muncul error seperti ini

Status: 500 Internal Server Error
A secret is required to generate an integrity hash for cookie session data. Use config.action_controller.session = { :session_key => “_myapp_session”, :secret => “some secret phrase of at least 30 characters” } in config/environment.rb

solusinya, JELAS, tinggal tambahkan kode sbg berikut di environtment.rb

config.action_controller.session = { :session_key => “_dodol_id”,:secret=>”330e7468578f97507d80a4f1ed4c2e1d” }

oiya, tentu saja sebelumnya ngeunfreeze rails yang lama

rake rails:unfreeze

lalu install rails baru

sudo yum install sudo gem install rails

dan freeze rails baru tsb

rake rails:freeze:gems

okay, balik lagi ke yg tadi, nah ternyata ini masih error, setelah browsing dan tanya2, akhirnya dapat solusinya, ternyata Active Record-nya mesti dinonaktifkan

config.frameworks -= [ :active_record ]

selesai sudah (iya beneran selesai, SUMPAH * :p )………. silahkan ruby script/server dan aplikasi tersebut akan nyala seperti sedia kala

*note : karena sy gak pake unit test, jd ya begitulah hanya selesai sampe di situ, abis males bikin test secara situsnya skalanya kecil

jika anda kebetulan memakai test, silahkan baca di sini http://maas-frensch.com/peter/2007/12/04/using-rails-without-a-database/

oiya oom Arie juga merekomendasikan bahwa tips ini ada di buku http://www.amazon.com/dp/0321445619 , cuma belum selesai donlot buku b*j*k*nny*, solusinya dah ketemu duluan ^_^, however it seems that book worth to read it

Komentar

Trackback: Use this URI to trackback this entry. Use your web browser's function to copy it to your blog posting.

Gravatar: You can have a picture at the top of each your comments by getting a Gravatar

Belum ada komentar.

RSS feed for comments on this post.

Leave a comment

Line and paragraph breaks automatic, e-mail address never displayed, HTML allowed: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <code> <em> <i> <strike> <strong>



Anti-spam measure: please retype the above text into the box provided.