Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Ruby

Problems following ODOT tutorials using local install (PC)

At first, I tried following along with the latest Rails, but I was hitting errors, so I downloaded the project files, opened my Windows Git Shell command prompt and ran 'bundle install' in my odot directory. That went fine, and I could run the local server, too.

HOWEVER, when I tired "git add ." it came up with THE SAME STRANGE STUFF AS BEFORE (i.e. when trying to follow along with the latest Rails):

C:\Users\Andrew\rubyapps\odot> git init
Initialized empty Git repository in C:/Users/Andrew/rubyapps/odot/.git/
C:\Users\Andrew\rubyapps\odot [master +15 ~0 -0 !]> git status
On branch master

Initial commit

Untracked files:
  (use "git add <file>..." to include in what will be committed)

        .gitignore
        Gemfile
        Gemfile.lock
        README.rdoc
        Rakefile
        app/
        bin/
        config.ru
        config/
        db/
        lib/
        log/
        public/
        test/
        vendor/

nothing added to commit but untracked files present (use "git add" to track)
C:\Users\Andrew\rubyapps\odot [master +15 ~0 -0 !]> git add .
warning: LF will be replaced by CRLF in .gitignore.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in Gemfile.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in Gemfile.lock.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in README.rdoc.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in Rakefile.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in app/assets/javascripts/application.js.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in app/assets/stylesheets/application.css.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in app/controllers/application_controller.rb.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in app/helpers/application_helper.rb.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in app/views/layouts/application.html.erb.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in bin/bundle.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in bin/rails.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in bin/rake.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in config.ru.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in config/application.rb.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in config/boot.rb.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in config/database.yml.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in config/environment.rb.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in config/environments/development.rb.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in config/environments/production.rb.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in config/environments/test.rb.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in config/initializers/backtrace_silencers.rb.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in config/initializers/filter_parameter_logging.rb.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in config/initializers/inflections.rb.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in config/initializers/mime_types.rb.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in config/initializers/secret_token.rb.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in config/initializers/session_store.rb.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in config/initializers/wrap_parameters.rb.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in config/locales/en.yml.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in config/routes.rb.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in db/seeds.rb.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in public/404.html.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in public/422.html.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in public/500.html.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in public/robots.txt.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in test/test_helper.rb.
The file will have its original line endings in your working directory.
C:\Users\Andrew\rubyapps\odot [master +53 ~0 -0]>

Charging onwards anyway, I got:

C:\Users\Andrew\rubyapps\odot [master +53 ~0 -0]> git commit -m "Initial commit of rails application
[master (root-commit) 27f2669] Initial commit of rails application
warning: LF will be replaced by CRLF in .gitignore.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in Gemfile.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in Gemfile.lock.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in README.rdoc.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in Rakefile.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in app/assets/javascripts/application.js.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in app/assets/stylesheets/application.css.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in app/controllers/application_controller.rb.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in app/helpers/application_helper.rb.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in app/views/layouts/application.html.erb.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in bin/bundle.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in bin/rails.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in bin/rake.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in config.ru.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in config/application.rb.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in config/boot.rb.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in config/database.yml.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in config/environment.rb.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in config/environments/development.rb.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in config/environments/production.rb.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in config/environments/test.rb.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in config/initializers/backtrace_silencers.rb.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in config/initializers/filter_parameter_logging.rb.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in config/initializers/inflections.rb.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in config/initializers/mime_types.rb.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in config/initializers/secret_token.rb.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in config/initializers/session_store.rb.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in config/initializers/wrap_parameters.rb.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in config/locales/en.yml.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in config/routes.rb.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in db/seeds.rb.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in public/404.html.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in public/422.html.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in public/500.html.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in public/robots.txt.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in test/test_helper.rb.
The file will have its original line endings in your working directory.
 53 files changed, 823 insertions(+)
 create mode 100644 .gitignore
 create mode 100644 Gemfile
 create mode 100644 Gemfile.lock
 create mode 100644 README.rdoc
 create mode 100644 Rakefile
 create mode 100644 app/assets/images/.keep
 create mode 100644 app/assets/javascripts/application.js
 create mode 100644 app/assets/stylesheets/application.css
 create mode 100644 app/controllers/application_controller.rb
 create mode 100644 app/controllers/concerns/.keep
 create mode 100644 app/helpers/application_helper.rb
 create mode 100644 app/mailers/.keep
 create mode 100644 app/models/.keep
 create mode 100644 app/models/concerns/.keep
 create mode 100644 app/views/layouts/application.html.erb
 create mode 100644 bin/bundle
 create mode 100644 bin/rails
 create mode 100644 bin/rake
 create mode 100644 config.ru
 create mode 100644 config/application.rb
 create mode 100644 config/boot.rb
 create mode 100644 config/database.yml
 create mode 100644 config/environment.rb
 create mode 100644 config/environments/development.rb
 create mode 100644 config/environments/production.rb
 create mode 100644 config/environments/test.rb
 create mode 100644 config/initializers/backtrace_silencers.rb
 create mode 100644 config/initializers/filter_parameter_logging.rb
 create mode 100644 config/initializers/inflections.rb
 create mode 100644 config/initializers/mime_types.rb
 create mode 100644 config/initializers/secret_token.rb
 create mode 100644 config/initializers/session_store.rb
 create mode 100644 config/initializers/wrap_parameters.rb
 create mode 100644 config/locales/en.yml
 create mode 100644 config/routes.rb
 create mode 100644 db/seeds.rb
 create mode 100644 lib/assets/.keep
 create mode 100644 lib/tasks/.keep
 create mode 100644 log/.keep
 create mode 100644 public/404.html
 create mode 100644 public/422.html
 create mode 100644 public/500.html
 create mode 100644 public/favicon.ico
 create mode 100644 public/robots.txt
 create mode 100644 test/controllers/.keep
 create mode 100644 test/fixtures/.keep
 create mode 100644 test/helpers/.keep
 create mode 100644 test/integration/.keep
 create mode 100644 test/mailers/.keep
 create mode 100644 test/models/.keep
 create mode 100644 test/test_helper.rb
 create mode 100644 vendor/assets/javascripts/.keep
 create mode 100644 vendor/assets/stylesheets/.keep
C:\Users\Andrew\rubyapps\odot [master]>

Should I be worried about all those strange messages?

Then, later, when committing changes to git again, I got similar stuff:

C:\Users\Andrew\rubyapps\odot [master +0 ~2 -0]> git status
On branch master
Changes not staged for commit:
  (use "git add <file>..." to update what will be committed)
  (use "git checkout -- <file>..." to discard changes in working directory)

        modified:   Gemfile
        modified:   Gemfile.lock

no changes added to commit (use "git add" and/or "git commit -a")
C:\Users\Andrew\rubyapps\odot [master +0 ~2 -0]> cd bin
C:\Users\Andrew\rubyapps\odot\bin [master +0 ~2 -0]> rails generate rspec:install
      create  .rspec
      create  spec
      create  spec/spec_helper.rb
C:\Users\Andrew\rubyapps\odot\bin [master +2 ~2 -0 !]> cd..
C:\Users\Andrew\rubyapps\odot [master +2 ~2 -0 !]> sublime
C:\Users\Andrew\rubyapps\odot [master +2 ~2 -0 !]> bundle binstubs rspec-core
C:\Users\Andrew\rubyapps\odot [master +4 ~2 -0 !]> git status
On branch master
Changes not staged for commit:
  (use "git add <file>..." to update what will be committed)
  (use "git checkout -- <file>..." to discard changes in working directory)

        modified:   Gemfile
        modified:   Gemfile.lock

