Why HTTPD open too many files? - mysql

I have tried to show how many files are open via this command:
lsof | awk '{print $1" "$2}' | uniq -c | sort -n -r
and here is result:
717 mysqld 1762
188 httpd 5171
185 httpd 5145
184 httpd 5631
184 httpd 5488
184 httpd 5150
184 httpd 3824
184 httpd 3819
184 httpd 3811
184 httpd 3483
184 httpd 3255
184 httpd 3249
184 httpd 3236
184 httpd 3230
183 httpd 5655
183 httpd 5490
183 httpd 5489
183 httpd 5487
183 httpd 5465
183 httpd 5464
183 httpd 5149
183 httpd 4480
183 httpd 4479
183 httpd 4478
183 httpd 4477
183 httpd 4474
183 httpd 4473
183 httpd 4459
183 httpd 3490
183 httpd 3489
183 httpd 3488
183 httpd 3487
183 httpd 3484
183 httpd 3478
183 httpd 3326
183 httpd 3235
183 httpd 3234
183 httpd 3233
183 httpd 3231
183 httpd 3229
183 httpd 10551
183 httpd 10317
183 httpd 10316
183 httpd 10291
182 httpd 10602
182 httpd 10601
182 httpd 10281
174 httpd 5443
174 httpd 3319
174 httpd 10603
174 httpd 10596
174 httpd 10578
174 httpd 10577
174 httpd 10552
174 httpd 10531
173 httpd 10576
173 httpd 10378
173 httpd 10319
173 httpd 10318
171 httpd 3226
137 master 1985
118 dovecot 1854
74 newrelic- 1880
63 sshd 8631
62 auth 11282
57 fail2ban- 2107
56 auth 11283
49 qmgr 2007
49 pickup 31235
44 squid 2061
44 memcached 1002
41 sshd 1183
37 squid 2059
34 log 1857
27 vsftpd 1206
27 imap 7971
24 anvil 1855
22 config 11280
20 rsyslogd 869
20 init 1
19 udevd 363
19 crond 2042
15 unlinkd 2063
15 udevd 911
15 udevd 910
15 mysqld_sa 1246
15 lsof 11502
15 bash 8687
13 acpid 895
12 sort 11505
12 awk 11503
10 newrelic- 1879
10 lsof 11506
10 irqbalanc 884
9 uniq 11504
8 mingetty 2155
3 xenwatch 23
3 xenbus 24
3 sync_supe 56
3 netns 19
3 migration 9
3 migration 7
3 migration 5
3 migration 4
3 kthreadd 2
3 kswapd0 117
3 kstriped 292
3 ksoftirqd 8
3 ksoftirqd 6
3 ksoftirqd 3
3 ksoftirqd 10
3 ksnapd 296
3 kseriod 68
3 kjournald 318
3 khvcd 136
3 khelper 16
3 kblockd/3 63
3 kblockd/2 62
3 kblockd/1 61
3 kblockd/0 60
3 kauditd 570
3 flush-202 725
3 events/3 14
3 events/2 13
3 events/1 12
3 events/0 11
3 crypto/3 125
3 crypto/2 124
3 crypto/1 123
3 crypto/0 122
3 cpuset 15
3 bdi-defau 58
3 async/mgr 20
3 aio/3 121
3 aio/2 120
3 aio/1 119
3 aio/0 118
1 COMMAND PID
Folks, could you please tell me why Apache open so many files? I have disabled access_log directive at httpd.conf but it not helps me.
Thx

If you look at the actual results (lsof|grep httpd), you will see that each parent process has open handles to each module that is loaded, so your modules (e.g. mod_rewrite) will be in the open file list.
Each process will also have a handle to the error_log file, lib files required to run httpd or any modules, and at least one pipe per process for IPC.
If you are serving a lot of static files and you have a busy site, chances are you will see some of those files open too.
Really none of this should be much of an issue. And keep in mind, the more Server processes you have running, the more open files there will be since each parent process will open many of the same files (in particular the modules and log files).

Related

haskell tls file to list of list

