0

I'm trying to start a server on rails but it isn't working, any ideas on why that might be? I haven't edited the proyect, this is my first try at starting it. I've reinstalled gems and used bundle install with some different options, but all to no avail. I'm working on 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>'

UPDATE: I ran the same command on a new proyect located on another folder without any strange characters (Such as "á"), also unsuccessfully. Here's the new error.

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>'
jabsatz
  • 341
  • 3
  • 10
  • Make sure that file is present at: C:/Users/Julián/Documents/Sites/simple_cms/config/application.rb – Abdul Baig Jul 11 '14 at 03:23
  • The file exists, it contains the following: require File.expand_path('../boot', __FILE__) require 'rails/all' Bundler.require(*Rails.groups) module SimpleCms class Application < Rails::Application end end – jabsatz Jul 11 '14 at 03:49

3 Answers3

0

It looks like command_tasks.rb cannot find your application file. It's probably because of the path name. C:/Users/Julián/Documents/Sites/simple_cms/config/application It looks like it mistook your name Julián for Julián

louiedp3
  • 78
  • 6
  • That's what i thought at first so I tried it again with a new folder on "Public" user, but I got the same error – jabsatz Jul 11 '14 at 03:32
  • Do you still have the output for the public user? – louiedp3 Jul 11 '14 at 03:37
  • Looking at the new error do you have mysql installed? – louiedp3 Jul 11 '14 at 05:02
  • It seems other people have had this problem and had to copy `libmysql.dll' to the ruby bin directory. http://stackoverflow.com/questions/5164818/loaderror-trying-to-use-mysql-with-ruby-on-rails-in-windows-rubymine-ide – louiedp3 Jul 11 '14 at 05:06
0

Bundle Install

Could be wrong, but certainly seems you have a lack of the mysql2 gem, or the mysql files Rails needs to load your app.

Confirmation of this would come if you performed bundle install on your system - I surmise the mysql gem would fail


MYSQL Gem

Considering you're on Windows, you've probably not got the MYSQL2 gem installed - standard issue which we wrote a tutorial about here:

  1. Install any MYSQL C-Connector Header files on your system
  2. Install the mysql2 gem with the relevant arguments
  3. Copy the libmysql.dll file to your ruby/bin directory

The C-Connector header files are vital for Windows, as they allow your system to "read" the MYSQL commands / requests. These are not installed by default, so you have to install them yourself (it's only to install the gem, then you can get rid of them if you want):

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

Install this file, then you can use the following install command:

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

This should install the gem on your system, which you'll then be able to finish by transferring libmysql.dll from your mysql files' bin directory to your ruby/bin directory:

enter image description here

Richard Peck
  • 76,116
  • 9
  • 93
  • 147
-1

May be, in other way you should try virtual machine with Linux (Ubuntu). I started first time rails with Windows but it was so hard to operate gems and environment.