简体   繁体   English

无法在3.2.6系统上启动Rails服务器

[英]Can't start Rails server on 3.2.6 system

I am having a major issue trying to start my Rails project. 我在尝试启动Rails项目时遇到一个重大问题。 I am taking a rails 4.0.0 project and trying to run it on a Rails 3.2.6 system. 我正在使用Rails 4.0.0项目,并尝试在Rails 3.2.6系统上运行它。 My work environment uses a Rails 3.2.6 environment and my system at home where I was working from home (a mac mini) uses rails 4. I have since started using my Linux laptop which has Rails 3.2.6 like my employer uses. 我的工作环境使用Rails 3.2.6环境,而我在家中工作的系统(Mac mini)使用Rails4。从那时起,我开始使用Linux笔记本电脑,该笔记本电脑具有雇主使用的Rails 3.2.6。

Here is my error trace: 这是我的错误跟踪:

ironmantis7x@ironscribe5:~/RoR_projects/mock_devices2$ rails server
=> Booting WEBrick
=> Rails 3.2.6 application starting in development on http://0.0.0.0:3000
=> Call with -d to detach
=> Ctrl-C to shutdown server
Exiting
/home/ironmantis7x/.rvm/gems/ruby-1.9.3-p448@rails_testbed1/gems/actionpack-3.2.6/lib/action_dispatch/routing/mapper.rb:260:in `merge': can't convert String into Hash (TypeError)
        from /home/ironmantis7x/.rvm/gems/ruby-1.9.3-p448@rails_testbed1/gems/actionpack-3.2.6/lib/action_dispatch/routing/mapper.rb:260:in `root'
        from /home/ironmantis7x/.rvm/gems/ruby-1.9.3-p448@rails_testbed1/gems/actionpack-3.2.6/lib/action_dispatch/routing/mapper.rb:1317:in `root'
        from /home/ironmantis7x/RoR_projects/mock_devices2/config/routes.rb:10:in `block in <top (required)>'
        from /home/ironmantis7x/.rvm/gems/ruby-1.9.3-p448@rails_testbed1/gems/actionpack-3.2.6/lib/action_dispatch/routing/route_set.rb:282:in `instance_exec'
        from /home/ironmantis7x/.rvm/gems/ruby-1.9.3-p448@rails_testbed1/gems/actionpack-3.2.6/lib/action_dispatch/routing/route_set.rb:282:in `eval_block'
        from /home/ironmantis7x/.rvm/gems/ruby-1.9.3-p448@rails_testbed1/gems/actionpack-3.2.6/lib/action_dispatch/routing/route_set.rb:260:in `draw'
        from /home/ironmantis7x/RoR_projects/mock_devices2/config/routes.rb:1:in `<top (required)>'
        from /home/ironmantis7x/.rvm/gems/ruby-1.9.3-p448@rails_testbed1/gems/activesupport-3.2.6/lib/active_support/dependencies.rb:245:in `load'
        from /home/ironmantis7x/.rvm/gems/ruby-1.9.3-p448@rails_testbed1/gems/activesupport-3.2.6/lib/active_support/dependencies.rb:245:in `block in load'
        from /home/ironmantis7x/.rvm/gems/ruby-1.9.3-p448@rails_testbed1/gems/activesupport-3.2.6/lib/active_support/dependencies.rb:236:in `load_dependency'
        from /home/ironmantis7x/.rvm/gems/ruby-1.9.3-p448@rails_testbed1/gems/activesupport-3.2.6/lib/active_support/dependencies.rb:245:in `load'
        from /home/ironmantis7x/.rvm/gems/ruby-1.9.3-p448@rails_testbed1/gems/railties-3.2.6/lib/rails/application/routes_reloader.rb:40:in `block in load_paths'
        from /home/ironmantis7x/.rvm/gems/ruby-1.9.3-p448@rails_testbed1/gems/railties-3.2.6/lib/rails/application/routes_reloader.rb:40:in `each'
        from /home/ironmantis7x/.rvm/gems/ruby-1.9.3-p448@rails_testbed1/gems/railties-3.2.6/lib/rails/application/routes_reloader.rb:40:in `load_paths'
        from /home/ironmantis7x/.rvm/gems/ruby-1.9.3-p448@rails_testbed1/gems/railties-3.2.6/lib/rails/application/routes_reloader.rb:16:in `reload!'
        from /home/ironmantis7x/.rvm/gems/ruby-1.9.3-p448@rails_testbed1/gems/railties-3.2.6/lib/rails/application/routes_reloader.rb:26:in `block in updater'
        from /home/ironmantis7x/.rvm/gems/ruby-1.9.3-p448@rails_testbed1/gems/activesupport-3.2.6/lib/active_support/file_update_checker.rb:78:in `call'
        from /home/ironmantis7x/.rvm/gems/ruby-1.9.3-p448@rails_testbed1/gems/activesupport-3.2.6/lib/active_support/file_update_checker.rb:78:in `execute'
        from /home/ironmantis7x/.rvm/gems/ruby-1.9.3-p448@rails_testbed1/gems/railties-3.2.6/lib/rails/application/routes_reloader.rb:27:in `updater'
        from /home/ironmantis7x/.rvm/gems/ruby-1.9.3-p448@rails_testbed1/gems/railties-3.2.6/lib/rails/application/routes_reloader.rb:7:in `execute_if_updated'
        from /home/ironmantis7x/.rvm/gems/ruby-1.9.3-p448@rails_testbed1/gems/railties-3.2.6/lib/rails/application/finisher.rb:66:in `block in <module:Finisher>'
        from /home/ironmantis7x/.rvm/gems/ruby-1.9.3-p448@rails_testbed1/gems/railties-3.2.6/lib/rails/initializable.rb:30:in `instance_exec'
        from /home/ironmantis7x/.rvm/gems/ruby-1.9.3-p448@rails_testbed1/gems/railties-3.2.6/lib/rails/initializable.rb:30:in `run'
        from /home/ironmantis7x/.rvm/gems/ruby-1.9.3-p448@rails_testbed1/gems/railties-3.2.6/lib/rails/initializable.rb:55:in `block in run_initializers'
        from /home/ironmantis7x/.rvm/gems/ruby-1.9.3-p448@rails_testbed1/gems/railties-3.2.6/lib/rails/initializable.rb:54:in `each'
        from /home/ironmantis7x/.rvm/gems/ruby-1.9.3-p448@rails_testbed1/gems/railties-3.2.6/lib/rails/initializable.rb:54:in `run_initializers'
        from /home/ironmantis7x/.rvm/gems/ruby-1.9.3-p448@rails_testbed1/gems/railties-3.2.6/lib/rails/application.rb:136:in `initialize!'
        from /home/ironmantis7x/.rvm/gems/ruby-1.9.3-p448@rails_testbed1/gems/railties-3.2.6/lib/rails/railtie/configurable.rb:30:in `method_missing'
        from /home/ironmantis7x/RoR_projects/mock_devices2/config/environment.rb:5:in `<top (required)>'
        from /home/ironmantis7x/RoR_projects/mock_devices2/config.ru:4:in `require'
        from /home/ironmantis7x/RoR_projects/mock_devices2/config.ru:4:in `block in <main>'
        from /home/ironmantis7x/.rvm/gems/ruby-1.9.3-p448@rails_testbed1/gems/rack-1.4.1/lib/rack/builder.rb:51:in `instance_eval'
        from /home/ironmantis7x/.rvm/gems/ruby-1.9.3-p448@rails_testbed1/gems/rack-1.4.1/lib/rack/builder.rb:51:in `initialize'
        from /home/ironmantis7x/RoR_projects/mock_devices2/config.ru:1:in `new'
        from /home/ironmantis7x/RoR_projects/mock_devices2/config.ru:1:in `<main>'
        from /home/ironmantis7x/.rvm/gems/ruby-1.9.3-p448@rails_testbed1/gems/rack-1.4.1/lib/rack/builder.rb:40:in `eval'
        from /home/ironmantis7x/.rvm/gems/ruby-1.9.3-p448@rails_testbed1/gems/rack-1.4.1/lib/rack/builder.rb:40:in `parse_file'
        from /home/ironmantis7x/.rvm/gems/ruby-1.9.3-p448@rails_testbed1/gems/rack-1.4.1/lib/rack/server.rb:200:in `app'
        from /home/ironmantis7x/.rvm/gems/ruby-1.9.3-p448@rails_testbed1/gems/railties-3.2.6/lib/rails/commands/server.rb:46:in `app'
        from /home/ironmantis7x/.rvm/gems/ruby-1.9.3-p448@rails_testbed1/gems/rack-1.4.1/lib/rack/server.rb:301:in `wrapped_app'
        from /home/ironmantis7x/.rvm/gems/ruby-1.9.3-p448@rails_testbed1/gems/rack-1.4.1/lib/rack/server.rb:252:in `start'
        from /home/ironmantis7x/.rvm/gems/ruby-1.9.3-p448@rails_testbed1/gems/railties-3.2.6/lib/rails/commands/server.rb:70:in `start'
        from /home/ironmantis7x/.rvm/gems/ruby-1.9.3-p448@rails_testbed1/gems/railties-3.2.6/lib/rails/commands.rb:55:in `block in <top (required)>'
        from /home/ironmantis7x/.rvm/gems/ruby-1.9.3-p448@rails_testbed1/gems/railties-3.2.6/lib/rails/commands.rb:50:in `tap'
        from /home/ironmantis7x/.rvm/gems/ruby-1.9.3-p448@rails_testbed1/gems/railties-3.2.6/lib/rails/commands.rb:50:in `<top (required)>'
        from script/rails:6:in `require'
        from script/rails:6:in `<main>'