I have a tls file such as:
1224 926 1380 688 845 109 118 88 1275 1306 91 796 102 1361 27 995
1928 2097 138 1824 198 117 1532 2000 1478 539 1982 125 1856 139 475 1338
848 202 1116 791 1114 236 183 186 150 1016 1258 84 952 1202 988 866
946 155 210 980 896 875 925 613 209 746 147 170 577 942 475 850
1500 322 43 95 74 210 1817 1631 1762 128 181 716 171 1740 145 1123
3074 827 117 2509 161 206 2739 253 2884 248 3307 2760 2239 1676 1137 3055
183 85 143 197 243 72 291 279 99 189 30 101 211 209 77 198
175 149 259 372 140 250 168 142 146 284 273 74 162 112 78 29
169 578 97 589 473 317 123 102 445 217 144 398 510 464 247 109
3291 216 185 1214 167 495 1859 194 1030 3456 2021 1622 3511 222 3534 1580
2066 2418 2324 93 1073 82 102 538 1552 962 91 836 1628 2154 2144 1378
149 963 1242 849 726 1158 164 1134 658 161 1148 336 826 1303 811 178
3421 1404 2360 2643 3186 3352 1112 171 168 177 146 1945 319 185 2927 2289
543 462 111 459 107 353 2006 116 2528 56 2436 1539 1770 125 2697 2432
1356 208 5013 4231 193 169 3152 2543 4430 4070 4031 145 4433 4187 4394 1754
5278 113 4427 569 5167 175 192 3903 155 1051 4121 5140 2328 203 5653 3233
how can I read it in a list of list of int in haskell?
I have tried few options but I could not manage to do it. I am very new to haskell so please be patience.
First break your input into lines using lines:
let test = "1 2 3 4\n 5 6 7 \n 4 2 5"
let rows = lines test --literally "lines test"! Beautiful, eh?
Result:
["1 2 3 4"," 5 6 7 "," 4 2 5"] :: [[Char]]
Then, extract individual numbers as strings using words:
let nums_as_strings = map words rows
Result:
[["1","2","3","4"],["5","6","7"],["4","2","5"]] :: :: [[[Char]]]
The last thing to do is convert these strings to integers with read:
let numbers = map (map read) nums_as_strings :: [[Int]]
Result:
[[1,2,3,4],[5,6,7],[4,2,5]] :: [[Int]]
Or, squashed into one line:
let numbers = map (map read) (map words $ lines test) :: [[Int]]
Example with your data:
Prelude> let test = "1224 926 1380 688 845 109 118 88 1275 1306 91 796 102 1361 27 995\n1928 2097 138 1824 198 117 1532 2000 1478 539 1982 125 1856 139 475 1338"
Prelude> map (map read) (map words $ lines test) :: [[Int]]
[[1224,926,1380,688,845,109,118,88,1275,1306,91,796,102,1361,27,995],[1928,2097,138,1824,198,117,1532,2000,1478,539,1982,125,1856,139,475,1338]]
You may need to take care of empty lines, but that's really simple.
import System.IO
readListOfLists :: Handle -> IO [[Int]]
readListOfLists handle = do
contents <- hGetContents handle
let ls :: [String]
ls = lines contents
ws :: [[String]]
ws= map words ls
res :: [[Int]]
res = map (map read) ws
return res;
or you can write the same code in one line:
readListOfLists :: Handle -> IO [[Int]]
readListOfLists = fmap (map (map read . words) . lines) . hGetContents
To use it:
do
handle <- openFile fileName ReadMode
table <- readListOfLists handle
hClose handle
print table

BASH Mysql outputs part of statement