Untracked files:
  (use "git add <file>..." to include in what will be committed)

        .rspec
        bin/autospec
        bin/rspec
        spec/

no changes added to commit (use "git add" and/or "git commit -a")
C:\Users\Andrew\rubyapps\odot [master +4 ~2 -0 !]> git add .
warning: LF will be replaced by CRLF in Gemfile.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in Gemfile.lock.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in .rspec.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in spec/spec_helper.rb.
The file will have its original line endings in your working directory.
C:\Users\Andrew\rubyapps\odot [master +4 ~2 -0]> git commit -m "Add rspec and capybara"
[master warning: LF will be replaced by CRLF in Gemfile.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in Gemfile.lock.
The file will have its original line endings in your working directory.
1c22328] Add rspec and capybara
warning: LF will be replaced by CRLF in .rspec.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in Gemfile.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in Gemfile.lock.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in spec/spec_helper.rb.
The file will have its original line endings in your working directory.
 6 files changed, 149 insertions(+), 45 deletions(-)
 create mode 100644 .rspec
 rewrite Gemfile (72%)
 create mode 100644 bin/autospec
 create mode 100644 bin/rspec
 create mode 100644 spec/spec_helper.rb
C:\Users\Andrew\rubyapps\odot [master]>

Strangely, later, when doing this:

C:\Users\Andrew\rubyapps\odot [master +0 ~0 -7]> git commit -m "Removed test directory"
[master bb04007] Removed test directory
 7 files changed, 15 deletions(-)
 delete mode 100644 test/controllers/.keep
 delete mode 100644 test/fixtures/.keep
 delete mode 100644 test/helpers/.keep
 delete mode 100644 test/integration/.keep
 delete mode 100644 test/mailers/.keep
 delete mode 100644 test/models/.keep
 delete mode 100644 test/test_helper.rb
C:\Users\Andrew\rubyapps\odot [master]>

...there were no strange messages.

I DID hit this though:

C:\Users\Andrew\rubyapps\odot\bin [master +14 ~1 -0 !]> rake db:migrate
(in C:/Users/Andrew/rubyapps/odot)
rake aborted!
Gem::LoadError: You have already activated rake 10.3.2, but your Gemfile requires rake 10.1.0. Prepending `bundle exec`
to your command may solve this.
C:/Users/Andrew/rubyapps/odot/config/boot.rb:4:in `<top (required)>'
C:/Users/Andrew/rubyapps/odot/config/application.rb:1:in `<top (required)>'
C:/Users/Andrew/rubyapps/odot/Rakefile:4:in `<top (required)>'
(See full trace by running task with --trace)
C:\Users\Andrew\rubyapps\odot\bin [master +14 ~1 -0 !]> rake db:migrate bundle exec
(in C:/Users/Andrew/rubyapps/odot)
rake aborted!
Gem::LoadError: You have already activated rake 10.3.2, but your Gemfile requires rake 10.1.0. Prepending `bundle exec`
to your command may solve this.
C:/Users/Andrew/rubyapps/odot/config/boot.rb:4:in `<top (required)>'
C:/Users/Andrew/rubyapps/odot/config/application.rb:1:in `<top (required)>'
C:/Users/Andrew/rubyapps/odot/Rakefile:4:in `<top (required)>'
(See full trace by running task with --trace)
C:\Users\Andrew\rubyapps\odot\bin [master +14 ~1 -0 !]> bundle exec rake db:migrate
(in C:/Users/Andrew/rubyapps/odot)
==  CreateTodoLists: migrating ================================================
-- create_table(:todo_lists)
   -> 0.0000s
==  CreateTodoLists: migrated (0.0000s) =======================================

C:\Users\Andrew\rubyapps\odot\bin [master +15 ~1 -0 !]>