ironmantis7x@ironscribe5:~/RoR_projects/mock_devices2$ 

Here is my environment.rb file: 这是我的environment.rb文件:

# Load the Rails application.
require File.expand_path('../application', __FILE__)

# Initialize the Rails application.
MockDevices2::Application.initialize!

And here is my boot.rb file: 这是我的boot.rb文件:

# Set up gems listed in the Gemfile.
ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__)

require 'bundler/setup' if File.exists?(ENV['BUNDLE_GEMFILE'])
require 'thread'

my gem list is as follows: 我的宝石清单如下:

actionmailer (3.2.6)
actionpack (3.2.6)
activemodel (3.2.6)
activerecord (3.2.6)
activeresource (3.2.6)
activesupport (3.2.6)
arel (3.0.2)
builder (3.0.4)
bundler (1.3.5)
bundler-unload (1.0.1)
coffee-rails (3.2.2)
coffee-script (2.2.0)
coffee-script-source (1.6.2)
erubis (2.7.0)
execjs (1.4.0)
hike (1.2.3)
i18n (0.6.4)
jbuilder (1.4.2)
journey (1.0.4)
jquery-rails (3.0.1)
json (1.8.0)
mail (2.4.4)
mime-types (1.23)
mini_portile (0.5.0)
multi_json (1.7.7)
nokogiri (1.6.0)
polyglot (0.3.3)
rack (1.4.1)
rack-cache (1.2)
rack-ssl (1.3.3)
rack-test (0.6.2)
rails (3.2.6)
railties (3.2.6)
rake (10.1.0)
rdoc (3.12.2)
rubygems-bundler (1.2.0)
rvm (1.11.3.8)
sass (3.2.9)
sass-rails (3.2.6)
sdoc (0.3.20)
sprockets (2.1.3)
sqlite3 (1.3.7)
thor (0.18.1)
tilt (1.4.1)
treetop (1.4.14)
turbolinks (1.2.0)
tzinfo (0.3.37)
uglifier (2.1.1)

Can you post your routes.rb? 你可以发布您的routes.rb吗? Seems like the problem is at 似乎问题出在

from /home/ironmantis7x/RoR_projects/mock_devices2/config/routes.rb:10:in `block in <top (required)>'

This happened to me and the problem was that I used 这发生在我身上,问题是我使用了

root 'welcome#index'

instead of 代替

root to: 'welcome#index'

and rails 3 doesn't like that Rails 3不喜欢那样

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM