ruby-on-rails – ruby​​ 2.3无法运行“rake routes”

ruby-on-rails – ruby​​ 2.3无法运行“rake routes”,第1张

概述我使用带有rails 4.2.5的新 ruby版本(2.3.0),我遇到了“rake”命令的问题. 编辑:我修改了bin / rake #!/usr/bin/env rubyrequire_relative '../config/boot'require 'rake'Rake.application.run 现在的错误是: ➜ rvm:(ruby-2.3.0@rails4.2) git:(e 我使用带有rails 4.2.5的新 ruby版本(2.3.0),我遇到了“rake”命令的问题.

编辑:我修改了bin / rake

#!/usr/bin/env rubyrequire_relative '../config/boot'require 'rake'Rake.application.run

现在的错误是:

➜ rvm:(ruby-2.3.0@rails4.2) git:(edge) ✗ rake routes./bin/rake:3:in `require': cannot load such file -- rake (LoadError)    from ./bin/rake:3:in `<main>'

该命令适用于ruby 2.2.4

这是我的gemfile:

source 'https://rubygems.org'# ruby '2.3.0'# Bundle edge Rails instead: gem 'rails',github: 'rails/rails'gem 'rails','4.2.5'# Use postgresql as the database for Active Recordgem 'pg','0.18.3'gem 'sass-rails','~> 5.0'gem 'bootstrap-sass','~> 3.3.0'# Use UglifIEr as compressor for JavaScript assetsgem 'uglifIEr','>= 1.3.0'gem 'coffee-rails','~> 4.1.0'# gem 'therubyracer',platforms: :rubygem 'jquery-rails'gem 'turbolinks'# Build JsON APIs with ease. Read more: https://github.com/rails/jbuildergem 'jbuilder','~> 2.0'group :doc do  # bundle exec rake doc:rails generates the API under doc/API.  gem 'sdoc',require: falseend# Use ActiveModel has_secure_passwordgem 'bcrypt','~> 3.1.7'gem 'paperclip','~> 4.2.1'gem 'will_paginate','3.0.7'gem 'bootstrap-will_paginate'gem 'auto_HTML','1.6.4'gem 'faker','1.1.2'# Spring speeds up development by keePing your application running in the background. Read more: https://github.com/rails/springgem 'spring',group: :development# Use unicorn as the app server# gem 'unicorn'# Use CAPIstrano for deployment# gem 'cAPIstrano',group: :developmentgroup :development,:test do  gem 'guard'  # gem 'guard-livereload'  # gem 'guard-rspec'  # gem 'guard-cucumber'  gem 'rspec-rails'  gem 'spring-commands-rspec'  gem 'shoulda-matchers'  gem 'better_errors'  gem 'binding_of_caller'  gem 'byeBUG','~> 3.5.1'  gem 'quIEt_assets'  #deBUG  gem 'pry-rails'  gem 'pry-byeBUG'  gem 'pry-stack_explorer'  gem 'pry-rescue'  gem 'awesome_print'  gem 'hirb'endgroup :development do  # A static analysis security vulnerability scanner for Ruby on Rails applications  gem 'brakeman',:require => false  # Checks for code optimization.  gem 'rubycritic',:require => false  # Checks for undefined routes and unreachable actions.  gem 'traceroute'  # Checks for query optimizations.  gem 'bullet'  #  Profiler for your development and production Ruby rack apps.  gem 'rack-mini-profiler',require: false  # Checks for code optimization.  gem 'rails_best_practices'  # Checks for compliance to Sandi Metz's rules for developers.  gem 'sandi_meter'  #  A Ruby static code analyzer,based on the community Ruby style guIDe.  gem 'rubocop',require: falseendgroup :test do  gem 'capybara','2.5.0'  gem 'factory_girl_rails','4.4.1'  gem 'cucumber-rails',:require => false  gem 'database_cleaner','~> 1.4.1'  gem 'simplecov',:require => falseendgroup :production do  gem 'rails_12factor','0.0.2'end

