Filed under Ruby on Rails

Use JRuby and Compile It

Download JRuby, and extract it in di /usr/local Edit the Environment Variables. Close the Terminal/Console/Command Prompt, and check it by if there’s an output, the installation is corrent. Use Jruby by : To Compile JRuby into a Java Class, use jrubyc To run a JRuby class by java, also give environment path for jruby.jar Happy … Continue reading

Install Memcached with Rails

To Install Memcached and use it with rails Install libevent first : curl -O http://www.monkey.org/~provos/libevent-1.4.13-stable.tar.gz tar xzvf libevent-1.4.13-stable.tar.gz cd libevent-1.4.13-stable ./configure –prefix=/usr/local make make verify sudo make install install memcached curl -O http://memcached.googlecode.com/files/memcached-1.4.4.tar.gz $ tar xzvf memcached-1.4.4.tar.gz $ cd memcached-1.4.4 $ ./configure –prefix=/usr/local $ make $ make test $ sudo make install Run Memcached by … Continue reading

simple twitter gem tutorial

to use twitter gem with rails, is quite simple. install it by sudo gem install twitter in environment.rb add config.gem ‘twitter’ to authenticate user with twitter httpauth = Twitter::HTTPAuth.new(‘twitter_email@example.com’,’twitter_password’) twitter = Twitter::Base.new( httpauth ) after that you can fetch your timeline and pass it to the view @twitter = twitter.user_timeline :count => 5 and loop … Continue reading

Using / Accessing Class, from their own class

Pada ruby, pendekatan access class, yang awalnya saya kira hampir mirip dengan java, ternyata sedikit berbeda. Awalnya saya kira kata kunci this, pada java, sama dengan kata self pada ruby. Setelah Googling, akhirnya ada perbedaan, seperti ini self, pada ruby digunakan setelah Object tersebut di instance, atau untuk mengakses method atau atribut yang ada di … Continue reading

Ruby on Rails Deployment using cpanel

deployment ruby on rails di hostingan yang masih pake cpanel itu gampang gampang susah, knp, klo suda up yah relatif ga ada masalah. cuma ada beberapa perhatian item yang mesti diperhatikan : cek file.htaccess nya, karena sebenarnya ada bug pada cpanel, dia akan bikin seperti ini :RewriteRule ^/?$ “http\:\/\/127\.0\.0\.1\:12009%{REQUEST_URI}” [P,QSA,L]padahal semestinya RewriteRule ^.*$ “http\:\/\/127\.0\.0\.1\:12009%{REQUEST_URI}” [P,QSA,L] … Continue reading