2014-07-11 190 views
0

我试图在rails上启动服务器,但它不工作,对于为什么可能会有任何想法?我没有编辑过这个项目,这是我第一次尝试启动它。我已经重新安装了宝石,并使用一些不同的选项捆绑安装,但都没有用。我正在使用Windows。Ruby on rails服务器无法启动

C:\Users\Julián\Documents\Sites\simple_cms>rails server 
C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/railties-4.1.4/lib/rails/commands/comman 
ds_tasks.rb:79:in `require': cannot load such file -- C:/Users/Julián/Documents/Sites/simple_cms/config/application (LoadError) 
    from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/railties-4.1.4/lib/rails/commands/commands_tasks.rb:79:in `block in server' 
    from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/railties-4.1.4/lib/rails/commands/commands_tasks.rb:76:in `tap' 
    from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/railties-4.1.4/lib/rails/commands/commands_tasks.rb:76:in `server' 
    from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/railties-4.1.4/lib/rails/commands/commands_tasks.rb:40:in `run_command!' 
    from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/railties-4.1.4/lib/rails/commands.rb:17:in `<top (required)>' 
    from bin/rails:4:in `require' 
    from bin/rails:4:in `<main>' 

更新: 我跑在位于另一个文件夹没有任何奇怪的字符(如“A”)的新proyect相同的命令,也没有成功。这是新的错误。

C:\Users\Public\Sites\simple_cms>rails server 
C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/mysql2-0.3.16/lib/mysql2.rb:8:in `require': 126: The specified module could not be found. - C:/Ruby200-x64/lib/ruby/gems/2.0.0/extensions/x64-mingw32/2.0.0/mysql2-0.3.16/mysql2/mysql2.so (LoadError) 

    from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/mysql2-0.3.16/lib/mysql2.rb:8:in `<top (required)>' 
    from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/bundler-1.6.3/lib/bundler/runtime.rb:76:in `require' 
    from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/bundler-1.6.3/lib/bundler/runtime.rb:76:in `block (2 levels) in require' 
    from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/bundler-1.6.3/lib/bundler/runtime.rb:72:in `each' 
    from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/bundler-1.6.3/lib/bundler/runtime.rb:72:in `block in require' 
    from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/bundler-1.6.3/lib/bundler/runtime.rb:61:in `each' 
    from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/bundler-1.6.3/lib/bundler/runtime.rb:61:in `require' 
    from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/bundler-1.6.3/lib/bundler.rb:132:in `require'  from C:/Users/Public/Sites/simple_cms/config/application.rb:7:in `<top (required)>' 
    from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/railties-4.1.4/lib/rails/commands/commands_tasks.rb:79:in `require' 
    from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/railties-4.1.4/lib/rails/commands/commands_tasks.rb:79:in `block in server' 
    from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/railties-4.1.4/lib/rails/commands/commands_tasks.rb:76:in `tap' 
    from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/railties-4.1.4/lib/rails/commands/commands_tasks.rb:76:in `server' 
    from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/railties-4.1.4/lib/rails/commands/commands_tasks.rb:40:in `run_command!' 
    from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/railties-4.1.4/lib/rails/commands.rb:17:in `<top (required)>' 
    from bin/rails:4:in `require' 
    from bin/rails:4:in `<main>' 
+0

确保文件存在于C:/Users/Julián/Documents/Sites/simple_cms/config/application.rb –

+0

文件存在,它包含以下内容: 需要File.expand_path(”。 ./boot”,__FILE__) 要求‘导轨/全部’ Bundler.require(* Rails.groups) 模块SimpleCms 类应用<滑轨::应用 结束 结束 – ziozxzioz

回答

0

看起来像command_tasks.rb找不到您的应用程序文件。这可能是因为路径名称。 C:/Users/Julián/Documents/Sites/simple_cms/config/application看起来它误以为你的名字JuliánJulián

+0

这就是我开始还以为等我试了一下再次与“公共”用户的新文件夹,但我得到了同样的错误 – ziozxzioz

+0

你仍然有公共用户的输出? – louiedp3

+0

我使用“公共”输出更新了文档 – ziozxzioz

0

捆绑安装

可能是错的,但肯定似乎你有一个缺乏mysql2宝石,或mysql文件Rails需要加载的应用程序。

如果您的系统上执行 bundle install

确认这会来 - 我揣mysql宝石会失败


MYSQL宝石

考虑您使用的是Windows,你可能已经没有安装MYSQL2 gem - 我们编写了关于here的教程的标准问题:

  1. 在系统上安装任何MYSQL C-Connector Header files
  2. 安装mysql2宝石与相关参数
  3. 复制的libmysql.dll文件到您的ruby/bin目录

的C-连接器的头文件是至关重要的Windows,因为它们允许您的系统“读取”MYSQL命令/请求。这些都不是默认安装的,所以你必须自己安装它们(这只是安装宝石,那么你就可以摆脱他们,如果你想):

http://dev.mysql.com/downloads/connector/c/

安装此文件,那么你就可以请使用以下安装命令:

gem install mysql2 --platform=ruby -- '--with-mysql-dir="C:\mysql-connector-path"' 

应该您的系统,然后您就可以从你的MySQL文件bin目录转移libmysql.dllruby/bin目录来完成上安装宝石:

enter image description here

+0

我试过了这和它没有工作,同样的错误 – ziozxzioz

-1

可能是,在其他的方式,你应该尝试的虚拟机使用Linux(Ubuntu的)。 我开始使用Windows的第一次轨道,但它很难操作宝石和环境。