Skip to content

Instantly share code, notes, and snippets.

View sunfmin's full-sized avatar

Felix Sun sunfmin

View GitHub Profile
** Execute db:autoupgrade
rake aborted!
Access denied for user ''@'localhost' to database 'abc_dev' (mysql_error_code=-001)
/Library/Ruby/Gems/1.8/gems/data_objects-0.9.6/lib/data_objects/connection.rb:26:in `initialize'
/Library/Ruby/Gems/1.8/gems/data_objects-0.9.6/lib/data_objects/connection.rb:26:in `send'
/Library/Ruby/Gems/1.8/gems/data_objects-0.9.6/lib/data_objects/connection.rb:26:in `__new'
/Library/Ruby/Gems/1.8/gems/extlib-0.9.8/lib/extlib/pooling.rb:161:in `new'
/Library/Ruby/Gems/1.8/gems/extlib-0.9.8/lib/extlib/pooling.rb:156:in `synchronize'
/Library/Ruby/Gems/1.8/gems/extlib-0.9.8/lib/extlib/pooling.rb:156:in `new'
/Library/Ruby/Gems/1.8/gems/extlib-0.9.8/lib/extlib/pooling.rb:107:in `new'
require 'rubygems'
require 'dm-core'
DataMapper.setup(:default, 'sqlite3::memory:')
class Dummy
include DataMapper::Resource
property :id, Serial
property :name, String
end
# change ip
[/etc/sysconfig/network-scripts]# cat ifcfg-eth0
DEVICE=eth0
BOOTPROTO=static
IPADDR=172.17.17.10
NETMASK=255.255.255.248
ONBOOT=yes
$ mysql -u root -p
mysql> use mysql;
mysql> update user set password=PASSWORD("NEWPASSWORD") where User='root';
mysql> flush privileges;
mysql> quit
lookupd -flushcache
git branch mybranch1
git checkout mybranch1
git push origin mybranch1
git fetch origin
get reset --hard origin
Felix:~ sunfmin$ sudo gem install mysql
Building native extensions. This could take a while...
ERROR: Error installing mysql:
ERROR: Failed to build gem native extension.
/opt/local/bin/ruby 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... yes
Felix:~/Developments/asics sunfmin$ spec ./spec/controllers/comments_spec.rb
/opt/local/lib/ruby/gems/1.8/gems/ParseTree-3.0.2/lib/parse_tree.rb:152:in `parse_tree_for_meth': bad version, 1.8.7 != 1.8.6 (fatal)
from /opt/local/lib/ruby/gems/1.8/gems/ParseTree-3.0.2/lib/parse_tree.rb:152:in `parse_tree_for_method'
from /opt/local/lib/ruby/gems/1.8/gems/dm-sweatshop-0.9.10/lib/dm-sweatshop/unique.rb:81:in `key_for'
from /opt/local/lib/ruby/gems/1.8/gems/dm-sweatshop-0.9.10/lib/dm-sweatshop/unique.rb:44:in `unique'
from ./spec/controllers/../spec_fixtures.rb:23
from /opt/local/lib/ruby/gems/1.8/gems/dm-sweatshop-0.9.10/lib/dm-sweatshop/sweatshop.rb:118:in `call'
from /opt/local/lib/ruby/gems/1.8/gems/dm-sweatshop-0.9.10/lib/dm-sweatshop/sweatshop.rb:118:in `attributes'