I'm trying to run the below script to get a list of Orgs and the amount of users each Org has:
#!/bin/bash
array=(293 182 177 12 85 51 325 225 40 169 357 329 243 349 291 295 22 279 16 69 219 299 301 331 91 281 285 59 283 341 45 289 95 61 77 13 14 201 43 343 223 28 171 26 233 47 303 367 369 339 257 305 353 245 213 87 345 2 71 199 24 179 259 37 35 237)
for i in "${array[#]}"; do
query=$(export MYSQL_PWD=MYPASS; mysql -e "SELECT COUNT(*) FROM Org.Users WHERE HomeOrgID=$i;")
echo "Org_$i:$query"
done
I expect the result to be a simple "Org:Number" list:
Org_1:150
Org_25:250
Org_17:64
Org_64:12
But the output is not displayed correctly. It does show part of the MySQL statement:
Org_293:COUNT(*)
1
Org_182:COUNT(*)
0
Org_177:COUNT(*)
8
Org_12:COUNT(*)
0
Org_85:COUNT(*)
1
How can I get the output to NOT display that "COUNT(*)" and display just a simple list?
Thanks in advance!
One quick hack : use bash arrays to store your output.
#!/bin/bash
array=(293 182 177 12 85 51 325 225 40 169 357 329 243 349 291 295 22 279 16 69 219 299 301 331 91 281 285 59 283 341 45 289 95 61 77 13 14 201 43 343 223 28 171 26 233 47 303 367 369 339 257 305 353 245 213 87 345 2 71 199 24 179 259 37 35 237)
for i in "${array[#]}"; do
# we store the result of the request as an array
query=($(export MYSQL_PWD=MYPASS; mysql -e "SELECT COUNT(*) FROM Org.Users WHERE HomeOrgID=$i;"))
# we echo the 2nd member of the array. ${query[0]} should contain 'count(*)'
echo "Org_$i:${query[1]}"
done

Resulted array to URL friendly form

In a coding contest I have a programming task to find minimum or maximum from different arrays, and the final result to put it at the end of the URL (www.example.com/result).
I can't figure out what format are they expecting...
They gave this hint:
look at the resulting values and see if they could represent something familiar), at the end of the root of the URL of the page you're on (of course add a slash if needed)
Update
For the result of the problem, you need to figure out a way to convert those numbers to a "URL friendly form" value.
For example, a URL friendly value means a string, so you need a 'standard' way to convert each number to a character and use the resulting string to go to the next problem.
I tried the following formats 1:2:3:4 , 1_2_3_4 no chance.
The numbers are 100,126,114,85,82,121,54 .
So I need them formatted in an url friendly form whatever that would mean.
This is the coding challenge :
You are given an input file containing:
On the first line a positive integer N
On the following N lines there will be arrays of integers, of variable length, each integer value separated by a white space from the next value
The start of each array will only contain one of the following possible numbers: 1 or -1
To get to the next step you will have to calculate the minimum (if start value is -1) or maximum (if start value is 1) of the arrays in the input file and then put the result, in a more human and URL friendly form (hint: look at the resulting values and see if they could represent somehting familiar), at the end of the root of the URL of the page you're on (of course add a slash if needed). Also keep the code used to solve this problem!
Here is your input data:
7
-1 156 198 171 134 197 120 149 177 130 100 103 126 169 115 199 188 119 168 151 161 167 141 111
-1 126 128 150 190 193 198 168 128 194 138 196 153 134 163 152 136 158 132 178 141 174 143 195 126 183 132 174 173 171 130 155 164 158
-1 178 115 166 161 164 134 130 164 147 114
1 73 78 81 66 77 0 26 42 48 42 12 24 33 4 54 31 50 34 78 13 21 37 29 85 56 68 12 79 81 82 25 7 16 44 32 82
1 62 35 54 82 30 7 28 78 74 34 12 80 40 16 5 39 29
-1 157 183 175 140 158 164 138 166 176 121 145 139 186 188 158 121 183 146 132 124 123 198 162 135 161 132 187 184 121 148 157 146 123 199 142 134 196 179
-1 70 74 81 105 121 129 148 91 160 76 146 94 64 154 54 102 142 68 62 88 63 144 143 138 118 117 148 166 146 159 162 130 183 184 156 172
Array.max = function( array ){
return Math.max.apply( Math, array );
};
Array.min = function( array ){
return Math.min.apply( Math, array );
};
function m(str) {
var parts = str.split(" ");
var what = parts.shift();
if (what=="-1") return Array.min(parts);
else return Array.max(parts);
}
var num=[];
num.push(7); // not sure about this one. Use the encode if yes
num.push(m("-1 156 198 171 134 197 120 149 177 130 100 103 126 169 115 199 188 119 168 151 161 167 141 111"))
num.push(m("-1 126 128 150 190 193 198 168 128 194 138 196 153 134 163 152 136 158 132 178 141 174 143 195 126 183 132 174 173 171 130 155 164 158"))
num.push(m("-1 178 115 166 161 164 134 130 164 147 114"))
num.push(m("1 1 73 78 81 66 77 0 26 42 48 42 12 24 33 4 54 31 50 34 78 13 21 37 29 85 56 68 12 79 81 82 25 7 16 44 32 82"))
num.push(m("1 62 35 54 82 30 7 28 78 74 34 12 80 40 16 5 39 29"))
num.push(m("-1 157 183 175 140 158 164 138 166 176 121 145 139 186 188 158 121 183 146 132 124 123 198 162 135 161 132 187 184 121 148 157 146 123 199 142 134 196 179"))
num.push(m("-1 70 74 81 105 121 129 148 91 160 76 146 94 64 154 54 102 142 68 62 88 63 144 143 138 118 117 148 166 146 159 162 130 183 184 156 172"))
var str = String.fromCharCode.apply(null, num);
console.log(num,str);
console.log(encodeURIComponent(str)); // if 7 is part of the numbers
// location = "http://www.example.com/"+str;

