Reputation: 1
I'm learning ruby on rails. wile building a small app, server was disconnected and won't connect again.
Using:
rails server
I am in the app directory.(double, triple checked...).
connecting to the server was working perfectly for a while then just stopped.
I'm Using Mysql.
Rails server starts perfectly fine on other apps I'm working on.
those are my versions:
root@R://# ruby --version
ruby 2.2.2p95 (2015-04-13 revision 50295) [x86_64-linux]
root@R://# rails -v
Rails 4.2.1
and mysql version:
+-------------------------+-------------------------+
| Variable_name | Value |
+-------------------------+-------------------------+
| innodb_version | 5.5.43 |
| protocol_version | 10 |
| slave_type_conversions | |
| version | 5.5.43-0ubuntu0.14.04.1 |
| version_comment | (Ubuntu) |
| version_compile_machine | x86_64 |
| version_compile_os | debian-linux-gnu |
+-------------------------+-------------------------+
this is the output for
rails server
root@R://home/ruby/Projects/SempleApp# rails server
=> Booting WEBrick
=> Rails 4.2.1 application starting in development on http://localhost:3000
=> Run
rails server -hfor more startup options
=> Ctrl-C to shutdown server
Exiting
my database.yml file is set ok and i did not changed it since the server was connecting.
I restarted Mysql service. Restarted the terminal and restarted the whole computer.. and this app still cannot connect to the server Other apps can..
I'm stuck... can't find answer anywhere. Help...
PS- This is my first Q in here. Hope I gave the right info.
Thanks
Full error:
root@ruby-man://home/ruby/Projects/TweetrWork# rails server
=> Booting WEBrick
=> Rails 4.2.1 application starting in development on http://localhost:3000
=> Run
rails server -h
for more startup options
=> Ctrl-C to shutdown server
Exiting
/home/ruby/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/activesupport-4.2.1/lib/active_support/dependencies.rb:268:in load': /home/ruby/Projects/TweetrWork/config/routes.rb:60: syntax error, unexpected end-of-input, expecting keyword_end (SyntaxError)
from /home/ruby/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/activesupport-4.2.1/lib/active_support/dependencies.rb:268:in
block in load'
from /home/ruby/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/activesupport-4.2.1/lib/active_support/dependencies.rb:240:in load_dependency'
from /home/ruby/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/activesupport-4.2.1/lib/active_support/dependencies.rb:268:in
load'
from /home/ruby/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/railties-4.2.1/lib/rails/application/routes_reloader.rb:40:in block in load_paths'
from /home/ruby/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/railties-4.2.1/lib/rails/application/routes_reloader.rb:40:in
each'
from /home/ruby/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/railties-4.2.1/lib/rails/application/routes_reloader.rb:40:in load_paths'
from /home/ruby/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/railties-4.2.1/lib/rails/application/routes_reloader.rb:16:in
reload!'
from /home/ruby/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/railties-4.2.1/lib/rails/application/routes_reloader.rb:26:in block in updater'
from /home/ruby/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/activesupport-4.2.1/lib/active_support/file_update_checker.rb:75:in
call'
from /home/ruby/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/activesupport-4.2.1/lib/active_support/file_update_checker.rb:75:in execute'
from /home/ruby/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/railties-4.2.1/lib/rails/application/routes_reloader.rb:27:in
updater'
from /home/ruby/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/railties-4.2.1/lib/rails/application/routes_reloader.rb:7:in execute_if_updated'
from /home/ruby/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/railties-4.2.1/lib/rails/application/finisher.rb:69:in
block in '
from /home/ruby/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/railties-4.2.1/lib/rails/initializable.rb:30:in instance_exec'
from /home/ruby/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/railties-4.2.1/lib/rails/initializable.rb:30:in
run'
from /home/ruby/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/railties-4.2.1/lib/rails/initializable.rb:55:in block in run_initializers'
from /home/ruby/.rbenv/versions/2.2.2/lib/ruby/2.2.0/tsort.rb:226:in
block in tsort_each'
from /home/ruby/.rbenv/versions/2.2.2/lib/ruby/2.2.0/tsort.rb:348:in block (2 levels) in each_strongly_connected_component'
from /home/ruby/.rbenv/versions/2.2.2/lib/ruby/2.2.0/tsort.rb:429:in
each_strongly_connected_component_from'
from /home/ruby/.rbenv/versions/2.2.2/lib/ruby/2.2.0/tsort.rb:347:in block in each_strongly_connected_component'
from /home/ruby/.rbenv/versions/2.2.2/lib/ruby/2.2.0/tsort.rb:345:in
each'
from /home/ruby/.rbenv/versions/2.2.2/lib/ruby/2.2.0/tsort.rb:345:in call'
from /home/ruby/.rbenv/versions/2.2.2/lib/ruby/2.2.0/tsort.rb:345:in
each_strongly_connected_component'
from /home/ruby/.rbenv/versions/2.2.2/lib/ruby/2.2.0/tsort.rb:224:in tsort_each'
from /home/ruby/.rbenv/versions/2.2.2/lib/ruby/2.2.0/tsort.rb:203:in
tsort_each'
from /home/ruby/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/railties-4.2.1/lib/rails/initializable.rb:54:in run_initializers'
from /home/ruby/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/railties-4.2.1/lib/rails/application.rb:352:in
initialize!'
from /home/ruby/Projects/TweetrWork/config/environment.rb:5:in <top (required)>'
from /home/ruby/Projects/TweetrWork/config.ru:3:in
require'
from /home/ruby/Projects/TweetrWork/config.ru:3:in block in <main>'
from /home/ruby/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/rack-1.6.4/lib/rack/builder.rb:55:in
instance_eval'
from /home/ruby/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/rack-1.6.4/lib/rack/builder.rb:55:in initialize'
from /home/ruby/Projects/TweetrWork/config.ru:in
new'
from /home/ruby/Projects/TweetrWork/config.ru:in <main>'
from /home/ruby/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/rack-1.6.4/lib/rack/builder.rb:49:in
eval'
from /home/ruby/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/rack-1.6.4/lib/rack/builder.rb:49:in new_from_string'
from /home/ruby/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/rack-1.6.4/lib/rack/builder.rb:40:in
parse_file'
from /home/ruby/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/rack-1.6.4/lib/rack/server.rb:299:in build_app_and_options_from_config'
from /home/ruby/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/rack-1.6.4/lib/rack/server.rb:208:in
app'
from /home/ruby/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/railties-4.2.1/lib/rails/commands/server.rb:61:in app'
from /home/ruby/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/rack-1.6.4/lib/rack/server.rb:336:in
wrapped_app'
from /home/ruby/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/railties-4.2.1/lib/rails/commands/server.rb:139:in log_to_stdout'
from /home/ruby/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/railties-4.2.1/lib/rails/commands/server.rb:78:in
start'
from /home/ruby/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/railties-4.2.1/lib/rails/commands/commands_tasks.rb:80:in block in server'
from /home/ruby/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/railties-4.2.1/lib/rails/commands/commands_tasks.rb:75:in
tap'
from /home/ruby/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/railties-4.2.1/lib/rails/commands/commands_tasks.rb:75:in server'
from /home/ruby/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/railties-4.2.1/lib/rails/commands/commands_tasks.rb:39:in
run_command!'
from /home/ruby/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/railties-4.2.1/lib/rails/commands.rb:17:in <top (required)>'
from /home/ruby/Projects/TweetrWork/bin/rails:8:in
require'
from /home/ruby/Projects/TweetrWork/bin/rails:8:in <top (required)>'
from /home/ruby/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/spring-1.3.6/lib/spring/client/rails.rb:28:in
load'
from /home/ruby/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/spring-1.3.6/lib/spring/client/rails.rb:28:in call'
from /home/ruby/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/spring-1.3.6/lib/spring/client/command.rb:7:in
call'
from /home/ruby/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/spring-1.3.6/lib/spring/client.rb:26:in run'
from /home/ruby/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/spring-1.3.6/bin/spring:48:in
'
from /home/ruby/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/spring-1.3.6/lib/spring/binstub.rb:11:in load'
from /home/ruby/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/spring-1.3.6/lib/spring/binstub.rb:11:in
'
from /home/ruby/.rbenv/versions/2.2.2/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:in require'
from /home/ruby/.rbenv/versions/2.2.2/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:in
require'
from /home/ruby/Projects/TweetrWork/bin/spring:13:in <top (required)>'
from bin/rails:3:in
load'
from bin/rails:3:in `'
Upvotes: 0
Views: 349
Reputation: 2344
The answer is here:
4.2.1/lib/active_support/dependencies.rb:268:in load': /home/ruby/Projects/TweetrWork/config/routes.rb:60: syntax error, unexpected end-of-input, **expecting keyword_end (SyntaxError)**
This is a typo in your code. As written by Prashant4224 adding end at the right place in /home/ruby/Projects/TweetrWork/config/routes.rb
should fix the problem
Upvotes: 0