Development Tools Installing a Ruby Development Environment Installing a Ruby Development Environment Installing Ruby on Mac

Ruby issues

At the end after installing all the gems he goes to his treehouse directory??? What am I suppose to type?

2 Answers

Hi David,

Because he has a file called "treehouse" in the desktop, I think Jason Seifer doesn't explain very well.

Let me help you.

  • Go to your desktop - let's type in your terminal: "cd Desktop"
  • then create new file - type: "rails new treehouse" (you will find new folder called treehouse in the desktop)
  • then locate file you create - type: "cd treehouse"
  • then see the lists inside the file - type: "ls"

  • then lastly to run server - type: "rails s" or "rails server"

  • now open your Chrome browser - type : http://localhost:3000

Hope that helps. :)

Hello and thanks! Can you help me with this:

Last login: Wed May  6 18:13:27 on ttys000
Davids-MacBook-Pro:~ DavidRyan$ clear
Davids-MacBook-Pro:~ DavidRyan$ cd Desktop
Davids-MacBook-Pro:Desktop DavidRyan$ rails new treehouse
      create  
      create  README.rdoc
      create  Rakefile
      create  config.ru
      create  .gitignore
      create  Gemfile
      create  app
      create  app/assets/javascripts/application.js
      create  app/assets/stylesheets/application.css
      create  app/controllers/application_controller.rb
      create  app/helpers/application_helper.rb
      create  app/views/layouts/application.html.erb
      create  app/assets/images/.keep
      create  app/mailers/.keep
      create  app/models/.keep
      create  app/controllers/concerns/.keep
      create  app/models/concerns/.keep
      create  bin
      create  bin/bundle
      create  bin/rails
      create  bin/rake
      create  bin/setup
      create  config
      create  config/routes.rb
      create  config/application.rb
      create  config/environment.rb
      create  config/secrets.yml
      create  config/environments
      create  config/environments/development.rb
      create  config/environments/production.rb
      create  config/environments/test.rb
      create  config/initializers
      create  config/initializers/assets.rb
      create  config/initializers/backtrace_silencers.rb
      create  config/initializers/cookies_serializer.rb
      create  config/initializers/filter_parameter_logging.rb
      create  config/initializers/inflections.rb
      create  config/initializers/mime_types.rb
      create  config/initializers/session_store.rb
      create  config/initializers/wrap_parameters.rb
      create  config/locales
      create  config/locales/en.yml
      create  config/boot.rb
      create  config/database.yml
      create  db
      create  db/seeds.rb
      create  lib
      create  lib/tasks
      create  lib/tasks/.keep
      create  lib/assets
      create  lib/assets/.keep
      create  log
      create  log/.keep
      create  public
      create  public/404.html
      create  public/422.html
      create  public/500.html
      create  public/favicon.ico
      create  public/robots.txt
      create  test/fixtures
      create  test/fixtures/.keep
      create  test/controllers
      create  test/controllers/.keep
      create  test/mailers
      create  test/mailers/.keep
      create  test/models
      create  test/models/.keep
      create  test/helpers
      create  test/helpers/.keep
      create  test/integration
      create  test/integration/.keep
      create  test/test_helper.rb
      create  tmp/cache
      create  tmp/cache/assets
      create  vendor/assets/javascripts
      create  vendor/assets/javascripts/.keep
      create  vendor/assets/stylesheets
      create  vendor/assets/stylesheets/.keep
         run  bundle install