SQL Update from two tables

I'm a complete novice when it comes to SQL, just getting started.
I need help writing a query to update values in my SQL table:
Two tables: Members, Chapters
Concerned with three columns in Chapters table: CHAP_NO, FA, FA2
i.e.
CHAP_NO FA FA2
111 1234567 2345689
222 2234567 4567899
333 3225545
444
555 2358878 4566665
666 4568799
777 4566878 1233666
888 1119998
999 3555879 6544799
etc. . .
Each value is a unique identifier
Concerned with two columns in Members table: MEMB_NO, CURR_CHAP
i.e.
MEMB_NO CURR_CHAP
1234567 665
5468787 664
4577789 122
4578767 233
7775666 588
4114748 787
etc. . .
Is it possible to automate an update based on if FA or FA2 is in Chapters table, update their CURR_CHAP value in the Members table from the CHAP_NO value?
From the above example data, I need MEMB_NO '1234567' to have his CURR_CHAP updated to '111' because he is listed as FA for CHAP_NO '111'
I really need to do this for similar MS SQL and MySQL databases if possible. If this can't be automated, I need help writing a query to manually update the Members table as exampled above with a 2 column manual update row of data:
MEMB_NO CURR_CHAP
5470011 547
5030038 545
3880188 544
1140753 543
4130019 543
5420011 542
5410010 541
2590511 540
4190109 540
4180296 539
5380020 538
5370012 537
1050859 536
4390125 535
4860144 535
5330009 533
5330061 533
1080746 532
2060321 531
1750750 529
4250135 528
8070013 528
1080645 527
5270053 527
2580695 526
2440073 525
2440163 525
5240010 524
4980035 523
2120380 522
4000418 521
3270185 520
4350210 519
4610218 518
5160004 516
1610450 515
5150065 515
5130046 513
5130050 513
5120047 512
1940306 510
2500170 510
5090087 509
5080014 508
1270803 505
1381026 505
2260505 504
3900106 504
5030006 503
1770526 501
1780355 501
5000017 500
4980037 498
2380411 497
4970019 497
4960044 496
4960127 496
4950012 495
4950095 495
1720409 494
2260867 494
2300466 493
3990055 492
4920204 492
1311252 491
2100252 491
1750592 490
1760563 490
2520403 489
4890051 489
4870076 487
4870143 487
4860153 486
1670856 485
4840054 484
4840143 484
2920024 483
4830136 483
1751087 482
1790828 481
1970128 481
2050815 480
4800027 480
1870246 478
3210174 478
4770100 477
4760124 476
4760126 476
1350640 475
2280722 475
2200077 474
3410230 474
4730100 473
4250159 470
4250156 470
3790179 464
4630164 463
4630139 463
2210062 461
4610188 461
4210110 460
4870065 459
4500246 450
1110937 449
1110934 449
2280501 447
4450323 445
4440114 444
4410135 441
4410216 441
1600799 435
2280449 435
4080089 431
4310132 431
1780525 427
4270190 427
4260502 426
4260550 426
4250467 425
4250485 425
4210328 421
4190230 419
4180005 418
4180341 418
4250232 417
4130004 413
4110444 411
4090133 409
4080308 408
4430119 408
4070279 407
4070443 407
1650354 405
1670725 404
2240204 402
2870319 400
3990114 399
3980014 398
4050073 398
3170399 397
3970348 397
1760487 395
4180191 395
1800443 394
2580288 394
1280499 393
3930227 393
3780058 391
3900377 390
2590362 389
1720492 385
1720398 384
2840325 383
3710142 381
3800235 380
3780407 378
1760459 375
1730026 373
3710306 371
3710228 371
1051294 370
3700332 370
3670174 367
1780583 359
4640038 359
1280614 358
2580373 358
3570449 357
3530560 353
3500046 350
3490275 349
3490244 349
3320203 348
3480310 348
4210188 346
3440364 344
4490223 344
1750642 342
3990257 342
1790541 341
3370562 337
3370738 337
1870336 334
3340382 334
1950674 333
1460619 328
3280586 328
4250013 326
1340705 324
2590495 324
2870029 322
3030290 322
1880232 321
2280415 321
3200547 320
3200568 320
3180132 318
3180178 318
3930433 317
4850072 317
2870449 315
3150168 315
1390763 313
3120170 312
3110048 311
3110110 311
3070267 307
3500231 306
3980122 306
1160708 305
3050510 305
2280197 304
3040348 304
1060785 303
1340760 303
3020534 302
3980151 301
2990239 299
1770425 297
2950573 295
2280513 294
2320434 287
2870594 287
4110133 284
4260131 278
2770221 277
2770366 277
2760484 276
2750397 275
2580694 272
1751006 267
4010252 267
2660235 266
2780335 265
2640326 264
3840125 263
1270872 259
2590690 259
2580728 258
2030556 257
4600151 257
2550390 255
4440010 255
2520461 252
4130095 252
3910117 250
2490314 249
1361032 247
1900370 247
2440211 244
2440101 244
1730150 243
1440258 242
2420062 242
1350511 238
2380559 238
1800598 237
2350417 235
2340372 234
2320453 232
2590582 232
2120104 230
2280696 228
3480122 227
1111011 226
2260626 226
3230234 222
2270200 221
4470101 221
3010326 219
2180334 218
2170591 217
1620648 213
2120524 212
3010424 212
3130060 210
2070261 207
2070313 207
1640858 206
1620684 205
2030573 203
2030810 203
1270589 201
1111015 200
1990448 199
1950384 195
1920328 192
1920684 192
1750798 188
1880607 188
1870445 187
1850587 185
2960295 185
1800721 180
1791166 179
3990116 178
3130119 177
4170034 177
1051172 176
1380942 176
1751011 175
4500021 175
2840346 174
3460307 174
1730027 173
4070275 173
1110986 171
1670586 167
1111222 166
2060385 164
1560459 163
1740135 162
3130093 161
1600695 160
1600682 160
1350600 159
1590341 159
1580464 158
1570742 157
1570761 157
4440077 156
1520404 152
4700010 152
3390033 147
4170240 145
4730144 143
4250191 142
1400502 140
2170212 140
1360713 139
3040299 139
1800519 136
1270930 135
1720638 134
1800462 133
3930387 133
1111000 131
1311274 131
1360547 128
2260776 128
4830091 127
1800431 123
1280523 122
1750851 122
1291052 121
3850165 121
1180219 118
1180477 118
2240110 116
2870263 116
3900143 114
1111488 111
1490386 111
1060765 110
1780463 110
3200394 108
5050015 108
3870219 105
I think this should work on both...
UPDATE
IGNORE Chapters,
Members
SET Members.CURR_CHAP = Chapters.CHAP_NO
WHERE Chapters.FA = Members.MEMB_NO
AND Chapters.FA != ''
AND Chapters.FA2 != ''
UPDATE members m
INNER JOIN chapters c on (m.memb_no = c.fa or m.memb_no=c.fa2)
SET m.curr_chap=c.chap_no
This query worked for me in MySql
update Members m
INNER JOIN chapters c
ON (m.memb_no=c.FA or m.memb_no=c.FA2)
set CURR_CHAP = c.CHAP_NO

