Ruby on Rails
Configuraci贸n de PATH
export PATH="$PATH:/usr/share/rvm/bin/:/opt/Android/Sdk/platform-tools/:/home/adrian/.gem/ruby/2.7.0/bin"
As铆 茅 como te帽o actualmente o .bashrc.
/usr/share/rvm/bin/馃憠 TODO: Te帽o que revisar este directorio, creo que xa non existe/home/adrian/.gem/ruby/2.7.0/bin馃憠 脡 importante ter esta ruta para poder executar as gemas executables. En caso de non tela podemos obter o seguinte warning en alg煤ns casos:

Jekyll
Jekyll * Simple, blog-aware, static sites
Testing
Revisar estos posts:
Difference between Unit::Test versus Rspec
Posibles problemas
Increasing the amount of inotify watchers
listen/README at master 路 guard/listen
Por que non se deben modificar migraci贸ns
Editing Existing Rails Migrations is a good idea?
Deshacer migraci贸ns (rollbacks) de migraci贸ns en espec铆fico
How to rollback just one step using rake db:migrate
Ver status de migrations (pendentes e executadas):
rake db:migrate:status
# Or (rails >= 5)
rails db:migrate:status
Roll back the most recent migration:
rake db:rollback
Roll back the n most recent migrations:
rake db:rollback STEP=n
Here's some more:
rake db:migrate- Run all migrations that haven't been run alreadyrake db:migrate VERSION=20080906120000- Run all necessary migrations (up or down) to get to the given versionrake db:migrate RAILS_ENV=test- Run migrations in the given environmentrake db:migrate:redo- Roll back one migration and run it againrake db:migrate:redo STEP=n- Roll back the last n migrations and run them againrake db:migrate:up VERSION=20080906120000- Run the up method for the given migrationrake db:migrate:down VERSION=20080906120000- Run the down method for the given migration
Cach茅 en local
Ao activar cach茅 en local pode dar lugar a excepci贸ns cando se fan cambios no c贸digo sen reiniciar o servidor:
Rails.cache.fetch exception: TypeError ( can't be referred to)
Migraci贸ns
change method
The change method is the primary way of writing migrations. It works for the majority of cases, where Active Record knows how to reverse the migration automatically.
If you're going to need to use any other methods, you should use reversible or write the up and down methods instead of using the change method.
Never rescue Exception
If you rescue Exception, you will rescue every exception, including some like:
- SignalException::Interrupt - If you rescue this, you can't exit your app by hitting control-c.
- ScriptError::SyntaxError - Swallowing syntax errors means that things like puts("Forgot something) will fail silently.
- NoMemoryError - Wanna know what happens when your program keeps running after it uses up all the RAM? Me neither.
Rescue StandardError Instead and Custom Exceptions Should Inherit from StandardError.