[x]
Posted via EE Mobile

Search, ask, and monitor your questions on the go with EE Mobile. Visit Experts Exchange from your mobile device and never be out of touch again.

Question
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

8.2

ruby on rails Mysql::Error: query: not connected

Asked by rgb192 in RubyOnRails, Ruby Scripting Language, MySQL Server

Tags: ruby on rails, ruby

getting a Mysql::Error: query: not connected error

database exists
user root with no password
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
45:
46:
47:
48:
49:
50:
51:
52:
53:
54:
55:
56:
57:
58:
59:
60:
61:
62:
63:
64:
65:
66:
67:
68:
69:
70:
71:
72:
73:
74:
75:
76:
77:
78:
79:
80:
81:
82:
83:
84:
85:
86:
87:
88:
89:
90:
91:
92:
93:
94:
95:
96:
97:
98:
99:
100:
101:
102:
103:
104:
105:
106:
107:
108:
109:
110:
111:
112:
113:
114:
115:
116:
117:
118:
119:
120:
121:
122:
123:
124:
125:
126:
127:
128:
129:
130:
131:
132:
133:
134:
135:
136:
137:
138:
139:
140:
141:
142:
143:
144:
145:
146:
147:
148:
149:
150:
151:
152:
153:
154:
155:
156:
157:
158:
159:
160:
161:
162:
163:
164:
165:
166:
167:
168:
169:
170:
171:
172:
173:
174:
175:
176:
177:
178:
179:
180:
181:
182:
183:
184:
185:
186:
187:
188:
189:
190:
191:
192:
193:
194:
195:
196:
197:
198:
199:
200:
201:
202:
203:
204:
205:
206:
207:
208:
209:
210:
211:
212:
213:
214:
215:
216:
217:
218:
219:
220:
221:
222:
223:
224:
225:
226:
227:
228:
229:
230:
231:
232:
233:
234:
235:
236:
237:
238:
239:
240:
241:
242:
243:
244:
245:
246:
247:
248:
249:
250:
251:
252:
253:
254:
255:
256:
257:
258:
259:
260:
261:
262:
263:
264:
265:
266:
267:
268:
269:
270:
271:
272:
273:
274:
275:
276:
277:
278:
279:
280:
281:
282:
283:
284:
285:
286:
287:
288:
289:
290:
291:
292:
293:
294:
295:
296:
297:
298:
299:
300:
301:
302:
303:
304:
===========================
output
===========================
(in C:/Users/Owner/Documents/NetBeansProjects/rubyweblog)
** Invoke db:migrate (first_time)
** Invoke environment (first_time)
** Execute environment
** Execute db:migrate
rake aborted!
Mysql::Error: query: not connected: SHOW TABLES
c:/ruby/lib/ruby/gems/1.8/gems/activerecord-2.3.4/lib/active_record/connection_adapters/abstract_adapter.rb:219:in `log'
c:/ruby/lib/ruby/gems/1.8/gems/activerecord-2.3.4/lib/active_record/connection_adapters/mysql_adapter.rb:319:in `execute'
c:/ruby/lib/ruby/gems/1.8/gems/activerecord-2.3.4/lib/active_record/connection_adapters/mysql_adapter.rb:435:in `tables'
c:/ruby/lib/ruby/gems/1.8/gems/activerecord-2.3.4/lib/active_record/connection_adapters/abstract/schema_statements.rb:319:in `initialize_schema_migrations_table'
c:/ruby/lib/ruby/gems/1.8/gems/activerecord-2.3.4/lib/active_record/migration.rb:436:in `initialize'
c:/ruby/lib/ruby/gems/1.8/gems/activerecord-2.3.4/lib/active_record/migration.rb:400:in `new'
c:/ruby/lib/ruby/gems/1.8/gems/activerecord-2.3.4/lib/active_record/migration.rb:400:in `up'
c:/ruby/lib/ruby/gems/1.8/gems/activerecord-2.3.4/lib/active_record/migration.rb:385:in `migrate'
c:/ruby/lib/ruby/gems/1.8/gems/rails-2.3.4/lib/tasks/databases.rake:116
c:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:636:in `call'
c:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:636:in `execute'
c:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:631:in `each'
c:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:631:in `execute'
c:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:597:in `invoke_with_call_chain'
c:/ruby/lib/ruby/1.8/monitor.rb:242:in `synchronize'
c:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:590:in `invoke_with_call_chain'
c:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:583:in `invoke'
c:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2051:in `invoke_task'
c:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2029:in `top_level'
c:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2029:in `each'
c:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2029:in `top_level'
c:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2068:in `standard_exception_handling'
c:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2023:in `top_level'
c:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2001:in `run'
c:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2068:in `standard_exception_handling'
c:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:1998:in `run'
c:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.7/bin/rake:31
C:/ruby/bin/rake:16:in `load'
C:/ruby/bin/rake:16
 
 
 
 
 
