Jump to content

The ultimate community for Ruby on Rails developers.


Photo

New windows installation - guard give errors

guard windows

  • Please log in to reply
39 replies to this topic

#21 james

james

    Guard

  • Moderators
  • 221 posts
  • LocationLeeds, U.K.

Posted 26 August 2013 - 03:50 AM

Please forgive my ignorance - I'm Brand New at this and have no clue what I'm doing :)

 

 

Nothing to forgive. You have asked for help and you are following advice. That's all anyone can ask for.

 

I'm starting to think there is something very wrong with your setup, but at this stage it's only a suspicion so don;t do anything drastic.

 

What happens if you start your server?

rails s

 (or rails server if you prefer), again to be run in the root of your application. Can you post the output? And if the server starts successfully what happens if you navigate to

http://localhost:3000

in your browser?


Programming is just about problem solving!


#22 etech0

etech0

    Signalman

  • Members
  • 18 posts

Posted 26 August 2013 - 03:56 AM

Funny - when I run rails s, I get a similar type of thing:

Usage:
  rails new APP_PATH [options]

Options:
  -r, [--ruby=PATH]              # Path to the Ruby binary of your choice
                                 # Default: C:/RailsInstaller/Ruby1.9.3/bin/ruby.exe
  -m, [--template=TEMPLATE]      # Path to some application template (can be a filesystem path
or URL)
      [--skip-gemfile]           # Don't create a Gemfile
  -B, [--skip-bundle]            # Don't run bundle install
  -G, [--skip-git]               # Skip .gitignore file
      [--skip-keeps]             # Skip source control .keep files
  -O, [--skip-active-record]     # Skip Active Record files
  -S, [--skip-sprockets]         # Skip Sprockets files
  -d, [--database=DATABASE]      # Preconfigure for selected database (options: mysql/oracle/postgresql/sqlite3/frontbase/ibm_db/sqlserver/jdbcmysql/jdbcsqlite3/jdbcpostgresql/jdbc)
                                 # Default: sqlite3
  -j, [--javascript=JAVASCRIPT]  # Preconfigure for selected JavaScript library
                                 # Default: jquery
  -J, [--skip-javascript]        # Skip JavaScript files
      [--dev]                    # Setup the application with Gemfile pointing to your Rails checkout
      [--edge]                   # Setup the application with Gemfile pointing to Rails repository
  -T, [--skip-test-unit]         # Skip Test::Unit files
      [--rc=RC]                  # Path to file containing extra configuration options for rails command
      [--no-rc]                  # Skip loading of extra configuration options from .railsrc file

Runtime options:
  -f, [--force]    # Overwrite files that already exist
  -p, [--pretend]  # Run but do not make any changes
  -q, [--quiet]    # Suppress status output
  -s, [--skip]     # Skip files that already exist

Rails options:
  -h, [--help]     # Show this help message and quit
  -v, [--version]  # Show Rails version number and quit

Description:
    The 'rails new' command creates a new Rails application with a default
    directory structure and configuration at the path you specify.

    You can specify extra command-line arguments to be used every time
    'rails new' runs in the .railsrc configuration file in your home directory.

    Note that the arguments specified in the .railsrc file don't affect the
    defaults values shown above in this help message.

Example:
    rails new ~/Code/Ruby/weblog

    This generates a skeletal Rails installation in ~/Code/Ruby/weblog.
    See the README in the newly created application to get going.

c:\Sites\tasks>


#23 james

james

    Guard

  • Moderators
  • 221 posts
  • LocationLeeds, U.K.

Posted 26 August 2013 - 04:31 AM

can you post up a directory listing of the c:\Sites\tasks folder


Programming is just about problem solving!


#24 etech0

etech0

    Signalman

  • Members
  • 18 posts

Posted 26 August 2013 - 05:23 AM

Here's the dir:

 Volume in drive C is OS
 Volume Serial Number is CE01-543F

 Directory of c:\Sites\tasks

