Tag: howto

How to create ISO on Mac OSX

iconI’ve got to create an ISO file of a directory (ex: yourDirectory) on OSX system. I didn’t want to install 3rd part software to do it so I discoverd this trick:

  • open a terminal
  • go to your location
    cd /Desktop
  • type
  • hdiutil makehybrid -o yourIsoName.iso -iso -joliet yourDirectory
  • Done!
April 10, 2008
How to create ISO on Mac OSX

Aptana Studio RedRails Error

I was curious to try an IDE on Osx for Rails development and APTANA STUDIO seems to be the right product. (I do use TextMate as editor)

Aptana Studio is fully installed on my laptop but, when I try to install the RedRails plugin, it returns this error:

Requested operation cannot be performed because it would invalidate the current configuration. See details for more information.


Ruby Mylyn Connector Feature (Optional) (0.9.3.6479) requires feature
"org.eclipse.mylyn.context_feature (2.0.0.v20070628-1000)", or later version.

The solution: http://support.aptana.com/issues/browse/ROR-156

The most important steps are:

  1. Went to Help=>Updates=>Find and Install. Installed three Eclipse updates that the system found. Installation of updates worked ok.
  2. When the update window appears with RadRails updates, expand the tree and uncheck the box next to the Ruby Mylyn Connector Feature. This is an optional extension for users of Mylyn. You don’t need it, so you can safely uncheck the box and install.

This seems to works either on Windows, Osx and Linux

Aptana Studio RedRails Error

SQLite in Ruby on Rails su OSX

Oggi il mio primo esperimento con SQLite su un progetto rails. Va oremesso che spulciando documentazione ho visto che SQLite sarà integrato come database di default per rails mettendo mysql come scelta opzionale.
Per prima cosa è necessario installare la gemma sqlite3

 sudo gem install sqlite3-ruby

Poi si deve configurare il proprio file database.yml

development:
  adapter: sqlite3
  dbfile: dev.db
test:
  adapter: sqlite
  dbfile: test.db
production:
  adapter: sqlite
  dbfile: prod.db

A questo punto basta sotto lib/task/ un rake db.rake tipo questo:

namespace :db do
  desc 'Inserire i dati default'
  task :install => [:environment, 'db:migrate'] do |t|
    sDbPath = "#{ ENV['RAILS_ROOT'] }/db"
    h = YAML.load_file("#{ ENV['RAILS_ROOT'] }/config/database.yml")
    hConnection = h[ENV['RAILS_ENV']]
     puts "-----"
     puts "eseguo sqlite3 ..."
    `sqlite3 -echo '#{ sDbPath }/#{ hConnection['dbfile'] }' < '#{ sDbPath }/i_miei_dati.sql'`
  end
end

Semplice, efficace, veloce!

SQLite in Ruby on Rails su OSX

uninitialized constant ActionMailer

Sto programmando un sito multilingua che invia delle emial personalizzate. Per fare questo uso ActionMailer::Base.

All’interno del view che risiede sotto app/views/notifier/mia_view.rhtml avevo necessità di inserire delle costanti definite in una libreria. Ho perso un po’ di neuroni dietro ad un problema di uninitialized constant per cui ho anche creduto che sotto Notifier non fossero visibili… invece è più semplice del previsto: basta mettere dentro environment.rb la funzione di inizializzazione di action mailer (  ActionMailer::Base.smtp_settings = {} ) alla fine del document, dopo l’inizializzazioen di rails (Rails::Initializer.run do |config|)

E tutto è disponibile.

January 25, 2008
uninitialized constant ActionMailer