===========================
database.yml
===========================
# MySQL.  Versions 4.1 and 5.0 are recommended.
#
# Install the MySQL driver:
#   gem install mysql
# On Mac OS X:
#   sudo gem install mysql -- --with-mysql-dir=/usr/local/mysql
# On Mac OS X Leopard:
#   sudo env ARCHFLAGS="-arch i386" gem install mysql -- --with-mysql-config=/usr/local/mysql/bin/mysql_config
#       This sets the ARCHFLAGS environment variable to your native architecture
# On Windows:
#   gem install mysql
#       Choose the win32 build.
#       Install MySQL and put its /bin directory on your path.
#
# And be sure to use new-style password hashing:
#   http://dev.mysql.com/doc/refman/5.0/en/old-client.html
development:
  adapter: mysql
  encoding: utf8
  reconnect: false
  database: rubyweblog_development
  pool: 5
  username: root
  password:
  host: localhost
 
# Warning: The database defined as "test" will be erased and
# re-generated from your development database when you run "rake".
# Do not set this db to the same as development or production.
test:
  adapter: mysql
  encoding: utf8
  reconnect: false
  database: rubyweblog_test
  pool: 5
  username: root
  password:
  host: localhost
 
production:
  adapter: mysql
  encoding: utf8
  reconnect: false
  database: rubyweblog_production
  pool: 5
  username: root
  password:
  host: localhost
 
 
 
 
===========================
development.log
===========================
  SQL (0.0ms)   SET NAMES 'utf8'
  SQL (0.0ms)   SET SQL_AUTO_IS_NULL=0
 
 
Processing ApplicationController#index (for 127.0.0.1 at 2009-10-18 03:03:48) [GET]
 