Unable to start Mongrel (or Passenger) on Debian due to mysql2 or mysql gems

I originally posted this at Super User, but now think it should be here instead...
I'm trying to port my RoR webapp over to a DreamHost VPS. I've upgraded the VPS --> Ruby 1.9.2 from 1.8.7 and am using Rails 3.0.1 and the mysql2 (0.2.6) gem. I'm getting the following error when trying to start mongrel:
/usr/bin/ruby1.8: symbol lookup error: /home/USERNAME/.gems/gems/mysql2-0.2.6/lib/mysql2/mysql2.so: undefined symbol: rb_intern2
...so I tried using the mysql (2.8.1) gem instead and get the following error:
wrong argument type Mysql (expected Struct) (TypeError)
0 /home/USERNAME/.gems/gems/activerecord-3.0.1/lib/active_record/connection_adapters/mysql_adapter.rb 600 in real_connect'
1 /home/USERNAME/.gems/gems/activerecord-3.0.1/lib/active_record/connection_adapters/mysql_adapter.rb 600 inconnect'
2 /home/USERNAME/.gems/gems/activerecord-3.0.1/lib/active_record/connection_adapters/mysql_adapter.rb 164 in initialize'
3 /home/USERNAME/.gems/gems/activerecord-3.0.1/lib/active_record/connection_adapters/mysql_adapter.rb 36 innew'
4 /home/USERNAME/.gems/gems/activerecord-3.0.1/lib/active_record/connection_adapters/mysql_adapter.rb 36 in mysql_connection'
5 /home/USERNAME/.gems/gems/activerecord-3.0.1/lib/active_record/connection_adapters/abstract/connection_pool.rb 230 insend'
6 /home/USERNAME/.gems/gems/activerecord-3.0.1/lib/active_record/connection_adapters/abstract/connection_pool.rb 230 in new_connection'
7 /home/USERNAME/.gems/gems/activerecord-3.0.1/lib/active_record/connection_adapters/abstract/connection_pool.rb 238 incheckout_new_connection'
8 /home/USERNAME/.gems/gems/activerecord-3.0.1/lib/active_record/connection_adapters/abstract/connection_pool.rb 194 in checkout'
9 /home/USERNAME/.gems/gems/activerecord-3.0.1/lib/active_record/connection_adapters/abstract/connection_pool.rb 190 inloop'
10 /home/USERNAME/.gems/gems/activerecord-3.0.1/lib/active_record/connection_adapters/abstract/connection_pool.rb 190 in checkout'
11 /usr/lib/ruby/1.8/monitor.rb 242 insynchronize'
12 /home/USERNAME/.gems/gems/activerecord-3.0.1/lib/active_record/connection_adapters/abstract/connection_pool.rb 189 in checkout'
13 /home/USERNAME/.gems/gems/activerecord-3.0.1/lib/active_record/connection_adapters/abstract/connection_pool.rb 96 inconnection'
14 /home/USERNAME/.gems/gems/activerecord-3.0.1/lib/active_record/connection_adapters/abstract/connection_pool.rb 318 in retrieve_connection'
15 /home/USERNAME/.gems/gems/activerecord-3.0.1/lib/active_record/connection_adapters/abstract/connection_specification.rb 97 inretrieve_connection'
16 /home/USERNAME/.gems/gems/activerecord-3.0.1/lib/active_record/connection_adapters/abstract/connection_specification.rb 89 in connection'
17 /home/USERNAME/.gems/gems/activerecord-3.0.1/lib/active_record/associations.rb 1804 increate_has_and_belongs_to_many_reflection'
18 /home/USERNAME/.gems/gems/activerecord-3.0.1/lib/active_record/associations.rb 1411 in has_and_belongs_to_many'
19 /home/USERNAME/.gems/gems/activerecord-3.0.1/lib/active_record/autosave_association.rb 137 inhas_and_belongs_to_many'
20 /home/USERNAME/portfoliofinearts.ca/farr/app/models/project.rb 3
21 /home/USERNAME/.gems/gems/activesupport-3.0.1/lib/active_support/dependencies.rb 239 in require'
22 /home/USERNAME/.gems/gems/activesupport-3.0.1/lib/active_support/dependencies.rb 239 inrequire'
23 /home/USERNAME/.gems/gems/activesupport-3.0.1/lib/active_support/dependencies.rb 227 in load_dependency'
24 /home/USERNAME/.gems/gems/activesupport-3.0.1/lib/active_support/dependencies.rb 239 inrequire'
25 /home/USERNAME/.gems/gems/activesupport-3.0.1/lib/active_support/dependencies.rb 346 in require_or_load'
26 /home/USERNAME/.gems/gems/activesupport-3.0.1/lib/active_support/dependencies.rb 300 independ_on'
27 /home/USERNAME/.gems/gems/activesupport-3.0.1/lib/active_support/dependencies.rb 216 in require_dependency'
28 /home/USERNAME/.gems/gems/railties-3.0.1/lib/rails/engine.rb 138 ineager_load!'
29 /home/USERNAME/.gems/gems/railties-3.0.1/lib/rails/engine.rb 137 in each'
30 /home/USERNAME/.gems/gems/railties-3.0.1/lib/rails/engine.rb 137 ineager_load!'
31 /home/USERNAME/.gems/gems/railties-3.0.1/lib/rails/engine.rb 135 in each'
32 /home/USERNAME/.gems/gems/railties-3.0.1/lib/rails/engine.rb 135 ineager_load!'
33 /home/USERNAME/.gems/gems/railties-3.0.1/lib/rails/application.rb 108 in eager_load!'
34 /home/USERNAME/.gems/gems/railties-3.0.1/lib/rails/application/finisher.rb 41
35 /home/USERNAME/.gems/gems/railties-3.0.1/lib/rails/initializable.rb 25 ininstance_exec'
36 /home/USERNAME/.gems/gems/railties-3.0.1/lib/rails/initializable.rb 25 in run'
37 /home/USERNAME/.gems/gems/railties-3.0.1/lib/rails/initializable.rb 50 inrun_initializers'
38 /home/USERNAME/.gems/gems/railties-3.0.1/lib/rails/initializable.rb 49 in each'
39 /home/USERNAME/.gems/gems/railties-3.0.1/lib/rails/initializable.rb 49 inrun_initializers'
40 /home/USERNAME/.gems/gems/railties-3.0.1/lib/rails/application.rb 134 in initialize!'
41 /home/USERNAME/.gems/gems/railties-3.0.1/lib/rails/application.rb 77 insend'
42 /home/USERNAME/.gems/gems/railties-3.0.1/lib/rails/application.rb 77 in method_missing'
43 /home/USERNAME/mydomain.com/test_app/config/environment.rb 10
44 /usr/lib/ruby/1.8/rubygems/custom_require.rb 31 ingem_original_require'
45 /usr/lib/ruby/1.8/rubygems/custom_require.rb 31 in require'
46 config.ru 3
47 /usr/lib/ruby/gems/1.8/gems/rack-1.2.1/lib/rack/builder.rb 46 ininstance_eval'
48 /usr/lib/ruby/gems/1.8/gems/rack-1.2.1/lib/rack/builder.rb 46 in initialize'
49 config.ru 1 innew'
50 config.ru 1
I'd prefer to use mysql2, so that's the preferred solution I'm looking for, but I will certainly appreciate input on either problem.
I'm not encountering any problems such as this in my development environment (which is windows)
You'd mentioned that you're running Ruby 1.9.2 but your error dump looks like it's running Ruby 1.8 I'm not sure that this would cause the problem or not but it seems like a potential issue.
I'd uninstall ruby1.8 and see if it fixes anything.
sudo apt-get remove ruby1.8