08/26/2013  01:17 AM    <DIR>          .
08/26/2013  01:17 AM    <DIR>          ..
08/26/2013  12:37 AM               455 .gitignore
08/26/2013  12:35 AM                14 .rspec
08/26/2013  12:37 AM    <DIR>          app
08/26/2013  12:37 AM    <DIR>          bin
08/26/2013  12:37 AM    <DIR>          config
08/26/2013  12:37 AM               154 config.ru
08/26/2013  12:37 AM    <DIR>          db
08/26/2013  12:35 AM             1,902 Gemfile
08/26/2013  12:39 AM             5,665 Gemfile.lock
08/26/2013  01:17 AM             3,830 Guardfile
08/26/2013  12:37 AM    <DIR>          lib
08/26/2013  12:40 AM    <DIR>          log
08/26/2013  12:37 AM    <DIR>          public
08/26/2013  12:37 AM               250 Rakefile
08/26/2013  12:37 AM               478 README.rdoc
08/26/2013  01:17 AM    <DIR>          spec
08/26/2013  12:37 AM    <DIR>          test
08/26/2013  12:40 AM    <DIR>          tmp
08/26/2013  12:37 AM    <DIR>          vendor
               8 File(s)         12,748 bytes
              13 Dir(s)  1,312,516,222,976 bytes free

For an experiment, I deleted the tasks app and started again, following the same instructions as before (http://igotrailed.wo...s-the-best-way/)

 

Now, when I run rails c, I get this:

c:\Sites\tasks>rails c
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activerecord-4.0.0/lib/active_record/connection_adapters/connection_specification.rb:58:in `rescue in resolve_hash_connection': Specified 'sqlite3' for database adapter, but the gem is not loaded. Add `gem 'sqlite3'` to your Gemfile. (Gem::LoadError)
        from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activerecord-4.0.0/lib/active_record/connection_adapters/connection_specification.rb:55:in `resolve_hash_connection'
        from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activerecord-4.0.0/lib/active_record/connection_adapters/connection_specification.rb:46:in `resolve_string_connection'
        from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activerecord-4.0.0/lib/active_record/connection_adapters/connection_specification.rb:30:in `spec'
        from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activerecord-4.0.0/lib/active_record/connection_handling.rb:39:in `establish_connection'
        from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activerecord-4.0.0/lib/active_record/railtie.rb:175:in `block (2 levels) in <class:Railtie>'
        from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activesupport-4.0.0/lib/active_support/lazy_load_hooks.rb:38:in `instance_eval'
        from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activesupport-4.0.0/lib/active_support/lazy_load_hooks.rb:38:in `execute_hook'
        from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activesupport-4.0.0/lib/active_support/lazy_load_hooks.rb:45:in `block in run_load_hooks'
        from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activesupport-4.0.0/lib/active_support/lazy_load_hooks.rb:44:in `each'
        from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activesupport-4.0.0/lib/active_support/lazy_load_hooks.rb:44:in `run_load_hooks'
        from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activerecord-4.0.0/lib/active_record/base.rb:322:in `<module:ActiveRecord>'
        from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activerecord-4.0.0/lib/active_record/base.rb:22:in `<top (required)>'
        from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activesupport-4.0.0/lib/active_support/dependencies.rb:228:in `require'
        from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activesupport-4.0.0/lib/active_support/dependencies.rb:228:in `block in require'
        from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activesupport-4.0.0/lib/active_support/dependencies.rb:213:in `load_dependency'
        from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activesupport-4.0.0/lib/active_support/dependencies.rb:228:in `require'
        from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activerecord-4.0.0/lib/active_record/railtie.rb:66:in `block in <class:Railtie>'
        from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/railties-4.0.0/lib/rails/railtie.rb:188:in `call'
        from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/railties-4.0.0/lib/rails/railtie.rb:188:in `block in run_console_blocks'
        from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/railties-4.0.0/lib/rails/railtie.rb:188:in `each'
        from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/railties-4.0.0/lib/rails/railtie.rb:188:in `run_console_blocks'
        from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/railties-4.0.0/lib/rails/application.rb:264:in `block in run_console_blocks'
        from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/railties-4.0.0/lib/rails/engine/railties.rb:17:in `each'
        from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/railties-4.0.0/lib/rails/engine/railties.rb:17:in `each'
        from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/railties-4.0.0/lib/rails/application.rb:264:in `run_console_blocks'
        from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/railties-4.0.0/lib/rails/engine.rb:431:in `load_console'
        from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/railties-4.0.0/lib/rails/commands/console.rb:51:in `initialize'
        from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/railties-4.0.0/lib/rails/commands/console.rb:9:in `new'
        from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/railties-4.0.0/lib/rails/commands/console.rb:9:in `start'
        from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/railties-4.0.0/lib/rails/commands.rb:64:in `<top (required)>'
        from bin/rails:4:in `require'
        from bin/rails:4:in `<main>'


#25 james

james

    Guard

  • Moderators
  • 221 posts
  • LocationLeeds, U.K.

Posted 26 August 2013 - 12:23 PM

Ahhh! Think I might have spotted a problem

 

Can you run  ruby -v and tell me what you get


Programming is just about problem solving!


#26 james

james

    Guard

  • Moderators
  • 221 posts
  • LocationLeeds, U.K.

Posted 26 August 2013 - 12:32 PM

Indeed, I just had a close look at that link you sent me and it is DEFINITELY the WORST way to get started.

Get rid of your installation and follow this.

 

http://rubyonrails.org/download

 

It links to the windows Ruby installer NOT the Rails installer which is what you need.

 

The windows Ruby installer does it properly with the correct Ruby version. Anybody recommending the site you chose should be driopped off a cliff from a great height.


Programming is just about problem solving!


#27 etech0

etech0

    Signalman

  • Members
  • 18 posts

Posted 27 August 2013 - 04:23 AM

I've got
ruby 1.9.3p429 (2013-05-15) [i386-mingw32]

 

 

I will try the windows Ruby installer. I actually tried it first, but did not get it to work. Can I try that and then post if there are issues? Or should I start a new thread?

 

Also, should I uninstall the other stuff first?



#28 james

james

    Guard

  • Moderators
  • 221 posts
  • LocationLeeds, U.K.

Posted 27 August 2013 - 04:37 AM

1.9.3 is ok, 2.0 is better.

 

It looked like you were running 1.9.1 which is incompatible. Sorry, my mistake

I talked someone through using the ruby installer last week and it just worked.

What problems did you have?


Programming is just about problem solving!


#29 james

james

    Guard

  • Moderators
  • 221 posts
  • LocationLeeds, U.K.

Posted 27 August 2013 - 04:40 AM

It just seems that your setup is not correctly configured. Not sure why


Programming is just about problem solving!


#30 etech0

etech0

    Signalman

  • Members
  • 18 posts

Posted 27 August 2013 - 04:54 AM

Should I uninstall everything and try again?



#31 etech0

etech0

    Signalman

  • Members
  • 18 posts

Posted 27 August 2013 - 05:44 AM

Okay. I unistalled everything, and ran that ruby installer.

 

Now, in the consle, I ran gem install rails, and got this error:

c:\Sites\tasks>gem install rails
Fetching: i18n-0.6.5.gem (100%)
Successfully installed i18n-0.6.5
Fetching: multi_json-1.7.9.gem (100%)
Successfully installed multi_json-1.7.9
Fetching: tzinfo-0.3.37.gem (100%)
Successfully installed tzinfo-0.3.37
Fetching: atomic-1.1.13.gem (100%)
ERROR:  Error installing rails:
        The 'atomic' native gem requires installed build tools.

Please update your PATH to include build tools or download the DevKit
from 'http://rubyinstaller.org/downloads' and follow the instructions
at 'http://github.com/oneclick/rubyinstaller/wiki/Development-Kit'

Am I doing something wrong?

 

Thanks!



#32 james

james

    Guard

  • Moderators
  • 221 posts
  • LocationLeeds, U.K.

Posted 27 August 2013 - 09:20 AM

Looks like you are missing some pre-requisites

 

Have you installed the devkit?

https://github.com/o...Development-Kit


Programming is just about problem solving!


#33 etech0

etech0

    Signalman

  • Members
  • 18 posts

Posted 28 August 2013 - 04:55 AM

Thanks!

 

Okay, I installed the devkit and tested it with json. Now, when I do gem install rails, I get this:

c:\Sites>gem install rails
Temporarily enhancing PATH to include DevKit...
Building native extensions.  This could take a while...
ERROR:  Error installing rails:
        ERROR: Failed to build gem native extension.

    C:/Ruby200-x64/bin/ruby.exe extconf.rb
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of necessary
libraries and/or headers.  Check the mkmf.log file for more details.  You may
need configuration options.

Provided configuration options:
        --with-opt-dir
        --without-opt-dir
        --with-opt-include
        --without-opt-include=${opt-dir}/include
        --with-opt-lib
        --without-opt-lib=${opt-dir}/lib
        --with-make-prog
        --without-make-prog
        --srcdir=.
        --curdir
        --ruby=C:/Ruby200-x64/bin/ruby
        --with-atomic_reference-dir
        --without-atomic_reference-dir
        --with-atomic_reference-include
        --without-atomic_reference-include=${atomic_reference-dir}/include
        --with-atomic_reference-lib
        --without-atomic_reference-lib=${atomic_reference-dir}/
C:/Ruby200-x64/lib/ruby/2.0.0/mkmf.rb:430:in `try_do': The compiler failed to generate an exectable file. (RuntimeError)
You have to install development tools first.
        from C:/Ruby200-x64/lib/ruby/2.0.0/mkmf.rb:515:in `try_link0'
        from C:/Ruby200-x64/lib/ruby/2.0.0/mkmf.rb:813:in `try_run'
        from extconf.rb:24:in `<main>'


Gem files will remain installed in C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/atomic-1.1.13 for ispection.
Results logged to C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/atomic-1.1.13/ext/gem_make.out

Any ideas?



#34 james

james

    Guard

  • Moderators
  • 221 posts
  • LocationLeeds, U.K.

Posted 28 August 2013 - 08:35 AM

I think the ruby installer installs rails for you.

You should just be able to run

gem update rails

Programming is just about problem solving!


#35 etech0

etech0

    Signalman

  • Members
  • 18 posts

Posted 28 August 2013 - 12:37 PM

You're right! It says that it has nothing to install.

Now I'm going to try making an app.

 

I was also watching this screencast: http://net.tutsplus....t-i-wish-i-had/.

 

Do you know if it's any good?

 

Thanks!



#36 Rowel

Rowel

    Controller

  • Members
  • 109 posts

Posted 28 August 2013 - 01:10 PM

etech, have you thought about installing a virtual machine in your Windows? VMware, Parallels or Virtualbox? 

Then install an Ubuntu VM, and install Ruby/Rails/rvm/etc... inside Ubuntu.  I think you'll have less weird problems like this. 

 

Personally I use OSX, but have installed an Ubuntu VM just to familiarize myself with it, and it's been pretty easy getting a RoR development environment  running in Ubuntu (even easier than setting up RoR on my Mac). 


  • james likes this

#37 james

james

    Guard

  • Moderators
  • 221 posts
  • LocationLeeds, U.K.

Posted 28 August 2013 - 04:52 PM

etech, have you thought about installing a virtual machine in your Windows? VMware, Parallels or Virtualbox? 

Then install an Ubuntu VM, and install Ruby/Rails/rvm/etc... inside Ubuntu.  I think you'll have less weird problems like this. 

 

Personally I use OSX, but have installed an Ubuntu VM just to familiarize myself with it, and it's been pretty easy getting a RoR development environment  running in Ubuntu (even easier than setting up RoR on my Mac). 

 

That's great advice. Nowadays I'd recommend Linux Mint rather than Ubuntu. You could alternatively set up a dual boot rather than VM but Virtualbox is a great way to go if you want a VM


Programming is just about problem solving!


#38 etech0

etech0

    Signalman

  • Members
  • 18 posts

Posted 29 August 2013 - 03:06 AM

I am trying a virtualbox and Ubuntu now. (They are both things I wanted to learn someday, so I guess why not now?)

Thanks for your help!



#39 levberlin

levberlin

    Passenger

  • Members
  • 5 posts

Posted 19 September 2013 - 08:38 PM

I would switch to a Unix based system. I was originally running Rails in windows, and it was not very fun. Everything is slightly different. I recommend running Ubuntu in a virtual machine like VirtualBox. It will take a little work to set it up, but will save you days of headaches down the road. Promise.



#40 etech0

etech0

    Signalman

  • Members
  • 18 posts

Posted 22 September 2013 - 02:04 AM

I set up Ubuntu in VirtualBox, and am working on configuring it. It's been crashing here and there, though. I'm thinking of maybe setting up a Raspberry Pi - do you know if Rails can work on it? I've been looking for an excuse to buy one of those for a while.







Also tagged with one or more of these keywords: guard, windows

1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users