/Users/DavidRyan/.rbenv/versions/2.2.2/lib/ruby/2.2.0/yaml.rb:4:in `<top (required)>':
It seems your ruby installation is missing psych (for YAML output).
To eliminate this warning, please install libyaml and reinstall your ruby.
/Users/DavidRyan/.rbenv/versions/2.2.2/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:in `require': dlopen(/Users/DavidRyan/.rbenv/versions/2.2.2/lib/ruby/2.2.0/x86_64-darwin14/psych.bundle, 9): Library not loaded: /usr/local/lib/libyaml-0.2.dylib (LoadError)
  Referenced from: /Users/DavidRyan/.rbenv/versions/2.2.2/lib/ruby/2.2.0/x86_64-darwin14/psych.bundle
  Reason: image not found - /Users/DavidRyan/.rbenv/versions/2.2.2/lib/ruby/2.2.0/x86_64-darwin14/psych.bundle
    from /Users/DavidRyan/.rbenv/versions/2.2.2/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:in `require'
    from /Users/DavidRyan/.rbenv/versions/2.2.2/lib/ruby/2.2.0/psych.rb:1:in `<top (required)>'
    from /Users/DavidRyan/.rbenv/versions/2.2.2/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:in `require'
    from /Users/DavidRyan/.rbenv/versions/2.2.2/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:in `require'
    from /Users/DavidRyan/.rbenv/versions/2.2.2/lib/ruby/2.2.0/yaml.rb:5:in `<top (required)>'
    from /Users/DavidRyan/.rbenv/versions/2.2.2/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:in `require'
    from /Users/DavidRyan/.rbenv/versions/2.2.2/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:in `require'
    from /Users/DavidRyan/.rbenv/versions/2.2.2/lib/ruby/2.2.0/rubygems.rb:624:in `load_yaml'
    from /Users/DavidRyan/.rbenv/versions/2.2.2/lib/ruby/2.2.0/rubygems/config_file.rb:328:in `load_file'
    from /Users/DavidRyan/.rbenv/versions/2.2.2/lib/ruby/2.2.0/rubygems/config_file.rb:197:in `initialize'
    from /Users/DavidRyan/.rbenv/versions/2.2.2/lib/ruby/2.2.0/rubygems.rb:297:in `new'
    from /Users/DavidRyan/.rbenv/versions/2.2.2/lib/ruby/2.2.0/rubygems.rb:297:in `configuration'
    from /Users/DavidRyan/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/bundler-1.9.6/lib/bundler/rubygems_integration.rb:49:in `configuration'
    from /Users/DavidRyan/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/bundler-1.9.6/lib/bundler/rubygems_integration.rb:72:in `sources='
    from /Users/DavidRyan/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/bundler-1.9.6/lib/bundler/fetcher.rb:207:in `specs'
    from /Users/DavidRyan/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/bundler-1.9.6/lib/bundler/source/rubygems.rb:324:in `block (2 levels) in remote_specs'
    from /Users/DavidRyan/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/bundler-1.9.6/lib/bundler/source/rubygems.rb:322:in `each'
    from /Users/DavidRyan/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/bundler-1.9.6/lib/bundler/source/rubygems.rb:322:in `block in remote_specs'
    from /Users/DavidRyan/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/bundler-1.9.6/lib/bundler/index.rb:9:in `build'
    from /Users/DavidRyan/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/bundler-1.9.6/lib/bundler/source/rubygems.rb:305:in `remote_specs'
    from /Users/DavidRyan/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/bundler-1.9.6/lib/bundler/source/rubygems.rb:79:in `specs'
    from /Users/DavidRyan/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/bundler-1.9.6/lib/bundler/definition.rb:203:in `block (2 levels) in index'
    from /Users/DavidRyan/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/bundler-1.9.6/lib/bundler/definition.rb:201:in `each'
    from /Users/DavidRyan/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/bundler-1.9.6/lib/bundler/definition.rb:201:in `block in index'
    from /Users/DavidRyan/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/bundler-1.9.6/lib/bundler/index.rb:9:in `build'
    from /Users/DavidRyan/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/bundler-1.9.6/lib/bundler/definition.rb:198:in `index'
    from /Users/DavidRyan/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/bundler-1.9.6/lib/bundler/definition.rb:192:in `resolve'
    from /Users/DavidRyan/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/bundler-1.9.6/lib/bundler/definition.rb:132:in `specs'
    from /Users/DavidRyan/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/bundler-1.9.6/lib/bundler/definition.rb:121:in `resolve_remotely!'
    from /Users/DavidRyan/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/bundler-1.9.6/lib/bundler/installer.rb:79:in `run'
    from /Users/DavidRyan/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/bundler-1.9.6/lib/bundler/installer.rb:18:in `install'
    from /Users/DavidRyan/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/bundler-1.9.6/lib/bundler/cli/install.rb:80:in `run'
    from /Users/DavidRyan/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/bundler-1.9.6/lib/bundler/cli.rb:157:in `install'
    from /Users/DavidRyan/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/bundler-1.9.6/lib/bundler/vendor/thor/lib/thor/command.rb:27:in `run'
    from /Users/DavidRyan/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/bundler-1.9.6/lib/bundler/vendor/thor/lib/thor/invocation.rb:126:in `invoke_command'
    from /Users/DavidRyan/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/bundler-1.9.6/lib/bundler/vendor/thor/lib/thor.rb:359:in `dispatch'
    from /Users/DavidRyan/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/bundler-1.9.6/lib/bundler/vendor/thor/lib/thor/base.rb:440:in `start'
    from /Users/DavidRyan/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/bundler-1.9.6/lib/bundler/cli.rb:10:in `start'
    from /Users/DavidRyan/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/bundler-1.9.6/bin/bundle:20:in `block in <main>'
    from /Users/DavidRyan/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/bundler-1.9.6/lib/bundler/friendly_errors.rb:7:in `with_friendly_errors'
    from /Users/DavidRyan/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/bundler-1.9.6/bin/bundle:18:in `<main>'
Fetching gem metadata from https://rubygems.org/...........         run  bundle exec spring binstub --all
/Users/DavidRyan/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/bundler-1.9.6/lib/bundler/shared_helpers.rb:78: warning: Insecure world writable dir /usr/local in PATH, mode 040777
/Users/DavidRyan/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/bundler-1.9.6/lib/bundler/shared_helpers.rb:78: warning: Insecure world writable dir /usr/local in PATH, mode 040777
* bin/rake: spring inserted
* bin/rails: spring inserted
Davids-MacBook-Pro:Desktop DavidRyan$ cd treehouse
Davids-MacBook-Pro:treehouse DavidRyan$ rails s
/Users/DavidRyan/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/railties-4.2.1/lib/rails/app_rails_loader.rb:39: warning: Insecure world writable dir /usr/local in PATH, mode 040777
/Users/DavidRyan/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/bundler-1.9.6/lib/bundler/shared_helpers.rb:78: warning: Insecure world writable dir /usr/local in PATH, mode 040777
/Users/DavidRyan/.rbenv/versions/2.2.2/lib/ruby/2.2.0/yaml.rb:4:in `<top (required)>':
It seems your ruby installation is missing psych (for YAML output).
To eliminate this warning, please install libyaml and reinstall your ruby.
bin/rails:6: warning: already initialized constant APP_PATH
/Users/DavidRyan/Desktop/treehouse/bin/rails:6: warning: previous definition of APP_PATH was here
Usage: rails COMMAND [ARGS]

The most common rails commands are:
 generate    Generate new code (short-cut alias: "g")
 console     Start the Rails console (short-cut alias: "c")
 server      Start the Rails server (short-cut alias: "s")
 dbconsole   Start a console for the database specified in config/database.yml
             (short-cut alias: "db")
 new         Create a new Rails application. "rails new my_app" creates a
             new application called MyApp in "./my_app"

In addition to those, there are:

 destroy      Undo code generated with "generate" (short-cut alias: "d")
 plugin new   Generates skeleton for developing a Rails plugin
 runner       Run a piece of code in the application environment (short-cut alias: "r")

All commands can be run with -h (or --help) for more information. Davids-MacBook-Pro:treehouse DavidRyan$

Hi David,

Sure! Can you type below:

first - "brew install libyaml" and then - "rvm reinstall 2.2.2"

Let me know.

Salman please see below:

All commands can be run with -h (or --help) for more information. Davids-MacBook-Pro:treehouse DavidRyan$ brew install libyaml /usr/local/bin/brew: /usr/local/Library/brew.rb: /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby: bad interpreter: No such file or directory /usr/local/bin/brew: line 21: /usr/local/Library/brew.rb: Undefined error: 0 Davids-MacBook-Pro:treehouse DavidRyan$ rvm reinstall 2.2.2 -bash: rvm: command not found Davids-MacBook-Pro:treehouse DavidRyan$

Oh you have to leave treehouse folder to the root outside. Let's type: "cd "

and then do same the following methods - first - "brew install libyaml" and then - "rvm reinstall 2.2.2"