NoMethodError (undefined method `scaffold' for BlogController:Class):
  app/controllers/blog_controller.rb:2
  c:/ruby/lib/ruby/1.8/webrick/httpserver.rb:104:in `service'
  c:/ruby/lib/ruby/1.8/webrick/httpserver.rb:65:in `run'
  c:/ruby/lib/ruby/1.8/webrick/server.rb:173:in `start_thread'
  c:/ruby/lib/ruby/1.8/webrick/server.rb:162:in `start'
  c:/ruby/lib/ruby/1.8/webrick/server.rb:162:in `start_thread'
  c:/ruby/lib/ruby/1.8/webrick/server.rb:95:in `start'
  c:/ruby/lib/ruby/1.8/webrick/server.rb:92:in `each'
  c:/ruby/lib/ruby/1.8/webrick/server.rb:92:in `start'
  c:/ruby/lib/ruby/1.8/webrick/server.rb:23:in `start'
  c:/ruby/lib/ruby/1.8/webrick/server.rb:82:in `start'
 
Rendered rescues/_trace (137.0ms)
Rendered rescues/_request_and_response (4.0ms)
Rendering rescues/layout (internal_server_error)
  SQL (0.0ms)   SET NAMES 'utf8'
  SQL (0.0ms)   SET SQL_AUTO_IS_NULL=0
 
 
Processing ApplicationController#index (for 127.0.0.1 at 2009-10-18 03:05:28) [GET]
 
NoMethodError (undefined method `scaffold' for BlogController:Class):
  app/controllers/blog_controller.rb:2
  c:/ruby/lib/ruby/1.8/webrick/httpserver.rb:104:in `service'
  c:/ruby/lib/ruby/1.8/webrick/httpserver.rb:65:in `run'
  c:/ruby/lib/ruby/1.8/webrick/server.rb:173:in `start_thread'
  c:/ruby/lib/ruby/1.8/webrick/server.rb:162:in `start'
  c:/ruby/lib/ruby/1.8/webrick/server.rb:162:in `start_thread'
  c:/ruby/lib/ruby/1.8/webrick/server.rb:95:in `start'
  c:/ruby/lib/ruby/1.8/webrick/server.rb:92:in `each'
  c:/ruby/lib/ruby/1.8/webrick/server.rb:92:in `start'
  c:/ruby/lib/ruby/1.8/webrick/server.rb:23:in `start'
  c:/ruby/lib/ruby/1.8/webrick/server.rb:82:in `start'
 
Rendered rescues/_trace (64.0ms)
Rendered rescues/_request_and_response (0.0ms)
Rendering rescues/layout (internal_server_error)
  SQL (0.0ms)   SET NAMES 'utf8'
  SQL (1.0ms)   SET SQL_AUTO_IS_NULL=0
 
 
Processing ApplicationController#index (for 127.0.0.1 at 2009-10-18 03:06:56) [GET]
 
NoMethodError (undefined method `scaffold' for BlogController:Class):
  app/controllers/blog_controller.rb:2
  c:/ruby/lib/ruby/1.8/webrick/httpserver.rb:104:in `service'
  c:/ruby/lib/ruby/1.8/webrick/httpserver.rb:65:in `run'
  c:/ruby/lib/ruby/1.8/webrick/server.rb:173:in `start_thread'
  c:/ruby/lib/ruby/1.8/webrick/server.rb:162:in `start'
  c:/ruby/lib/ruby/1.8/webrick/server.rb:162:in `start_thread'
  c:/ruby/lib/ruby/1.8/webrick/server.rb:95:in `start'
  c:/ruby/lib/ruby/1.8/webrick/server.rb:92:in `each'
  c:/ruby/lib/ruby/1.8/webrick/server.rb:92:in `start'
  c:/ruby/lib/ruby/1.8/webrick/server.rb:23:in `start'
  c:/ruby/lib/ruby/1.8/webrick/server.rb:82:in `start'
 
Rendered rescues/_trace (60.0ms)
Rendered rescues/_request_and_response (0.0ms)
Rendering rescues/layout (internal_server_error)
  SQL (1.0ms)   SET NAMES 'utf8'
  SQL (1.0ms)   SET SQL_AUTO_IS_NULL=0
  SQL (1.0ms)   SHOW TABLES
  SQL (0.0ms)   Mysql::Error: query: not connected: CREATE TABLE `schema_migrations` (`version` varchar(255) NOT NULL) ENGINE=InnoDB
  SQL (0.0ms)   SET NAMES 'utf8'
  SQL (1.0ms)   SET SQL_AUTO_IS_NULL=0
 
 
Processing ApplicationController#index (for 127.0.0.1 at 2009-10-18 03:08:55) [GET]
 
NoMethodError (undefined method `scaffold' for BlogController:Class):
  app/controllers/blog_controller.rb:2
  c:/ruby/lib/ruby/1.8/webrick/httpserver.rb:104:in `service'
  c:/ruby/lib/ruby/1.8/webrick/httpserver.rb:65:in `run'
  c:/ruby/lib/ruby/1.8/webrick/server.rb:173:in `start_thread'
  c:/ruby/lib/ruby/1.8/webrick/server.rb:162:in `start'
  c:/ruby/lib/ruby/1.8/webrick/server.rb:162:in `start_thread'
  c:/ruby/lib/ruby/1.8/webrick/server.rb:95:in `start'
  c:/ruby/lib/ruby/1.8/webrick/server.rb:92:in `each'
  c:/ruby/lib/ruby/1.8/webrick/server.rb:92:in `start'
  c:/ruby/lib/ruby/1.8/webrick/server.rb:23:in `start'
  c:/ruby/lib/ruby/1.8/webrick/server.rb:82:in `start'
 
  SQL (0.0ms)   SET NAMES 'utf8'
  SQL (1.0ms)   SET SQL_AUTO_IS_NULL=0
 
 
Processing ApplicationController#index (for 127.0.0.1 at 2009-10-18 03:09:19) [GET]
 
NoMethodError (undefined method `scaffold' for BlogController:Class):
  app/controllers/blog_controller.rb:2
  c:/ruby/lib/ruby/1.8/webrick/httpserver.rb:104:in `service'
  c:/ruby/lib/ruby/1.8/webrick/httpserver.rb:65:in `run'
  c:/ruby/lib/ruby/1.8/webrick/server.rb:173:in `start_thread'
  c:/ruby/lib/ruby/1.8/webrick/server.rb:162:in `start'
  c:/ruby/lib/ruby/1.8/webrick/server.rb:162:in `start_thread'
  c:/ruby/lib/ruby/1.8/webrick/server.rb:95:in `start'
  c:/ruby/lib/ruby/1.8/webrick/server.rb:92:in `each'
  c:/ruby/lib/ruby/1.8/webrick/server.rb:92:in `start'
  c:/ruby/lib/ruby/1.8/webrick/server.rb:23:in `start'
  c:/ruby/lib/ruby/1.8/webrick/server.rb:82:in `start'
 
Rendered rescues/_trace (131.0ms)
Rendered rescues/_request_and_response (4.0ms)
Rendering rescues/layout (internal_server_error)
  SQL (0.0ms)   SET NAMES 'utf8'
  SQL (0.0ms)   SET SQL_AUTO_IS_NULL=0
 
 
Processing ApplicationController#index (for 127.0.0.1 at 2009-10-18 03:13:08) [GET]
 
ActionController::RoutingError (No route matches "/" with {:method=>:get}):
  c:/ruby/lib/ruby/1.8/webrick/httpserver.rb:104:in `service'
  c:/ruby/lib/ruby/1.8/webrick/httpserver.rb:65:in `run'
  c:/ruby/lib/ruby/1.8/webrick/server.rb:173:in `start_thread'
  c:/ruby/lib/ruby/1.8/webrick/server.rb:162:in `start'
  c:/ruby/lib/ruby/1.8/webrick/server.rb:162:in `start_thread'
  c:/ruby/lib/ruby/1.8/webrick/server.rb:95:in `start'
  c:/ruby/lib/ruby/1.8/webrick/server.rb:92:in `each'
  c:/ruby/lib/ruby/1.8/webrick/server.rb:92:in `start'
  c:/ruby/lib/ruby/1.8/webrick/server.rb:23:in `start'
  c:/ruby/lib/ruby/1.8/webrick/server.rb:82:in `start'
 
Rendering rescues/layout (not_found)
  SQL (0.0ms)   SET NAMES 'utf8'
  SQL (1.0ms)   SET SQL_AUTO_IS_NULL=0
 
 
Processing ApplicationController#index (for 127.0.0.1 at 2009-10-18 03:14:00) [GET]
 
NoMethodError (undefined method `scaffold' for BlogController:Class):
  app/controllers/blog_controller.rb:2
  c:/ruby/lib/ruby/1.8/webrick/httpserver.rb:104:in `service'
  c:/ruby/lib/ruby/1.8/webrick/httpserver.rb:65:in `run'
  c:/ruby/lib/ruby/1.8/webrick/server.rb:173:in `start_thread'
  c:/ruby/lib/ruby/1.8/webrick/server.rb:162:in `start'
  c:/ruby/lib/ruby/1.8/webrick/server.rb:162:in `start_thread'
  c:/ruby/lib/ruby/1.8/webrick/server.rb:95:in `start'
  c:/ruby/lib/ruby/1.8/webrick/server.rb:92:in `each'
  c:/ruby/lib/ruby/1.8/webrick/server.rb:92:in `start'
  c:/ruby/lib/ruby/1.8/webrick/server.rb:23:in `start'
  c:/ruby/lib/ruby/1.8/webrick/server.rb:82:in `start'
 
Rendered rescues/_trace (70.0ms)
Rendered rescues/_request_and_response (1.0ms)
Rendering rescues/layout (internal_server_error)
  SQL (1.0ms)   SET NAMES 'utf8'
  SQL (1.0ms)   SET SQL_AUTO_IS_NULL=0
 
 
Processing ApplicationController#index (for 127.0.0.1 at 2009-10-18 03:15:39) [GET]
 
NoMethodError (undefined method `scaffold' for BlogController:Class):
  app/controllers/blog_controller.rb:2
  c:/ruby/lib/ruby/1.8/webrick/httpserver.rb:104:in `service'
  c:/ruby/lib/ruby/1.8/webrick/httpserver.rb:65:in `run'
  c:/ruby/lib/ruby/1.8/webrick/server.rb:173:in `start_thread'
  c:/ruby/lib/ruby/1.8/webrick/server.rb:162:in `start'
  c:/ruby/lib/ruby/1.8/webrick/server.rb:162:in `start_thread'
  c:/ruby/lib/ruby/1.8/webrick/server.rb:95:in `start'
  c:/ruby/lib/ruby/1.8/webrick/server.rb:92:in `each'
  c:/ruby/lib/ruby/1.8/webrick/server.rb:92:in `start'
  c:/ruby/lib/ruby/1.8/webrick/server.rb:23:in `start'
  c:/ruby/lib/ruby/1.8/webrick/server.rb:82:in `start'
 
Rendered rescues/_trace (60.0ms)
Rendered rescues/_request_and_response (1.0ms)
Rendering rescues/layout (internal_server_error)
  SQL (1.0ms)   SET NAMES 'utf8'
  SQL (1.0ms)   SET SQL_AUTO_IS_NULL=0
  SQL (1.0ms)   SHOW TABLES
  SQL (0.0ms)   Mysql::Error: query: not connected: SHOW TABLES
  SQL (1.0ms)   SET NAMES 'utf8'
  SQL (0.0ms)   SET SQL_AUTO_IS_NULL=0
  SQL (1.0ms)   SHOW TABLES
  SQL (0.0ms)   Mysql::Error: query: not connected: SHOW TABLES
  SQL (0.0ms)   SET NAMES 'utf8'
  SQL (0.0ms)   SET SQL_AUTO_IS_NULL=0
  SQL (1.0ms)   SHOW TABLES
  SQL (0.0ms)   Mysql::Error: query: not connected: CREATE TABLE `schema_migrations` (`version` varchar(255) NOT NULL) ENGINE=InnoDB
  SQL (1.0ms)   SET NAMES 'utf8'
  SQL (0.0ms)   SET SQL_AUTO_IS_NULL=0
  SQL (1.0ms)   SHOW TABLES
  SQL (0.0ms)   Mysql::Error: query: not connected: CREATE TABLE `schema_migrations` (`version` varchar(255) NOT NULL) ENGINE=InnoDB
  SQL (0.0ms)   SET NAMES 'utf8'
  SQL (1.0ms)   SET SQL_AUTO_IS_NULL=0
  SQL (1.0ms)   SHOW TABLES
  SQL (0.0ms)   Mysql::Error: query: not connected: SHOW TABLES
  SQL (1.0ms)   SET NAMES 'utf8'
  SQL (0.0ms)   SET SQL_AUTO_IS_NULL=0
  SQL (1.0ms)   SHOW TABLES
  SQL (0.0ms)   Mysql::Error: query: not connected: SHOW TABLES
  SQL (0.0ms)   SET NAMES 'utf8'
  SQL (1.0ms)   SET SQL_AUTO_IS_NULL=0
  SQL (1.0ms)   SHOW TABLES
  SQL (0.0ms)   Mysql::Error: query: not connected: SHOW TABLES
[+][-]10/18/09 09:01 AM, ID: 25600277Accepted Solution

View this solution now by starting your 30-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

About this solution

Zones: RubyOnRails, Ruby Scripting Language, MySQL Server
Tags: ruby on rails, ruby
Sign Up Now!
Solution Provided By: wesgarrison
Participating Experts: 1
Solution Grade: A
 
 
Loading Advertisement...
20091111-EE-VQP-89 - Hierarchy / EE_QW_3_20080625