C:\Users\Andrew\rubyapps\odot\bin [master +15 ~1 -0 !]> rake db:migrate RAILS_ENV=test
(in C:/Users/Andrew/rubyapps/odot)
rake aborted!
Gem::LoadError: You have already activated rake 10.3.2, but your Gemfile requires rake 10.1.0. Prepending `bundle exec`
to your command may solve this.
C:/Users/Andrew/rubyapps/odot/config/boot.rb:4:in `<top (required)>'
C:/Users/Andrew/rubyapps/odot/config/application.rb:1:in `<top (required)>'
C:/Users/Andrew/rubyapps/odot/Rakefile:4:in `<top (required)>'
(See full trace by running task with --trace)
C:\Users\Andrew\rubyapps\odot\bin [master +15 ~1 -0 !]> bundle exec rake db:migrate RAILS_ENV=test
(in C:/Users/Andrew/rubyapps/odot)
==  CreateTodoLists: migrating ================================================
-- create_table(:todo_lists)
   -> 0.0021s
==  CreateTodoLists: migrated (0.0021s) =======================================

C:\Users\Andrew\rubyapps\odot\bin [master +15 ~1 -0 !]>

Is that going to be a problem?

Also got these warnings from the server during the scaffold tutorial:

Started GET "/assets/scaffolds.css?body=1" for 127.0.0.1 at 2014-11-17 01:55:08 +0100
[2014-11-17 01:55:08] WARN  Could not determine content-length of response body. Set content-length of the response or s
et Response#chunked = true


Started GET "/assets/todo_lists.css?body=1" for 127.0.0.1 at 2014-11-17 01:55:09 +0100
[2014-11-17 01:55:09] WARN  Could not determine content-length of response body. Set content-length of the response or s
et Response#chunked = true


Started GET "/assets/todo_lists.js?body=1" for 127.0.0.1 at 2014-11-17 01:55:09 +0100
[2014-11-17 01:55:09] WARN  Could not determine content-length of response body. Set content-length of the response or s
et Response#chunked = true


Started GET "/" for 127.0.0.1 at 2014-11-17 02:01:10 +0100
Processing by TodoListsController#index as HTML
  ←[1m←[36mTodoList Load (1.0ms)←[0m  ←[1mSELECT "todo_lists".* FROM "todo_lists"←[0m
  Rendered todo_lists/index.html.erb within layouts/application (2.0ms)
Completed 200 OK in 14ms (Views: 10.0ms | ActiveRecord: 1.0ms)


Started GET "/assets/todo_lists.css?body=1" for 127.0.0.1 at 2014-11-17 02:01:10 +0100
[2014-11-17 02:01:10] WARN  Could not determine content-length of response body. Set content-length of the response or s
et Response#chunked = true


Started GET "/assets/todo_lists.js?body=1" for 127.0.0.1 at 2014-11-17 02:01:10 +0100
[2014-11-17 02:01:10] WARN  Could not determine content-length of response body. Set content-length of the response or s
et Response#chunked = true


Started GET "/assets/jquery_ujs.js?body=1" for 127.0.0.1 at 2014-11-17 02:01:10 +0100
[2014-11-17 02:01:10] WARN  Could not determine content-length of response body. Set content-length of the response or s
et Response#chunked = true


Started GET "/assets/jquery.js?body=1" for 127.0.0.1 at 2014-11-17 02:01:10 +0100
[2014-11-17 02:01:10] WARN  Could not determine content-length of response body. Set content-length of the response or s
et Response#chunked = true


Started GET "/assets/turbolinks.js?body=1" for 127.0.0.1 at 2014-11-17 02:01:10 +0100
[2014-11-17 02:01:10] WARN  Could not determine content-length of response body. Set content-length of the response or s
et Response#chunked = true


Started GET "/assets/scaffolds.css?body=1" for 127.0.0.1 at 2014-11-17 02:01:10 +0100
[2014-11-17 02:01:10] WARN  Could not determine content-length of response body. Set content-length of the response or s
et Response#chunked = true
[2014-11-17 02:05:31] INFO  going to shutdown ...
[2014-11-17 02:05:31] INFO  WEBrick::HTTPServer#start done.
Exiting
Terminate batch job (Y/N)? y
C:\Users\Andrew\rubyapps\odot [master +15 ~1 -0 !]>

This is turning into a running commentary...

When running the tests for the first time, loads of 'deprecation warnings':

C:\Users\Andrew\rubyapps\odot\bin [master]> rake spec
(in C:/Users/Andrew/rubyapps/odot)
rake aborted!
Gem::LoadError: You have already activated rake 10.3.2, but your Gemfile requires rake 10.1.0. Prepending `bundle exec`
to your command may solve this.
C:/Users/Andrew/rubyapps/odot/config/boot.rb:4:in `<top (required)>'
C:/Users/Andrew/rubyapps/odot/config/application.rb:1:in `<top (required)>'
C:/Users/Andrew/rubyapps/odot/Rakefile:4:in `<top (required)>'
(See full trace by running task with --trace)
C:\Users\Andrew\rubyapps\odot\bin [master]> bundle exec rake spec
(in C:/Users/Andrew/rubyapps/odot)
D:/Application/Ruby193/bin/ruby.exe -S rspec ./spec/controllers/todo_lists_controller_spec.rb ./spec/helpers/todo_lists_
helper_spec.rb ./spec/models/todo_list_spec.rb ./spec/requests/todo_lists_spec.rb ./spec/routing/todo_lists_routing_spec
.rb ./spec/views/todo_lists/edit.html.erb_spec.rb ./spec/views/todo_lists/index.html.erb_spec.rb ./spec/views/todo_lists
/new.html.erb_spec.rb ./spec/views/todo_lists/show.html.erb_spec.rb
←[32m.←[0m←[32m.←[0m←[32m.←[0m←[32m.←[0m←[32m.←[0m←[32m.←[0m←[32m.←[0m←[32m.←[0m←[32m.←[0m←[32m.←[0m←[32m.←[0m←[32m.←[0m
←[32m.←[0m←[32m.←[0m←[32m.←[0m←[32m.←[0m←[32m.←[0m←[32m.←[0m←[32m.←[0m←[32m.←[0m←[32m.←[0m←[32m.←[0m←[32m.←[0m←[32m.←[0m
←[32m.←[0m←[33m*←[0m←[32m.←[0m[deprecated] I18n.enforce_available_locales will default to true in the future. If you rea
lly want to skip validation of your locale you can set I18n.enforce_available_locales = false to avoid this message.
←[32m.←[0m←[33m*←[0m←[32m.←[0m

Pending:
←[33m  TodoListsHelper add some examples to (or delete) C:/Users/Andrew/rubyapps/odot/spec/helpers/todo_lists_helper_spe
c.rb←[0m
←[36m    # No reason given←[0m
←[36m    # ./spec/helpers/todo_lists_helper_spec.rb:14←[0m
←[33m  TodoList add some examples to (or delete) C:/Users/Andrew/rubyapps/odot/spec/models/todo_list_spec.rb←[0m
←[36m    # No reason given←[0m
←[36m    # ./spec/models/todo_list_spec.rb:4←[0m

Deprecation Warnings:

--------------------------------------------------------------------------------
RSpec::Core::ExampleGroup#example is deprecated and will be removed
in RSpec 3. There are a few options for what you can use instead:

  - rspec-core's DSL methods (`it`, `before`, `after`, `let`, `subject`, etc)
    now yield the example as a block argument, and that is the recommended
    way to access the current example from those contexts.
  - The current example is now exposed via `RSpec.current_example`,
    which is accessible from any context.
  - If you can't update the code at this call site (e.g. because it is in
    an extension gem), you can use this snippet to continue making this
    method available in RSpec 2.99 and RSpec 3:

      RSpec.configure do |c|
        c.expose_current_running_example_as :example
      end

(Called from D:/Application/Ruby193/lib/ruby/gems/1.9.1/gems/capybara-2.1.0/lib/capybara/rspec.rb:20:in `block (2 levels
) in <top (required)>')
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
RSpec::Core::ExampleGroup#example is deprecated and will be removed
in RSpec 3. There are a few options for what you can use instead:

  - rspec-core's DSL methods (`it`, `before`, `after`, `let`, `subject`, etc)
    now yield the example as a block argument, and that is the recommended
    way to access the current example from those contexts.
  - The current example is now exposed via `RSpec.current_example`,
    which is accessible from any context.
  - If you can't update the code at this call site (e.g. because it is in
    an extension gem), you can use this snippet to continue making this
    method available in RSpec 2.99 and RSpec 3:

      RSpec.configure do |c|
        c.expose_current_running_example_as :example
      end

(Called from D:/Application/Ruby193/lib/ruby/gems/1.9.1/gems/capybara-2.1.0/lib/capybara/rspec.rb:21:in `block (2 levels
) in <top (required)>')
--------------------------------------------------------------------------------

--------------------------------------------------------------------------------
The semantics of `RSpec::Core::ExampleGroup.pending` are changing in RSpec 3.
In RSpec 2.x, it caused the example to be skipped. In RSpec 3, the example will
still be run but is expected to fail, and will be marked as a failure (rather
than as pending) if the example passes, just like how `pending` with a block
from within an example already works.

To keep the same skip semantics, change `pending` to `skip`.  Otherwise, if you
want the new RSpec 3 behavior, you can safely ignore this warning and continue
to upgrade to RSpec 3 without addressing it.

Called from C:/Users/Andrew/rubyapps/odot/spec/helpers/todo_lists_helper_spec.rb:14:in `block in <top (required)>'.

--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
The semantics of `RSpec::Core::ExampleGroup.pending` are changing in RSpec 3.
In RSpec 2.x, it caused the example to be skipped. In RSpec 3, the example will
still be run but is expected to fail, and will be marked as a failure (rather
than as pending) if the example passes, just like how `pending` with a block
from within an example already works.

To keep the same skip semantics, change `pending` to `skip`.  Otherwise, if you
want the new RSpec 3 behavior, you can safely ignore this warning and continue
to upgrade to RSpec 3 without addressing it.

Called from C:/Users/Andrew/rubyapps/odot/spec/models/todo_list_spec.rb:4:in `block in <top (required)>'.

--------------------------------------------------------------------------------

`stub_model` is deprecated. Use the `rspec-activemodel-mocks` gem instead. Called from C:/Users/Andrew/rubyapps/odot/spe
c/views/todo_lists/index.html.erb_spec.rb:6:in `block (2 levels) in <top (required)>'.
`stub_model` is deprecated. Use the `rspec-activemodel-mocks` gem instead. Called from C:/Users/Andrew/rubyapps/odot/spe
c/views/todo_lists/index.html.erb_spec.rb:10:in `block (2 levels) in <top (required)>'.
`stub_model` is deprecated. Use the `rspec-activemodel-mocks` gem instead. Called from C:/Users/Andrew/rubyapps/odot/spe
c/views/todo_lists/show.html.erb_spec.rb:5:in `block (2 levels) in <top (required)>'.
Too many uses of deprecated '`stub_model`'. Pass `--deprecation-out` or set `config.deprecation_stream` to a file for fu
ll output.


If you need more of the backtrace for any of these deprecations to
identify where to make the necessary changes, you can configure
`config.raise_errors_for_deprecations!`, and it will turn the
deprecation warnings into errors, giving you the full backtrace.

9 deprecation warnings total

Finished in 1.27 seconds
←[33m30 examples, 0 failures, 2 pending←[0m

Randomized with seed 14032

C:\Users\Andrew\rubyapps\odot\bin [master]>

34 Answers

That looks like a bit of a nightmare. I admire your dedication to getting it working on Windows, but I've got a couple of ideas that might keep you from pulling your hair out later on down the line.

I can't even begin to troubleshoot what's going on here, but I'm running Windows as well, and just finished the Todo List lessons today with minimal problems. So even though it's not an outright solution to what you're experiencing right now, I wanted to suggest them anyway. :)

I did a lot of reading trying to figure out if it was worth it to develop using Ruby on Rails in Windows, and it seems that most people highly advise against it. Something like only 10% of Rails developers use Windows, and most of the information you'll find online is geared toward OS X and Linux users. I have no intention of buying a Mac anytime soon, or ever really, so I looked into some alternatives and decided on two options that have worked wonderfully for me so far.

  1. Download VirtualBox and set up a VM with Linux (I prefer Linux Mint, but there are lots of options). This is great, but takes a little time to set up. I enjoyed doing it, and thought it was good practice. The downside is that I get a lot of tabs going in my browser and sometimes it drags because I don't have a ton of RAM. This leads me to the second option, which is what I use 95% of the time.

  2. I found Nitrous and it's FANTASTIC. It's a cloud based development environment, and it's super easy to set up and use. For the lessons here, the free version works just fine for me. There's even a desktop client you can install, which I haven't tried but probably will soon. I haven't had any problems following along with the Treehouse Rails lessons using Nitrous, and I'll continue to use it for other lessons as well.

I'm sorry I can't help with your specific problem, but I thought it was worth suggesting a way to avoid this and future headaches related to Windows issues (especially since it's so difficult to find solutions online). Good luck!

I forgot to mention something really cool about Nitrous. When you set up your first box, it asks you what stack you'd like to use. Obviously for these lessons you'll be selecting Ruby/Rails, and it sets it all up for you. So you basically just start up an environment and it's ready to go for you to follow along with lessons. I started using Nitrous after going through the Ruby installation on Linux, so I don't feel like I missed out on that learning process, but there's something to be said for just being able to jump right into learning the language without having to deal with problematic installs. It sounds like you already went through the installation process on Windows, so you might appreciate not having to deal with that again.

Maciej Czuchnowski
Maciej Czuchnowski
36,441 Points

You should also check out Cloud9, I used it for one project and it worked great.

Maciej Czuchnowski
Maciej Czuchnowski
36,441 Points

The Git warnings are just warnings/information which tells you this: Windows has different line endings in files (that is why you may sometimes see the whole file as one huge line of text if it came from Linux or Mac). Git tries to do its best to make it work properly and has to modify your line endings to make them readable for Unix systems.

https://help.github.com/articles/dealing-with-line-endings/

As for the other problems, I can't really help you because I resigned from using Windows for Rails development a long time ago for these same reasons (and lack of help online, since like 90% of developers don't use Windows for Rails).

Virtual Machine using VirtualBox or VMWare Player is a great option. Mint and Ubuntu are the best options, since they provide a very easy way to install stuff, their repositories are very rich and hardware support is very wide (if you decide to use a dedicated Linux computer in the future). In short, they make transition from Windows a lot less painful compared to some more 'hardcore' distributions.

Are you familiar with 'Nitrous' that Keri talks about?

Are ANY of the languages worth learning Windows-friendly? I know Java and Javascript are, but I see Ruby on Rails as THE one to learn right now to become really useful and employable.

Pretty frustrating, since Macs are so RIDICULOUSLY expensive, plus I actually like the current Windows and have all my cloud storage setup through it etc. (And there are some things I don't like about Macs, such as Apple's strategy of forcing you to upgrade much more frequently than you would with PC's. Another 1000 pounds to shell out already? Wonderful...)

Maciej Czuchnowski
Maciej Czuchnowski
36,441 Points

Oh, I'm a certified Apple product hater, so you don't have to convince me :). That is why I really like working under Ubuntu (I bought a dedicated Lenovo machine for this, before that I used Ubuntu VM on VMWare Player under Windows for many months) - it's free, it's Unix-based (so you can easily follow tutorials made using Mac, which is 99% of them as far as I can see) and it's quite easy to use, Rails works much faster compared to Windows, you get less problems and more support online from other users. Working under Unix-based system also makes you more employable, since you will likely be working under Mac or Linux once you get a Rails developer job and Linux console is pretty much the same as Mac console.

Nitrous and Cloud9 are basically the same thing - they give you a whole IDE for working with Rails projects online, so you can use ANY operating system, you just need a browser. So there are a lot of options for you, try them. Play around with Nitrous and Cloud9 (the newest Rails tutorial by Hartl takes you through CLoud9 configuration and even provides you with a dedicated environment for that specific tutorial https://www.railstutorial.org/book ), try using a Linux virtual machine or live CD/USB.

Maciej Czuchnowski
Maciej Czuchnowski
36,441 Points

For cloud storage, I currently only use Dropbox, which is nicely integrated and synchronized between my Windows, my Ubuntu Virtual Machine and my Ubuntu laptop. I see a trend where even Java and Scala developers use Mac machines, I will never understand this whole fad.

Hmm, Ubuntu? Do you think it's worth considering? I don't know that much about it - just that it's an open-source UNIX-based operating system. I have a Lenovo laptop (and a VERY good one, which is another reason why I'm reluctant to switch to MAC - I only bought it 8 months ago!).

Maciej Czuchnowski
Maciej Czuchnowski
36,441 Points

Of course it's worth considering! And you don't have to install it right now, just create a live USB and try it out.

http://www.ubuntu.com/download/desktop/create-a-usb-stick-on-windows

Make some space for "persistence", so that you can install some stuff like Ruby, Rails and an editor (I recommend free Atom https://atom.io/ or evaluation version of Sublime Text). Treehouse even has a course that makes you familiar with the Console (applicable in both Mac and Linux systems). There are whole tutorials on installing Rails environment:

https://gorails.com/setup/ubuntu/14.04

And like I said, LOTS of help online, just google anything.

Maciej Czuchnowski
Maciej Czuchnowski
36,441 Points

Ubuntu works very well with Lenovo, because they usually have most of the drivers for devices used in Lenovo machines; a lot of Lenovo laptops even have Ubuntu certification of compatibility. Since using a USB stick to run a system doesn't interfere with your Windows installation, it's safe and you can resign at any point without any consequences, just turn off the computer and pull out the usb ;).

So I would be running EVERYTHING on the usb? Hmm, this is all quite new to me. What do you think, give Nitrous a go first or Ubuntu?

I'm reluctant to let Windows go completely for now, mainly because my main priority is getting a stable dev environment setup, so I can learn and also get my own app RUNNING online.

Maciej Czuchnowski
Maciej Czuchnowski
36,441 Points

Yeah, the computer will treat the USB as the hard drive with installed operating system. I know it's quite new for a Windows user, but it's a standard for Linux ;). I never let go of Windows completely, I still have it on my "stationary" laptop because I sometimes need to use some applications written in .NET and I occasionally like to play some more demanding games, so Windows is a must ;). Try Nitrous or Cloud9 first. If you like it, you can work in your browser from now on. Try Linux sooner or later, since, like I said, it is a skill that you will eventually need.

I agree with Maciej when he says you should eventually learn Linux because it's a necessary skill. I love Nitrous and plan to use it regularly (will give Cloud9 a go now as well), but it's still helpful to be able to find my way around Linux which is why I choose to run a VM.

If your priority is a "stable dev environment", it's going to be difficult to do that with just Windows. I don't think anyone would suggest you let go of Windows completely. That's certainly not what I've done. As Maciej said in another comment, Nitrous and Cloud9 are both browser based, so you can use them in any OS - which was the main selling point for me.

Another question, what is the difference between 'GitBash', and the other stuff I've got, such as my command prompt (with Ruby), and my 'Git Shell'. Git stuff doesn't work in the command prompt, but it works in the Git Shell, and so does the Ruby stuff, so I tend to use that at the moment.

But what's Gitbash?

Maciej Czuchnowski
Maciej Czuchnowski
36,441 Points

Git Bash under Windows is a kind of Unix console emulator that lets you run Unix console commands under Windows and has git commands already available. I used it under Windows for all my console things before I started using Linux. I also liked using CMDER. The built-in Windows Command Line doesn't let you do most stuff from the tutorials. I never used Git Shell, so can't say much here. I suppose it's something similar to Git Bash.

Thanks for all your help. I'm gonna give Nitrous a go. All the rest of the advice I'm sure will come in very useful in the near future!

Maciej Czuchnowski
Maciej Czuchnowski
36,441 Points

Good luck with your endeavors and have fun with exploring new IDEs and systems :)

Good luck! I think you'll really like the easy of use when it comes to Nitrous. It's the quickest way to get up and running right now, with minimal setup. :)

At some point, definitely consider trying out a Linux VM or USB. It's worthwhile to have that knowledge, even if you don't use it often.

I've just had an awesome idea: similar to what you said about Ubuntu on a USB stick, Maciej, couldn't I set up my laptop to have the option to boot to either Windows or Linux? Hard drive partition or something? Could I set it up so I effectively have TWO laptops in ONE? That way, whenever I want to study programming or work on a programming project, I can just boot to Linux, and for everthing else I could just boot to Windows?

If I can do this, I'll never have to buy a MAC! Please tell me there's no catch! lol

Yeah, you can absolutely do that! Dual booting is super common, and there's tons of tutorials available. Just Google "dual boot windows and linux" or something similar. This was one of the results that came up for me when I searched just that:

http://itsfoss.com/install-ubuntu-1404-dual-boot-mode-windows-8-81-uefi/

You said you had a newish laptop, so I'm assuming it has Windows 8.1. The method is similar for all versions of Windows, but if you've never done it before, it would probably be easier for you to use a guide that matches your specific version.

You'll notice that Step 2. is to Create a Live USB of Ubuntu (You can use Linux Mint, or whatever else you'd like. Linux Mint is based on Ubuntu.) This is what Maciej had suggested previously. When using this USB, you can work off of it just like it's installed on your system, but you also have the option to use it to install onto a partition. Maybe play around with whatever version of Linux you've chosen on the USB a bit before committing to installing it on your system.

There's no real catch. If you're working with any Adobe programs like Photoshop, you'll obviously have to be in Windows to work with those. Then you'll need to boot into Linux to do whatever other programming stuff you've got going on. So switching back and forth might be annoying, unless you have a fast system where boot up time is minimal.

I think for me, what I enjoy about using a VM (running Linux in a virtual machine) is that I can use Windows and Linux programs side by side with no switching back and forth. AND, this is the best part, if I muck something up I can quickly just make a new VM with everything all nice and pretty again. It's great for learning, I think. With a hard install (I don't know if that's a technical term, but I'm using it) onto a partition of the drive, it's more involved to format and reinstall. Not difficult, but your computer is tied up while it does all that.

But hey, messing around with this stuff and finding what you'd like is part of the fun. Just backup your important files while you experiment getting a setup that works for you.

Also, could I do the same with Ubuntu?

And also, I'm guessing this is basically the same as having Ubuntu on a USB, but for some reason, the idea of running everything off a USB just seems a bit, well, unstable? But maybe I'm wrong about that.

I don't know that it's necessarily unstable, but lack of security is a drawback (as there is no login) and also it can run kind of slow. I wouldn't ever use a Live USB for ongoing production, but they're nice to have a working "install" of whatever Linux distribution you choose to play around with. I've mentioned it a few times here, but I'd much rather use Linux in a VM than use is consistently on a USB.

If I had my PC setup with the option to boot to Linux or Ubuntu, would EVERYTHING be separate i.e. all my data files etc; it would effectively be like having two separate PC's?

Yes, basically. There are ways to access files on other partitions though. You can search something like "access windows files from dual boot ubuntu" and see what comes up. You're just mounting your Windows partition from within Ubuntu to get access to those files.

I'm not crazy about this, which is why I don't do it. Something feels icky about it to me, which is probably irrational. But I just feel like there's more room to mess things up when you're crossing things together like that. What I do to have access to documents from anywhere it to just save everything in either Dropbox or Google Drive. That way you've got access to documents and files, but you're not accessing all of the other stuff that you don't need like system files or whatever.

Yeah that's probably what I will prefer to do with my media and documents files. I've got a monster OneDrive storage (10 TB!!! Although I'm 'only' up to 250GB). I'm not sure if I'll be able to access OneDrive on Linux (although maybe I could - you can do it through a browser after all).

I would opt for the VM if it wasn't for the fact that where I'm living at the moment in Spain, the internet connection at home and at work is a bit slow.

So when if I set it up as dual-boot, I don't HAVE to share my media and documents with Linux/Ubuntu? I think I could have Linux/Ubuntu on a hard drive partition and just boot to that, and it would be effectively like working with a brand new PC with Linux installed. That's how I would like it anyway.

You don't have to share anything if you don't want to. It can be set up like two entirely separate computers where you can access cloud storage for documents, etc. 10TB is insane! I don't even know what I'd do with that.

Back to the VM. You wouldn't need fast internet to set that up. I mean, yeah you'd need to download the program (VirtualBox, for example), but then the VM is running on your machine. It's not something you're accessing over the internet. I only have 6GB of RAM and my Linux VM runs just fine when I give it 1GB (you can set the resources you'd like to allow it to use). I'd be willing to bet your laptop has better specs than my desktop, and I don't have any issues so you'll probably be even better off.

Maciej Czuchnowski
Maciej Czuchnowski
36,441 Points

Yeah, it kinda works this way - all separate by default, unless you configure it a bit. To do that, I think you need a live USB either way (they give you the option to just run the system from USB or install it on your hard drive, one device, two functions - you should try Ubuntu and Mint as live USBs and decide which one to use, they are quite similar, but you might like one more than the other). Make sure you read everything you can about potential problems with dual boot for your version of Windows. There are some situations where additional configuration is required (depends on types of BIOS) or it might screw your booting altogether, preventing you from running ANY system. I never did dual boot, so I can't help you with that, but there are lots of resources online.

VM like Virtual Box or VMWare Player does not depend on your internet connection - it's a huge Windows file that emulates a physical hard drive which you open in a program and it basically thinks it's dealing with a whole computer and an OS in that file ;).

Hmmm I see... when you said you run the VM in the browser I thought that meant it runs over an internet connection.

Maciej Czuchnowski
Maciej Czuchnowski
36,441 Points

Cloud9 and Nitrous work in the browser :). They are cloud-based IDE's (well, kinda like small virtual machines emulated in the browser).

What are the main pros and cons of running a VM, compared to setting up a Linux dual-boot?

Without listing out a ton of different things, which could vary based on your setup and what you'll actually be doing, I'm just going to tell you my plan.

While learning using the lessons found here and a few found elsewhere, I intend to use a combination of Nitrous and a Linux VM. I'm still not 100% sure where I want to "settle in" and therefore don't want to continually mess with a full install of Linux on a partition, since I believe I'll constantly be changing things and probably messing up along the way. I'm using Nitrous for Ruby lessons, and will probably do so for Python as well. It's easy setup and it just works.

Currently, I'm doing the lessons in Database Foundations in a Linux VM because I need to use MySQL Workbench. Maybe in the future I won't want to use MySQL and I'll want the freedom to mess around with something else. If that's the case, then in my mind it's much simpler to delete that VM and create a new one (it's a quick process) in order to have a fresh OS install. I could have a VM for every single type of Linux distribution out there + 5 versions of Windows if I wanted to and delete/create them at will.

Eventually, I'll get to a point where I will have found my focus. Maybe that's Ruby and I'll want to keep a solid Linux Ruby environment at all times so I'll want a Windows/Linux dual boot setup. Maybe I'll want to focus on JavaScript which I can do from Windows and I'll keep the VM situation going for when the need arises. If that were the case, I'd probably set up a Linux partition just because it's fun and I like to use Mint for most things and I'll keep Windows for gaming. Or heck, maybe I'll get crazy and become a C# developer and then I'll just stick to 100% Windows for some reason.

Really, what I'm saying is there are 100 different reasons to do anything and you just have to jump in and find something that works for what you want to do. Then, in three months (or even sooner!), you'll shake things up and decide you want to do something else. There are no rules. :)

If I had to make a suggestion for you right this very second, I'd say look into setting up a VM. It's cool to see a virtual computer running Linux inside a Windows based program. Plus you can do a fair amount of stuff in there (in my case, playing with MySQL at the moment). It's easy to change your mind. If you want to start a dual boot instead, then that's cool too. It's not set in stone, by any means, but it's a little more work to scrap that for something else.

This is all, of course, just my opinion. I don't think there's a right or wrong way. Say, for example, you just want to start doing a bunch of Ruby stuff and you don't want to mess with ANY of this other craziness. Then that's the beauty of Nitrous. You can just pull that up in your browser and start coding. Some days that's all I feel like doing. Other days I'm trying to figure out some weird hiccup in Linux. But then, I like variety so that might just be me.

Maciej Czuchnowski
Maciej Czuchnowski
36,441 Points

With dual boot, the currently running system has access to 100% of resources (RAM, CPU etc.). So when you run Windows, it can go max. frequency and use max. RAM, if you run Linux, it can do the same. With VM, you are already running Windows, so some of your resources are already taken, then you can set up what amount of free resources (the ones not already in use) will be available for the system in the virtual machine. Linux works well even in VM, because it's much, much lighter and more optimized than Windows. It can easily work with 4 or 8 GB or RAM and 1GHz of CPU whereas Windows would lag a lot.

Maciej Czuchnowski
Maciej Czuchnowski
36,441 Points

Agree with Keri :) (published my answer above before I could read her comment)

I'm downloading VirtualBox :-) I'll let you know how it goes.

Maciej Czuchnowski
Maciej Czuchnowski
36,441 Points

You can experiment more with the VMs, try different Linux distros (Mint and Ubuntu are not the only ones) even copy your machines and if you screw something up with the system, it will not be as painful as a fully-installed OS :)

Cheers Maciej. Because of your's and Kira's tutelage I am full of confidence blazing a path forwards.

My laptop's a beast, so I'm confident the VM should run just fine (a good i7 processor, 16GB of RAM, and a good nvidia graphics card :-)

Maciej Czuchnowski
Maciej Czuchnowski
36,441 Points

Yeah, you'd be fine even with running 3 Linux VMs at the same moment with this :). Go crazy!

Wow... yeah, you've got nothing to worry about! Have fun. :)

An update if you're curious: I installed VirtualBox, but I had problems; for some reason, it was extremely difficult (more like impossible) to partition the virtual drive appropriately when installing Ubuntu onto the virtual machine. It was setting one of the partitions less than 3.4Gb, and it complained and asked me to make that partition bigger. Except I couldn't.

I tried all sorts of things, lots of googling etc. I did kind of manage to get it running, creating the partitions myself from scratch, but at the end of the installation it said the installation had errors, and it DID run, but a bit slowly, with a graphic glitch under the mouse pointer. A few things went wrong with it and in the end I gave up.

That led me to try partitioning my C: drive and setting my laptop up as dual-boot Windows and Ubuntu. However, I couldn't shrink my C: partition. Again, I tried lots of things, plus recommended workarounds I found online. They didn't work, and I didn't dare try anything too extreme in case I ruined my drive or Windows (which is perfectly possible, from what I've read).

SO, now I'm running Ubuntu on a USB (I'm using it right now :-) ) and, so far it's AWESOME! It's FAST! I wasn't expecting that.

So, I'm going to get the environment set up and I'm VERY much looking forward to finally getting stuck back into some tutorials!!

Maciej Czuchnowski
Maciej Czuchnowski
36,441 Points

OK, if VirtuaBox had problems, give VMWare Player a try (it's also free). I used it without any problems (still do on my gaming Windows machine). Yeah, if you have USB 3.0, it will be very fast :). Good to hear you like it!

Yeah, I was wondering about that - I DO have a USB 3.0 port, and I've got it plugged into that, but I wasn't sure if it would utilise the USB 3.0 capability.

Maciej Czuchnowski
Maciej Czuchnowski
36,441 Points

Depends if your flashdrive is also USB 3.0 compatible. Even if it's not, Linux is generally fast and eats less resources ;)

Regards VMPlayer, I'll bear that in mind. If I get everything up and running successfully here, I'll probably just stick with it for a while, purely from a time management point of view. However, in the future I'm sure I'd like to try getting a v box running again, just so I don't have to reboot to access Linux.

If I get a different USB stick, would I be able to just copy my 'Ubuntu' from this stick onto the other, and it'll just work?

Maciej Czuchnowski
Maciej Czuchnowski
36,441 Points

I'm not sure if pure copy and paste would do. You'd need to make it bootable using the software which you used before to make this one [you did, right?]. The process creates some special hidden files on the drive and perhaps adds some special attributes to the partition.

Maciej Czuchnowski
Maciej Czuchnowski
36,441 Points

So I guess you could make a new bootable from the same image and THEN copy and overwrite all the files from the old USB and it should then work and have everything set up the same way it was. But that's just my theory, never doe this myself :)

Um, actually I can't remember what I did to make the USB stick - I followed an online guide. Maybe it did do something special to it, come to think of it. The last 24hrs has been a bit of a blur!

Hmm, I do have a few questions....

  1. While I'm running off this USB, is EVERYTHING kept on it, or is some stuff being copied to my hard drive when I install things, save data etc etc?

  2. If get stuck into some development using this USB, how would I access my projects at a later date, when I transition to a machine or a virtual machine? (Primarily, I'm thinking about Git - and I have to say, I'm still a little confused about Git i.e. where the data is kept, how I access it etc etc).

Maciej Czuchnowski
Maciej Czuchnowski
36,441 Points

I assume you used a program that cloned an ISO image into the USB stick and made it bootable :)

  1. Yeah, everything is kept on the USB, things are installed on it (in the past there were only live CDs and they asked you to give them some free space on the drive to write stuff). I don't think it has ANY access to your Windows drive without special configuration.

  2. I personally use Dropbox and keep all my projects there, in separate folders. I install Dropbox and log in to the same account on all my machines, this way I can always access them from all my computers (even from Nexus tablet if need be). It's all synchronized automatically, so when I change something while on my Windows machine, it gets updated on my Linux machines as soon as I start them. Dropbox has great support for Ubuntu, even gives you a status icon that tells you when it's syncing etc. Git files are always kept in project folders - it creates a special hidden folder inside your project and writes all the commits there. So you have access to the same git state from all machines, you just need to install git on all your machines.

You should do Treehouse's Git course. I also highly recommend doing the Git Immersion tutorial and doing every single step in it. It will click at some point, trust me ;). Later you can upload your projects to Git to have constant access to them from the browser and show off your work in the future ;)

Maciej Czuchnowski
Maciej Czuchnowski
36,441 Points

If you move your project folder somewhere else, its associated git stuff is also moved with it, so no worries here.

Ah, that makes a lot of sense. I use OneDrive for cloud storage, but I still use Dropbox for casual file sharing, so I'll get that setup on my Ubuntu, and in the future I could always setup that Dropbox folder to sync in Windows, too. Don't think I'll use that for a while though. Thanks again, good tips, and that stuff about Git is very useful to know, too.

Is this a good tutorial? Just want to check it's not some dodgy third-party scam. https://www.liberiangeek.net/2014/04/daily-ubuntu-tips-get-dropbox-installed-in-ubuntu-14-04-trusty-tahr/

Hmm, that didn't work. Trying something else!

Maciej Czuchnowski
Maciej Czuchnowski
36,441 Points

I think you just have to go to your Software Center (press the Windows key on the keyboard and start writing Software, click the orange square thingie) and search for Dropbox in the search box, click it when it's found and install :)

Ok I did it. Just downloaded the file in the browser, here and ran it. No console stuff required. Who would have thought it could be so easy! ;-)

https://www.dropbox.com/install

Maciej Czuchnowski
Maciej Czuchnowski
36,441 Points

Yeah, Debian and its derivatives (Ubuntu, Mint etc.) have this easy system ;)

Hmm, when following this: http://guides.railsgirls.com/install/#setup-for-linux

It failed, saying "unable to locate package nodejs".

Any ideas?

Maciej Czuchnowski
Maciej Czuchnowski
36,441 Points

Go a bit up, I think I posted a link to a site I used myself. nodejs is required for some stuff related to Rails, find out how to install it. When having a choice - RVM or RBENV - don't install both, you have to choose one. I personally use RVM, just because it was the first thing I installed and it stuck with me since ;).

I'm part way through this now though http://railsapps.github.io/installrubyonrails-ubuntu.html

When I did this though: sudo apt-get install nodejs

It says 'Unable to locate package nodejs'!

Eh?

I'm a bit scared of trying something else, because I don't really know what the hell's going on!

Maciej Czuchnowski
Maciej Czuchnowski
36,441 Points

You need to add a nodejs repository. These three commands:

sudo add-apt-repository ppa:chris-lea/node.js
sudo apt-get update
sudo apt-get install nodejs

Whenever you do install, it goes to all repositories it knows to look for that package. It didn't find nodejs, because you didn't have the repository with nodejs on your list. So the first command adds it. The second one makes the system aware of the new repo and all the packages and their versions in that repo. Third one installs node.

No worries, you will get used to it :)

Maciej Czuchnowski
Maciej Czuchnowski
36,441 Points

Always google your errors with additional keyword 'ubuntu'. There's A LOT of support out there, your nodejs problem was the first and second result ;)

Worked until the last step!

ubuntu@ubuntu:~$ sudo add-apt-repository ppa:chris-lea/node.js
 Evented I/O for V8 javascript. Node's goal is to provide an easy way to build scalable network programs
 More info: https://launchpad.net/~chris-lea/+archive/ubuntu/node.js
Press [ENTER] to continue or ctrl-c to cancel adding it

gpg: keyring `/tmp/tmpg7iwvc6m/secring.gpg' created
gpg: keyring `/tmp/tmpg7iwvc6m/pubring.gpg' created
gpg: requesting key C7917B12 from hkp server keyserver.ubuntu.com
gpg: /tmp/tmpg7iwvc6m/trustdb.gpg: trustdb created
gpg: key C7917B12: public key "Launchpad chrislea" imported
gpg: Total number processed: 1
gpg:               imported: 1  (RSA: 1)
OK
ubuntu@ubuntu:~$ sudo apt-get update
Ign cdrom://Ubuntu 14.04.1 LTS _Trusty Tahr_ - Release amd64 (20140722.2) trusty InRelease
Ign cdrom://Ubuntu 14.04.1 LTS _Trusty Tahr_ - Release amd64 (20140722.2) trusty/main Translation-en_US
Ign cdrom://Ubuntu 14.04.1 LTS _Trusty Tahr_ - Release amd64 (20140722.2) trusty/main Translation-en
Ign cdrom://Ubuntu 14.04.1 LTS _Trusty Tahr_ - Release amd64 (20140722.2) trusty/restricted Translation-en_US
Ign cdrom://Ubuntu 14.04.1 LTS _Trusty Tahr_ - Release amd64 (20140722.2) trusty/restricted Translation-en
Ign http://security.ubuntu.com trusty-security InRelease                       
Ign http://ppa.launchpad.net trusty InRelease                                  
Hit http://security.ubuntu.com trusty-security Release.gpg                     
Get:1 http://ppa.launchpad.net trusty Release.gpg [316 B]                      
Hit http://security.ubuntu.com trusty-security Release                         
Ign http://archive.ubuntu.com trusty InRelease                                 
Get:2 http://ppa.launchpad.net trusty Release [14.5 kB]              
Hit http://security.ubuntu.com trusty-security/main amd64 Packages             
Hit http://security.ubuntu.com trusty-security/restricted amd64 Packages       
Ign http://archive.ubuntu.com trusty-updates InRelease                
Get:3 http://ppa.launchpad.net trusty/main amd64 Packages [763 B]     
Hit http://security.ubuntu.com trusty-security/main Translation-en             
Ign http://linux.dropbox.com trusty InRelease                         
Hit http://security.ubuntu.com trusty-security/restricted Translation-en       
Hit http://archive.ubuntu.com trusty Release.gpg                               
Get:4 http://ppa.launchpad.net trusty/main Translation-en [604 B]     
Hit http://archive.ubuntu.com trusty-updates Release.gpg                       
Hit http://linux.dropbox.com trusty Release.gpg 
Hit http://archive.ubuntu.com trusty Release
Hit http://linux.dropbox.com trusty Release      
Hit http://archive.ubuntu.com trusty-updates Release
Hit http://archive.ubuntu.com trusty/main amd64 Packages
Hit http://linux.dropbox.com trusty/main amd64 Packages
Hit http://archive.ubuntu.com trusty/restricted amd64 Packages
Hit http://archive.ubuntu.com trusty/main Translation-en
Hit http://archive.ubuntu.com trusty/restricted Translation-en
Hit http://archive.ubuntu.com trusty-updates/main amd64 Packages
Hit http://archive.ubuntu.com trusty-updates/restricted amd64 Packages
Hit http://archive.ubuntu.com trusty-updates/main Translation-en
Hit http://archive.ubuntu.com trusty-updates/restricted Translation-en
Ign http://linux.dropbox.com trusty/main Translation-en_US
Ign http://linux.dropbox.com trusty/main Translation-en
Ign http://archive.ubuntu.com trusty/main Translation-en_US
Ign http://archive.ubuntu.com trusty/restricted Translation-en_US
Fetched 16.2 kB in 3s (4,691 B/s)
Reading package lists... Done
ubuntu@ubuntu:~$ sudo apt-get install nodejs
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
 nodejs : Depends: rlwrap but it is not installable
E: Unable to correct problems, you have held broken packages.
ubuntu@ubuntu:~$ 

What's a Dockerfile?

Maciej Czuchnowski
Maciej Czuchnowski
36,441 Points

I think this means you just have to run this command:

echo "deb http://archive.ubuntu.com/ubuntu precise universe" >> /etc/apt/sources.list

With sudo in front if that failed:

sudo echo "deb http://archive.ubuntu.com/ubuntu precise universe" >> /etc/apt/sources.list

Sudo gives you temporary admin authorization. Normally you can't edit important settings and files.

Ah, got 'permission denied' even when using sudo

Maciej Czuchnowski
Maciej Czuchnowski
36,441 Points

Did you enter the proper password?

Erm, it didn't ask for one?

unless 'precise universe' was his password?

Maciej Czuchnowski
Maciej Czuchnowski
36,441 Points

Hmmm...if it didn't ask for password, then it didn't need one. That's odd. Then try this:

sudo gedit /etc/apt/sources.list

And manually paste that line at the bottom and save the file.

deb http://archive.ubuntu.com/ubuntu precise universe

Ok, did that, and tried again, but got: bash: /etc/apt/sources.list: Permission denied

Maciej Czuchnowski
Maciej Czuchnowski
36,441 Points

OK that is super weird because you should be able to do ANYTHING when doing sudo. It should be asking you about your password which you should have set after first run. So I assume that live USB works a bit differently for some reason...all I can suggest now is describing this on askubuntu and waiting for someone more experienced to tell you what to do.

Ok will do

Maciej Czuchnowski
Maciej Czuchnowski
36,441 Points

Another thing I found maybe it will work:

sudo sh -c "echo 'deb http://archive.ubuntu.com/ubuntu precise universe' >> /etc/apt/sources.list"

Found here (changed the content a bit): http://askubuntu.com/questions/279853/permission-denied-error-when-editing-etc-ld-so-conf/279855#279855

Maciej Czuchnowski
Maciej Czuchnowski
36,441 Points

The last thing you could try is running root shell using this command:

sudo -i

And then running this, without sudo:

echo "deb http://archive.ubuntu.com/ubuntu precise universe" >> /etc/apt/sources.list

Ok when doing that it seems to accept it, but does nothing, just returns to a new line instantly.

Maciej Czuchnowski
Maciej Czuchnowski
36,441 Points

Yeah, now try doing the install nodejs thing. It returns nothing because it simply added something to a file.

Still failed! :-( It did the same thing as before: permission denied.

Sorry, not 'permission denied' - it's the 'unmet dependencies' thing again.

Maciej Czuchnowski
Maciej Czuchnowski
36,441 Points

OK, askubuntu is the only thing I can recommend now. I never ever had this error, so I assume it has something to do with the fact that this is a live USB and not a full-blown installation.

(outside root, back into the normal $ prompt): sudo apt-get install nodejs

If I link to this page, will people be able to see it?

Maciej Czuchnowski
Maciej Czuchnowski
36,441 Points

No idea. I'm not sure they will want to scroll this up and down. Try to describe your steps and tell them what errors you get. Include the version of Ubuntu and the fact that it's on USB.

I'll let you know how it goes

Maciej Czuchnowski
Maciej Czuchnowski
36,441 Points

OK. Sorry you had to go through that. I had no idea it would do something like this...

No worries man, I appreciate all your help. Hopefully a solution will appear.

Maciej Czuchnowski
Maciej Czuchnowski
36,441 Points

I just forgot to mention - after adding this line you should do sudo apt-get update and then install nodejs. Without update, the system is not aware of the new source you gave it. It might help...no idea.

Got a solution! askubuntu.com/questions/552009/14-04-live-usb-stick-cant-install-nodejs/552055#552055

It worked! :-D

Maciej Czuchnowski
Maciej Czuchnowski
36,441 Points

Nice! On the brighter side, we also both learned something ;).

Now I'm happy :-) :

ubuntu@ubuntu:~$ rails -v

Rails 4.1.8

ubuntu@ubuntu:~$ ruby -v

ruby 2.1.5p273 (2014-11-13 revision 48405) [x86_64-linux]

ubuntu@ubuntu:~$

Maciej Czuchnowski
Maciej Czuchnowski
36,441 Points

Great :). So, are you using rvm?

I think so! I followed that RVM guide and just did everything it told me to do. (this: http://railsapps.github.io/installrubyonrails-ubuntu.html)

There were a couple of hitches, but I solved them. RVM is in my $PATH and I had to do "rvm something" a few times.

I'll take a look at that, Maciej. Something I'm thinking right now is that I'd like an easy way to change to my dropbox projects folder instantly, instead of typing in the whole path all the time. Or setting it as my home directory, or something? I'm not sure.

Maciej Czuchnowski
Maciej Czuchnowski
36,441 Points

I have it in my home directory, which means I just open the terminal, write cd Dr, then press TAB and the command is completed for me automatically, so I press enter.

Maciej Czuchnowski
Maciej Czuchnowski
36,441 Points

Treehouse's Console course is very useful for Linux users (and Mac users, since it works the same; only Windows command prompt is the weird kid in that bunch and doesn't work the same way).

Hi Maciej, how's it going? Things are going pretty well here; I'm part way through the OneMonthRails tutorial and I've so far managed to overcome the inevitable problems and errors that crop up. You can even see the humble beginnings of the app here: http://yorkshiremanpinteresting.herokuapp.com/

I've stopped syncing with Dropbox, because I kept getting 'unbuntu conflicting copy' everywhere. That was a pain in the ass, so I've paused the syncing on it and of course I'm frequently pushing to github for backup.

How do I move my 'Projects' folder out of my Dropbox folder? The reason being is that I think I would like it elsewhere on my hard drive, and then if I want to develop it on a different computer, I could simply upload that folder to Dropbox and then download it onto the other computer, and create a git repository within that local folder on the new computer. What are your thoughts on this? Does that make sense to you? Or could I do that with Github instead?

On another note, it's really exciting when you see what you can do with RoR, isn't it? The possibilities are endless, and it's such a good system. I've already had some good ideas for my own web app.

All the hard work I've done over the last several months learning html, css and some RoR has really paid off, too. Even though I just default to Bootstrap for my static page builds now, it's still really handy to actually UNDERSTAND how it works, and modify the markup etc. I don't think I'll be floating my own inline blocks for a while, but it's nice to know that I could if I wanted to!

Also, the more hardcore Ruby code I've been trying to get my head around in the Treehouse tutorials has been really useful so far during this tutorial, too. So far, they've used some fairly simple 'for' and 'else' blocks, with arguments, that sort of thing, and if it was completely new to me it would have been quite confusing. I've even applied a couple of simple modifications myself that weren't part of the tutorial.

It's still pretty overwhelming, but the sense of power and possibility is pretty amazing and exciting.

(I do know there will be some 'dark times' ahead though lol, but that's all part of the journey)

Maciej Czuchnowski
Maciej Czuchnowski
36,441 Points

I'm glad you're making progress and I know the feeling :). The Dropbox error is very weird, I've never seen it before.

You can move your project folders wherever you want, this does not have any influence on git and github things. It works like this: when you're in the console, and you cd to a project and that project has git initiated in it (it has hidden .git folder in it), you can use git commands in that folder and you have access to all the history of changes, everything that is available in git for that project. It doesn't matter where you put that folder, as long as it has this .git folder inside. It also contains configuration for remote repositories, such as github or heroku. These also don't change if you move the folder. If you move that folder to another computer, it should still retain all the git stuff in it, including the remote github repo address. the only difference would be that the new computer needs to have ssh keys registered on github site to allow pushing (you can generate new key or copy fromyour original computer).

You can also do a pull from github on the new computer, this should also have the .git folder and all the commit history in it (it will not have the so-called reflog, which is the last-resort thing for when you somehow screw up your old commits, play with history etc. it contains everything, including the commits that got changed, merged etc. - it's only stored locally, it is not carried through github). So it's your choice, as always I recommend trying every option to get used to how git works :).

Aaaah, of course. That makes sense. Forgot about that. Thanks!