Skip to content

Instantly share code, notes, and snippets.

View gist:124865
Building native extensions. This could take a while...
ERROR: Error installing mysql:
ERROR: Failed to build gem native extension.
/usr/bin/ruby1.8 extconf.rb install mysql
checking for mysql_query() in -lmysqlclient... no
checking for main() in -lm... yes
checking for mysql_query() in -lmysqlclient... no
checking for main() in -lz... no
checking for mysql_query() in -lmysqlclient... no
View gist:124868
Building native extensions. This could take a while...
ERROR: Error installing mysql:
ERROR: Failed to build gem native extension.
/usr/bin/ruby1.8 extconf.rb install mysql
extconf.rb:1:in `require': no such file to load -- mkmf (LoadError)
from extconf.rb:1
View gist:149980
1) Error:
test_the_truth(Admin::FilmControllerTest):
Mysql::Error: Access denied for user 'root'@'localhost' (using password: NO)
/usr/lib/ruby/1.8/monitor.rb:242:in `synchronize'
View gist:149984
1) Error:
test_the_truth(Admin::FilmControllerTest):
Mysql::Error: Unknown database 'application_name_test'
/usr/lib/ruby/1.8/monitor.rb:242:in `synchronize'
@asmega
asmega / sed
Created Jul 31, 2011
find and replace with sed for rails 3 upgrade on named_scopes
View sed
find . -name *.rb -type f -exec sed -i 's/named_scope/scope/g' {} \;
@asmega
asmega / sed
Created Aug 1, 2011
find and delete line with sed
View sed
find ./spec/ -name *_spec.rb -type f -exec sed -i "/require \"spec\"/d" {} \;
View squish
git checkout -b squashed_feature
git rebase -i master
pick fda59df commit 1
squash x536897 commit 2
squash c01a668 commit 3
@asmega
asmega / index
Created Oct 17, 2011
remove ubuntu service
View index
update-rc.d -f SERVICE remove
@asmega
asmega / main.rb
Created Oct 23, 2011
rails mass assignment checker
View main.rb
Dir.glob("#{Rails.root}/app/models/*.rb").collect{|m| m.split("/").last.split(".").first.camelize.constantize }
models = ActiveRecord::Base.subclasses.collect(&:name).collect(&:constantize)
models.each{|m| puts m; print "Columns: #{m.column_names}"; puts ""; print "Protected: #{m.attr_protected.to_a}"; puts ""; print "Accessible: #{m.attr_accessible.to_a}"; puts "\n\n" }
# example output
#
#User
#Columns: ["id", "email", "encrypted_password", "salt", "confirmation_token", "remember_token", #"created_at", "updated_at", "company_id", "status"]
#Protected: ["id", "type", "status", "company_id"]
@asmega
asmega / .curlrc
Created Oct 27, 2011
default proxy for curl in .curlrc
View .curlrc
proxy=http://username:password@host:port