这是我的gemfile.lock:

GEM  remote: https://rubygems.org/  specs:    abstract_type (0.0.7)    actionmailer (4.2.5)      actionpack (= 4.2.5)      actionvIEw (= 4.2.5)      activejob (= 4.2.5)      mail (~> 2.5,>= 2.5.4)      rails-dom-testing (~> 1.0,>= 1.0.5)    actionpack (4.2.5)      actionvIEw (= 4.2.5)      activesupport (= 4.2.5)      rack (~> 1.6)      rack-test (~> 0.6.2)      rails-dom-testing (~> 1.0,>= 1.0.5)      rails-HTML-sanitizer (~> 1.0,>= 1.0.2)    actionvIEw (4.2.5)      activesupport (= 4.2.5)      builder (~> 3.1)      erubis (~> 2.7.0)      rails-dom-testing (~> 1.0,>= 1.0.2)    activejob (4.2.5)      activesupport (= 4.2.5)      globalID (>= 0.3.0)    activemodel (4.2.5)      activesupport (= 4.2.5)      builder (~> 3.1)    activerecord (4.2.5)      activemodel (= 4.2.5)      activesupport (= 4.2.5)      arel (~> 6.0)    activesupport (4.2.5)      i18n (~> 0.7)      Json (~> 1.7,>= 1.7.7)      minitest (~> 5.1)      thread_safe (~> 0.3,>= 0.3.4)      tzinfo (~> 1.1)    adamantium (0.2.0)      ice_nine (~> 0.11.0)      memoizable (~> 0.4.0)    addressable (2.4.0)    arel (6.0.3)    ast (2.2.0)    astrolabe (1.3.1)      parser (~> 2.2)    auto_HTML (1.6.4)      redcarpet (~> 3.1)      rinku (~> 1.5.0)    autoprefixer-rails (6.2.3)      execJs      Json    awesome_print (1.6.1)    axiom-types (0.1.1)      descendants_tracker (~> 0.0.4)      ice_nine (~> 0.11.0)      thread_safe (~> 0.3,>= 0.3.1)    bcrypt (3.1.10)    better_errors (2.1.1)      coderay (>= 1.0.0)      erubis (>= 2.6.6)      rack (>= 0.9.0)    binding_of_caller (0.7.2)      deBUG_inspector (>= 0.0.1)    bootstrap-sass (3.3.6)      autoprefixer-rails (>= 5.2.1)      sass (>= 3.3.4)    bootstrap-will_paginate (0.0.10)      will_paginate    brakeman (3.1.4)      erubis (~> 2.6)      fastercsv (~> 1.5)      haml (>= 3.0,< 5.0)      highline (>= 1.6.20,< 2.0)      multi_Json (~> 1.2)      ruby2ruby (>= 2.1.1,< 2.3.0)      ruby_parser (~> 3.7.0)      safe_yaml (>= 1.0)      sass (~> 3.0)      slim (>= 1.3.6,< 4.0)      terminal-table (~> 1.4)    builder (3.2.2)    bullet (4.14.10)      activesupport (>= 3.0.0)      uniform_notifIEr (~> 1.9.0)    byeBUG (3.5.1)      columnize (~> 0.8)      deBUGger-linecache (~> 1.2)      slop (~> 3.6)    capybara (2.5.0)      mime-types (>= 1.16)      nokogiri (>= 1.3.3)      rack (>= 1.0.0)      rack-test (>= 0.5.4)      xpath (~> 2.0)    climate_control (0.0.3)      activesupport (>= 3.0)    cocaine (0.5.8)      climate_control (>= 0.0.3,< 1.0)    code_analyzer (0.4.5)      sexp_processor    codeclimate-engine-rb (0.1.0)      virtus (~> 1.0)    coderay (1.1.0)    coercible (1.0.0)      descendants_tracker (~> 0.0.1)    coffee-rails (4.1.1)      coffee-script (>= 2.2.0)      railtIEs (>= 4.0.0,< 5.1.x)    coffee-script (2.4.1)      coffee-script-source      execJs    coffee-script-source (1.10.0)    colored (1.2)    columnize (0.9.0)    concord (0.1.5)      adamantium (~> 0.2.0)      equalizer (~> 0.0.9)    concurrent-ruby (1.0.0)    cucumber (1.3.20)      builder (>= 2.1.2)      diff-lcs (>= 1.1.3)      gherkin (~> 2.12)      multi_Json (>= 1.7.5,< 2.0)      multi_test (>= 0.1.2)    cucumber-rails (1.4.2)      capybara (>= 1.1.2,< 3)      cucumber (>= 1.3.8,< 2)      mime-types (>= 1.16,< 3)      nokogiri (~> 1.5)      rails (>= 3,< 5)    database_cleaner (1.4.1)    deBUG_inspector (0.0.2)    deBUGger-linecache (1.2.0)    descendants_tracker (0.0.4)      thread_safe (~> 0.3,>= 0.3.1)    diff-lcs (1.2.5)    docile (1.1.5)    equalizer (0.0.11)    erubis (2.7.0)    execJs (2.6.0)    factory_girl (4.4.0)      activesupport (>= 3.0.0)    factory_girl_rails (4.4.1)      factory_girl (~> 4.4.0)      railtIEs (>= 3.0.0)    faker (1.1.2)      i18n (~> 0.5)    fastercsv (1.5.5)    ffi (1.9.10)    flay (2.6.1)      ruby_parser (~> 3.0)      sexp_processor (~> 4.0)    flog (4.3.2)      ruby_parser (~> 3.1,> 3.1.0)      sexp_processor (~> 4.4)    formatador (0.2.5)    gherkin (2.12.2)      multi_Json (~> 1.3)    globalID (0.3.6)      activesupport (>= 4.1.0)    guard (2.13.0)      formatador (>= 0.2.4)      Listen (>= 2.7,<= 4.0)      lumberjack (~> 1.0)      nenv (~> 0.1)      notiffany (~> 0.0)      pry (>= 0.9.12)      shellany (~> 0.0)      thor (>= 0.18.1)    haml (4.0.7)      tilt    highline (1.7.8)    hirb (0.7.3)    i18n (0.7.0)    ice_nine (0.11.1)    interception (0.5)    jbuilder (2.4.0)      activesupport (>= 3.0.0,< 5.1)      multi_Json (~> 1.2)    jquery-rails (4.0.5)      rails-dom-testing (~> 1.0)      railtIEs (>= 4.2.0)      thor (>= 0.14,< 2.0)    Json (1.8.3)    launchy (2.4.3)      addressable (~> 2.3)    Listen (3.0.5)      rb-fsevent (>= 0.9.3)      rb-inotify (>= 0.9)    loofah (2.0.3)      nokogiri (>= 1.5.9)    lumberjack (1.0.10)    mail (2.6.3)      mime-types (>= 1.16,< 3)    memoizable (0.4.2)      thread_safe (~> 0.3,>= 0.3.1)    method_source (0.8.2)    mime-types (2.99)    mini_portile2 (2.0.0)    minitest (5.8.3)    mixlib-cli (1.5.0)    multi_Json (1.11.2)    multi_test (0.1.2)    nenv (0.2.0)    nokogiri (1.6.7.1)      mini_portile2 (~> 2.0.0.rc2)    notiffany (0.0.8)      nenv (~> 0.1)      shellany (~> 0.0)    paperclip (4.2.4)      activemodel (>= 3.2.0)      activesupport (>= 3.2.0)      cocaine (~> 0.5.5)      mime-types    parser (2.2.3.0)      ast (>= 1.1,< 3.0)    pg (0.18.3)    powerpack (0.1.1)    private_attr (1.1.0)    procto (0.0.2)    pry (0.10.3)      coderay (~> 1.1.0)      method_source (~> 0.8.1)      slop (~> 3.4)    pry-byeBUG (3.0.1)      byeBUG (~> 3.4)      pry (~> 0.10)    pry-rails (0.3.4)      pry (>= 0.9.10)    pry-rescue (1.4.2)      interception (>= 0.5)      pry    pry-stack_explorer (0.4.9.2)      binding_of_caller (>= 0.7)      pry (>= 0.9.11)    quIEt_assets (1.1.0)      railtIEs (>= 3.1,< 5.0)    rack (1.6.4)    rack-mini-profiler (0.9.8)      rack (>= 1.1.3)    rack-test (0.6.3)      rack (>= 1.0)    rails (4.2.5)      actionmailer (= 4.2.5)      actionpack (= 4.2.5)      actionvIEw (= 4.2.5)      activejob (= 4.2.5)      activemodel (= 4.2.5)      activerecord (= 4.2.5)      activesupport (= 4.2.5)      bundler (>= 1.3.0,< 2.0)      railtIEs (= 4.2.5)      sprockets-rails    rails-deprecated_sanitizer (1.0.3)      activesupport (>= 4.2.0.Alpha)    rails-dom-testing (1.0.7)      activesupport (>= 4.2.0.beta,< 5.0)      nokogiri (~> 1.6.0)      rails-deprecated_sanitizer (>= 1.0.1)    rails-HTML-sanitizer (1.0.2)      loofah (~> 2.0)    rails_12factor (0.0.2)      rails_serve_static_assets      rails_stdout_logging    rails_best_practices (1.15.7)      activesupport      code_analyzer (>= 0.4.3)      colored      erubis      i18n      Json      require_all      ruby-progressbar    rails_serve_static_assets (0.0.4)    rails_stdout_logging (0.0.4)    railtIEs (4.2.5)      actionpack (= 4.2.5)      activesupport (= 4.2.5)      rake (>= 0.8.7)      thor (>= 0.18.1,< 2.0)    rainbow (2.0.0)    rake (10.4.2)    rb-fsevent (0.9.7)    rb-inotify (0.9.5)      ffi (>= 0.5.0)    rdoc (4.2.1)      Json (~> 1.4)    redcarpet (3.3.4)    reek (3.8.1)      codeclimate-engine-rb (~> 0.1.0)      parser (~> 2.2,>= 2.2.2.5)      private_attr (~> 1.1)      rainbow (~> 2.0)      unparser (~> 0.2.2)    require_all (1.3.3)    rinku (1.5.1)    rspec-core (3.4.1)      rspec-support (~> 3.4.0)    rspec-expectations (3.4.0)      diff-lcs (>= 1.2.0,< 2.0)      rspec-support (~> 3.4.0)    rspec-mocks (3.4.0)      diff-lcs (>= 1.2.0,< 2.0)      rspec-support (~> 3.4.0)    rspec-rails (3.4.0)      actionpack (>= 3.0,< 4.3)      activesupport (>= 3.0,< 4.3)      railtIEs (>= 3.0,< 4.3)      rspec-core (~> 3.4.0)      rspec-expectations (~> 3.4.0)      rspec-mocks (~> 3.4.0)      rspec-support (~> 3.4.0)    rspec-support (3.4.1)    rubocop (0.35.1)      astrolabe (~> 1.3)      parser (>= 2.2.3.0,< 3.0)      powerpack (~> 0.1)      rainbow (>= 1.99.1,< 3.0)      ruby-progressbar (~> 1.7)      tins (<= 1.6.0)    ruby-progressbar (1.7.5)    ruby2ruby (2.2.0)      ruby_parser (~> 3.1)      sexp_processor (~> 4.0)    ruby_parser (3.7.2)      sexp_processor (~> 4.1)    rubycritic (2.4.1)      flay (= 2.6.1)      flog (= 4.3.2)      parser (>= 2.2.0,< 3.0)      reek (= 3.8.1)      virtus (~> 1.0)    safe_yaml (1.0.4)    sandi_meter (1.2.0)      Json      launchy      mixlib-cli    sass (3.4.20)    sass-rails (5.0.4)      railtIEs (>= 4.0.0,< 5.0)      sass (~> 3.1)      sprockets (>= 2.8,< 4.0)      sprockets-rails (>= 2.0,< 4.0)      tilt (>= 1.1,< 3)    sdoc (0.4.1)      Json (~> 1.7,>= 1.7.7)      rdoc (~> 4.0)    sexp_processor (4.6.0)    shellany (0.0.1)    shoulda-matchers (3.0.1)      activesupport (>= 4.0.0)    simplecov (0.11.1)      docile (~> 1.1.0)      Json (~> 1.8)      simplecov-HTML (~> 0.10.0)    simplecov-HTML (0.10.0)    slim (3.0.6)      temple (~> 0.7.3)      tilt (>= 1.3.3,< 2.1)    slop (3.6.0)    spring (1.6.1)    spring-commands-rspec (1.0.4)      spring (>= 0.9.1)    sprockets (3.5.2)      concurrent-ruby (~> 1.0)      rack (> 1,< 3)    sprockets-rails (3.0.0)      actionpack (>= 4.0)      activesupport (>= 4.0)      sprockets (>= 3.0.0)    temple (0.7.6)    terminal-table (1.5.2)    thor (0.19.1)    thread_safe (0.3.5)    tilt (2.0.1)    tins (1.6.0)    traceroute (0.5.0)      rails (>= 3.0.0)    turbolinks (2.5.3)      coffee-rails    tzinfo (1.2.2)      thread_safe (~> 0.1)    uglifIEr (2.7.2)      execJs (>= 0.3.0)      Json (>= 1.8.0)    uniform_notifIEr (1.9.0)    unparser (0.2.4)      abstract_type (~> 0.0.7)      adamantium (~> 0.2.0)      concord (~> 0.1.5)      diff-lcs (~> 1.2.5)      equalizer (~> 0.0.9)      parser (~> 2.2.2)      procto (~> 0.0.2)    virtus (1.0.5)      axiom-types (~> 0.1)      coercible (~> 1.0)      descendants_tracker (~> 0.0,>= 0.0.3)      equalizer (~> 0.0,>= 0.0.9)    will_paginate (3.0.7)    xpath (2.0.0)      nokogiri (~> 1.3)PLATFORMS  rubyDEPENDENCIES  auto_HTML (= 1.6.4)  awesome_print  bcrypt (~> 3.1.7)  better_errors  binding_of_caller  bootstrap-sass (~> 3.3.0)  bootstrap-will_paginate  brakeman  bullet  byeBUG (~> 3.5.1)  capybara (= 2.5.0)  coffee-rails (~> 4.1.0)  cucumber-rails  database_cleaner (~> 1.4.1)  factory_girl_rails (= 4.4.1)  faker (= 1.1.2)  guard  hirb  jbuilder (~> 2.0)  jquery-rails  paperclip (~> 4.2.1)  pg (= 0.18.3)  pry-byeBUG  pry-rails  pry-rescue  pry-stack_explorer  quIEt_assets  rack-mini-profiler  rails (= 4.2.5)  rails_12factor (= 0.0.2)  rails_best_practices  rspec-rails  rubocop  rubycritic  sandi_meter  sass-rails (~> 5.0)  sdoc  shoulda-matchers  simplecov  spring  spring-commands-rspec  traceroute  turbolinks  uglifIEr (>= 1.3.0)  will_paginate (= 3.0.7)BUNDLED WITH   1.11.2

提前致谢.

解决方法 重新安装Ruby对我有帮助.使用RVM可以输入

rvm reinstall ruby-2.3.0

在控制台上.

总结

以上是内存溢出为你收集整理的ruby-on-rails – ruby​​ 2.3无法运行“rake routes”全部内容,希望文章能够帮你解决ruby-on-rails – ruby​​ 2.3无法运行“rake routes”所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/langs/1277101.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-06-09
下一篇 2022-06-09

发表评论

登录后才能评论

评论列表(0条)

保存