An entity composed of reality and pseudo-reality. Enjoys coding, news, history, photography.
A bit of Ruby, a bit of JavaScript, a bit of love...
I use JRuby a lot more than I use MRI Ruby. I just like the Java VM a lot more. Anyways, to setup a JRuby project you need to do a few different things. Gem install activerecord-jdbc-adapter and one of these based on the database you are going to be using.
1 activerecord-jdbcderby-adapter 2 activerecord-jdbch2-adapter 3 activerecord-jdbchsqldb-adapter 4 activerecord-jdbcmssql-adapter 5 activerecord-jdbcmysql-adapter 6 activerecord-jdbcpostgresql-adapter 7 activerecord-jdbcsqlite3-adapter
Then run:
1 ./script/generate jdbcEverything else should be the same.
sass-convert style.sass style.scssAlso here is a syntax file for Vim hounds. To compile a sass/scss file to css we need to run the following:
sass --watch plutoz.scss
sass --watch public/stylesheets
I was upgrading a Rails 1.2.3 app to Rails 2.3.3 and I thought about documenting what I had to do for future reference. I was following Peter Marklund's article to upgrade to Rails 2.3.2 which I also followed to upgrade. However, I want to cover the many little things that will make your app not work in 2.3.
Upgrading to Rails 2.3.2 should be straightforward.
RAILS_GEM_VERSION = '2.3.3' unless defined? RAILS_GEM_VERSION
rake rails:freeze:edge RELEASE=2.3.3and
rake rails:update. This should place a new version of rails. From here on follow Marklund's article to finish off the rest of the solution.
The main differences between Rails 1.2 and 2 are the many deprecated calls that need to be addressed. Here knowing sed is a godsend. A command like the following
find app/ -exec sed -i '' 's/A/B/g' {} \; -print
where A is the search and B is the replace works wonders.
Here are some common changes that need to be addressed in transitioning and need to be replaced for your app to work.
s/@request/request/g s/redirect_to_url/redirect_to/g s/find_first/first/g s/find_all/all/g