felixabele
6/11/2013 - 6:53 AM

Rails-Server

Rails-Server

# --- Run a Test
ruby -I test test/functional/paypal_controller_test.rb

# --- Delayed Job
RAILS_ENV=production script/delayed_job start

# --- Migrate
bundle exec rake db_migrate RAILS_ENV=production

# ... only one migration
rake db:migrate:redo VERSION=xxxxxxx

# step(s) back
rake db:rollback
$rake db:rollback STEP=n

# --- clear log
> production.log

# --- show Query LOG in tests
ActiveRecord::Base.logger = Logger.new(STDOUT)

# --- recreate Paperclip thumbnails
rake paperclip:refresh CLASS=Picture

# --- Log to STDOUT in Tests
ActiveRecord::Base.logger = Logger.new(STDOUT)

# --- Mysql2::Error: BLOB/TEXT column 'description' used in key specification without a key length
rake db:test:clone_structure

# --- Pry Copy Output to clipboard
pry(main)> a = :clipit!
=> :clipit!
pry(main)> clipit --var a
Copied content to clipboard!

# --- Rerun migration
rake db:migrate:redo VERSION=xxxxxxx

# --- Mysql2 downgrade issues:
bundle config build.mysql2 --with-mysql-config=/usr/local/Cellar/mysql56/5.6.32/bin/mysql_config

# --- search logile
tail -f logfile.txt | grep "error"
grep "warning" logfile.txt