Ruby Rails Installation and Configuration Issues

2019-08-13 22:51发布

问题:

I had ruby 1.9.3 and I was trying to get the newest installed as well as get rails and gems and bundler etc all configured. It's extremely confusing and I'm getting lost in the weeds. I installed bitnami and was trying to follow the get started here: http://guides.rubyonrails.org/getting_started.html

when try to do rails new blog in a command I get the following:

    c:\RailsBlog>rails new blog
           exist
       identical  README.rdoc
       identical  Rakefile
       identical  config.ru
       identical  .gitignore
       identical  Gemfile
           exist  app
       identical  app/assets/javascripts/application.js
       identical  app/assets/stylesheets/application.css
       identical  app/controllers/application_controller.rb
       identical  app/helpers/application_helper.rb
       identical  app/views/layouts/application.html.erb
       identical  app/assets/images/.keep
       identical  app/mailers/.keep
       identical  app/models/.keep
       identical  app/controllers/concerns/.keep
       identical  app/models/concerns/.keep
           exist  bin
       identical  bin/bundle
       identical  bin/rails
       identical  bin/rake
       identical  bin/setup
           exist  config
       identical  config/routes.rb
       identical  config/application.rb
       identical  config/environment.rb
        conflict  config/secrets.yml
    Overwrite c:/RailsBlog/blog/config/secrets.yml? (enter "h" for help) [Ynaqdh] Y
           force  config/secrets.yml
           exist  config/environments
       identical  config/environments/development.rb
       identical  config/environments/production.rb
       identical  config/environments/test.rb
           exist  config/initializers
       identical  config/initializers/assets.rb
       identical  config/initializers/backtrace_silencers.rb
       identical  config/initializers/cookies_serializer.rb
       identical  config/initializers/filter_parameter_logging.rb
       identical  config/initializers/inflections.rb
       identical  config/initializers/mime_types.rb
       identical  config/initializers/session_store.rb
       identical  config/initializers/wrap_parameters.rb
           exist  config/locales
       identical  config/locales/en.yml
       identical  config/boot.rb
       identical  config/database.yml
           exist  db
       identical  db/seeds.rb
           exist  lib
           exist  lib/tasks
       identical  lib/tasks/.keep
           exist  lib/assets
       identical  lib/assets/.keep
           exist  log
       identical  log/.keep
           exist  public
       identical  public/404.html
       identical  public/422.html
       identical  public/500.html
       identical  public/favicon.ico
       identical  public/robots.txt
           exist  test/fixtures
       identical  test/fixtures/.keep
           exist  test/controllers
       identical  test/controllers/.keep
           exist  test/mailers
       identical  test/mailers/.keep
           exist  test/models
       identical  test/models/.keep
           exist  test/helpers
       identical  test/helpers/.keep
           exist  test/integration
       identical  test/integration/.keep
       identical  test/test_helper.rb
           exist  tmp/cache
           exist  tmp/cache/assets
           exist  vendor/assets/javascripts
       identical  vendor/assets/javascripts/.keep
           exist  vendor/assets/stylesheets
       identical  vendor/assets/stylesheets/.keep
             run  bundle install
    Fetching gem metadata from https://rubygems.org/...........
    Fetching version metadata from https://rubygems.org/...
    Fetching dependency metadata from https://rubygems.org/..
    Resolving dependencies..............................................
    Using rake 11.1.1
    Using i18n 0.7.0
    Using json 1.8.3
    Using minitest 5.8.4
    Using thread_safe 0.3.5
    Using builder 3.2.2
    Using erubis 2.7.0
    Using mini_portile2 2.0.0
    Using rack 1.6.4
    Installing mime-types-data 3.2016.0221

    Gem::InstallError: mime-types-data requires Ruby version >= 2.0.
    Using arel 6.0.3
    Installing debug_inspector 0.0.2 with native extensions
    Using bundler 1.11.2
    Installing coffee-script-source 1.10.0
    Installing execjs 2.6.0
    Using thor 0.19.1
    Installing columnize 0.9.0
    Using concurrent-ruby 1.0.1
    Installing debugger-linecache 1.2.0
    Installing debugger-ruby_core_source 1.3.8
    Installing multi_json 1.11.2
    Installing sass 3.4.21
    Installing tilt 2.0.2
    Installing sqlite3 1.3.11
    Installing rdoc 4.2.2
    Using tzinfo 1.2.2
    Using nokogiri 1.6.7.2
    Using rack-test 0.6.3
    An error occurred while installing mime-types-data (3.2016.0221), and Bundler
    cannot continue.
    Make sure that `gem install mime-types-data -v '3.2016.0221'` succeeds before
    bundling.

I installed 2.0.0-39 ruby with bitnami and downloaded stuff for ruby 2.3.0. I've tried installing the bundler and each thing I get told to do, and I can't seem to figure out what I'm doing wrong.

Can anyone help point me in the right direction? I wanted to go throug the getting started and move on from there. I have already written stuff in ruby, but in a specific application, to automate processes. I'm now trying to learn how to use it for web development, because I really like the language. Any help is appreciated. I am not great at server side configurations and all that, but I want to get my test server configured so I can work on learning rails.

Thanks!

UPDATE:

I now have the more current version of ruby installed. I still get an error trying to run gem install byebug

here are my versions: c:>ruby -v ruby 2.2.4p230 (2015-12-16 revision 53155) [i386-mingw32]

    c:\>rails -v
    Rails 4.2.6

    c:\>gem -v
    2.6.2

when I try to install byebug, I get the following:

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

        current directory: C:/Ruby22/lib/ruby/gems/2.2.0/gems/byebug-8.2.2/ext/byebug
    C:/Ruby22/bin/ruby.exe -r ./siteconf20160324-4624-28n8zp.rb extconf.rb
    creating Makefile

    current directory: C:/Ruby22/lib/ruby/gems/2.2.0/gems/byebug-8.2.2/ext/byebug
    make "DESTDIR=" clean

    current directory: C:/Ruby22/lib/ruby/gems/2.2.0/gems/byebug-8.2.2/ext/byebug
    make "DESTDIR="
    generating byebug-i386-mingw32.def
    compiling breakpoint.c
    cc1.exe: warnings being treated as errors
    In file included from c:/Ruby22/include/ruby-2.2.0/ruby/defines.h:163:0,
                     from c:/Ruby22/include/ruby-2.2.0/ruby/ruby.h:29,
                     from c:/Ruby22/include/ruby-2.2.0/ruby.h:33,
                     from ./byebug.h:4,
                     from breakpoint.c:1:
    c:/Ruby22/include/ruby-2.2.0/ruby/win32.h:319:44: error: 'struct timespec' declared inside parameter list
    c:/Ruby22/include/ruby-2.2.0/ruby/win32.h:319:44: error: its scope is only this definition or declaration, which is probably not what you want
    c:/Ruby22/include/ruby-2.2.0/ruby/win32.h:320:43: error: 'struct timespec' declared inside parameter list
    make: *** [breakpoint.o] Error 1

    make failed, exit code 2

    Gem files will remain installed in C:/Ruby22/lib/ruby/gems/2.2.0/gems/byebug-8.2.2 for inspection.
    Results logged to C:/Ruby22/lib/ruby/gems/2.2.0/extensions/x86-mingw32/2.2.0/byebug-8.2.2/gem_make.out

I've been on countless boards, including downloading the ssl cert and copying to folder. Nothing is getting me passed this point. Thanks for all the responses and attempts to help!