我正在尝试在rails上启动一个服务器,但是它不工作,你知道为什么会这样吗?我还没有编辑proyect,这是我第一次尝试启动它。我重新安装了gem,并使用了捆绑安装和一些不同的选项,但都没有用。我在Windows上工作。
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>'更新:我在另一个文件夹上的一个新项目上运行了相同的命令,没有任何奇怪的字符(如“α”),也没有成功。这是新的错误。
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>'发布于 2014-07-11 11:25:28
看起来command_tasks.rb找不到您的应用程序文件。可能是因为路径名的原因。C:/Users/Julián/Documents/Sites/simple_cms/config/application看起来像是把你的名字Julián误认为Julián了
发布于 2014-07-11 15:13:12
捆绑包安装
可能是错误的,但看起来你肯定缺乏Rails加载应用程序所需的mysql2 gem或mysql文件。
如果您在系统上执行bundle install,就会确认这一点-我猜测mysql gem将失败
MYSQL Gem
考虑到您使用的是Windows,您可能还没有安装我们在有关here的教程中编写的MYSQL2 gem标准版本
将包含相关arguments
mysql2 gem上的ruby/bin目录C-Connector头文件对于Windows至关重要,因为它们允许您的系统“读取”MYSQL命令/请求。默认情况下不会安装它们,所以您必须自己安装它们(只需安装gem,然后您可以根据需要删除它们):

安装此文件,然后可以使用以下安装命令:
gem install mysql2 --platform=ruby -- '--with-mysql-dir="C:\mysql-connector-path"'这将在您的系统上安装gem,然后您可以通过将libmysql.dll从mysql文件的bin目录转移到您的ruby/bin目录来完成安装:

发布于 2014-07-11 16:59:30
也许,在其他方面,你应该尝试使用Linux (Ubuntu)的虚拟机。我第一次使用Windows开始使用rails,但是操作gem和环境太难了。
https://stackoverflow.com/questions/24689483
复制相似问题