繁体   English   中英

为什么Rails作曲家只能创建没有功能的基本应用程序? 'open_http':找不到404(OpenURI :: HTTPError)

[英]Why is Rails composer only creating a basic app without features? `open_http': 404 Not Found (OpenURI::HTTPError)

我刚刚完成了Daniel Kehoe撰写的详尽且经过充分说明的Rails教程,最后尝试使用Rails Composer进行实验。 我在Cloud 9和Windows 10上创建应用程序时遇到问题,并出现相同的错误。 该应用程序仅创建一个基本的Rails应用程序,而不创建具有所有其他功能的Rails Composer应用程序。

首先,我尝试使用以下命令创建新项目:

rails new rails-devise-roles -m https://raw.github.com/RailsApps/rails-composer/master/composer

并得到以下错误:

C:/RailsInstaller/Ruby2.2.0/lib/ruby/2.2.0/open-uri.rb:358:in `open_http': 404 Not Found (OpenURI::HTTPError)

我试图在此文件中找到第358行,但是在目录C:/RailsInstaller/Ruby2.2.0/lib/ruby/2.2.0中,似乎没有要检查的“ open-uri.rb”文件。

以下是完整的应用程序创建命令及其结果:

C:\>rails new rails-devise-roles -m https://raw.github.com/RailsApps/rails-composer/master/composer
      create
      create  README.md
      create  Rakefile
      create  config.ru
      create  .gitignore
      create  Gemfile
         run  git init from "."
Initialized empty Git repository in C:/rails-devise-roles/.git/
      create  app
      create  app/assets/config/manifest.js
      create  app/assets/javascripts/application.js
      create  app/assets/javascripts/cable.js
      create  app/assets/stylesheets/application.css
      create  app/channels/application_cable/channel.rb
      create  app/channels/application_cable/connection.rb
      create  app/controllers/application_controller.rb
      create  app/helpers/application_helper.rb
      create  app/jobs/application_job.rb
      create  app/mailers/application_mailer.rb
      create  app/models/application_record.rb
      create  app/views/layouts/application.html.erb
      create  app/views/layouts/mailer.html.erb
      create  app/views/layouts/mailer.text.erb
      create  app/assets/images/.keep
      create  app/assets/javascripts/channels
      create  app/assets/javascripts/channels/.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  bin/update
      create  bin/yarn
      create  config
      create  config/routes.rb
      create  config/application.rb
      create  config/environment.rb
      create  config/secrets.yml
      create  config/cable.yml
      create  config/puma.rb
      create  config/environments
      create  config/environments/development.rb
      create  config/environments/production.rb
      create  config/environments/test.rb
      create  config/initializers
      create  config/initializers/application_controller_renderer.rb
      create  config/initializers/assets.rb
      create  config/initializers/backtrace_silencers.rb
      create  config/initializers/cookies_serializer.rb
      create  config/initializers/cors.rb
      create  config/initializers/filter_parameter_logging.rb
      create  config/initializers/inflections.rb
      create  config/initializers/mime_types.rb
      create  config/initializers/new_framework_defaults_5_1.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/apple-touch-icon-precomposed.png
      create  public/apple-touch-icon.png
      create  public/favicon.ico
      create  public/robots.txt
      create  test/fixtures
      create  test/fixtures/.keep
      create  test/fixtures/files
      create  test/fixtures/files/.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  test/system
      create  test/system/.keep
      create  test/application_system_test_case.rb
      create  tmp
      create  tmp/.keep
      create  tmp/cache
      create  tmp/cache/assets
      create  vendor
      create  vendor/.keep
      create  package.json
      remove  config/initializers/cors.rb
      remove  config/initializers/new_framework_defaults_5_1.rb
       apply  https://raw.github.com/RailsApps/rails-composer/master/composer
C:/RailsInstaller/Ruby2.2.0/lib/ruby/2.2.0/open-uri.rb:358:in `open_http': 404 Not Found (OpenURI::HTTPError)
        from C:/RailsInstaller/Ruby2.2.0/lib/ruby/2.2.0/open-uri.rb:736:in `buffer_open'
        from C:/RailsInstaller/Ruby2.2.0/lib/ruby/2.2.0/open-uri.rb:211:in `block in open_loop'
        from C:/RailsInstaller/Ruby2.2.0/lib/ruby/2.2.0/open-uri.rb:209:in `catch'
        from C:/RailsInstaller/Ruby2.2.0/lib/ruby/2.2.0/open-uri.rb:209:in `open_loop'
        from C:/RailsInstaller/Ruby2.2.0/lib/ruby/2.2.0/open-uri.rb:150:in `open_uri'
        from C:/RailsInstaller/Ruby2.2.0/lib/ruby/2.2.0/open-uri.rb:716:in `open'
        from C:/RailsInstaller/Ruby2.2.0/lib/ruby/2.2.0/open-uri.rb:34:in `open'
        from C:/RailsInstaller/Ruby2.2.0/lib/ruby/gems/2.2.0/gems/thor-0.20.0/lib/thor/actions.rb:220:in `apply'
        from C:/RailsInstaller/Ruby2.2.0/lib/ruby/gems/2.2.0/gems/railties-5.1.5/lib/rails/generators/app_base.rb:162:in `apply_rails_template'
        from (eval):1:in `apply_rails_template'
        from C:/RailsInstaller/Ruby2.2.0/lib/ruby/gems/2.2.0/gems/thor-0.20.0/lib/thor/command.rb:27:in `run'
        from C:/RailsInstaller/Ruby2.2.0/lib/ruby/gems/2.2.0/gems/thor-0.20.0/lib/thor/invocation.rb:126:in `invoke_command'
        from C:/RailsInstaller/Ruby2.2.0/lib/ruby/gems/2.2.0/gems/thor-0.20.0/lib/thor/invocation.rb:133:in `block in invoke_all'
        from C:/RailsInstaller/Ruby2.2.0/lib/ruby/gems/2.2.0/gems/thor-0.20.0/lib/thor/invocation.rb:133:in `each'
        from C:/RailsInstaller/Ruby2.2.0/lib/ruby/gems/2.2.0/gems/thor-0.20.0/lib/thor/invocation.rb:133:in `map'
        from C:/RailsInstaller/Ruby2.2.0/lib/ruby/gems/2.2.0/gems/thor-0.20.0/lib/thor/invocation.rb:133:in `invoke_all'
        from C:/RailsInstaller/Ruby2.2.0/lib/ruby/gems/2.2.0/gems/thor-0.20.0/lib/thor/group.rb:232:in `dispatch'
        from C:/RailsInstaller/Ruby2.2.0/lib/ruby/gems/2.2.0/gems/thor-0.20.0/lib/thor/base.rb:466:in `start'
        from C:/RailsInstaller/Ruby2.2.0/lib/ruby/gems/2.2.0/gems/railties-5.1.5/lib/rails/commands/application/application_command.rb:24:in `perform'
        from C:/RailsInstaller/Ruby2.2.0/lib/ruby/gems/2.2.0/gems/thor-0.20.0/lib/thor/command.rb:27:in `run'
        from C:/RailsInstaller/Ruby2.2.0/lib/ruby/gems/2.2.0/gems/thor-0.20.0/lib/thor/invocation.rb:126:in `invoke_command'
        from C:/RailsInstaller/Ruby2.2.0/lib/ruby/gems/2.2.0/gems/thor-0.20.0/lib/thor.rb:387:in `dispatch'
        from C:/RailsInstaller/Ruby2.2.0/lib/ruby/gems/2.2.0/gems/railties-5.1.5/lib/rails/command/base.rb:63:in `perform'
        from C:/RailsInstaller/Ruby2.2.0/lib/ruby/gems/2.2.0/gems/railties-5.1.5/lib/rails/command.rb:44:in `invoke'
        from C:/RailsInstaller/Ruby2.2.0/lib/ruby/gems/2.2.0/gems/railties-5.1.5/lib/rails/cli.rb:16:in `<top (required)>'
        from C:/RailsInstaller/Ruby2.2.0/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:69:in `require'
        from C:/RailsInstaller/Ruby2.2.0/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:69:in `require'
        from C:/RailsInstaller/Ruby2.2.0/lib/ruby/gems/2.2.0/gems/railties-5.1.5/exe/rails:9:in `<top (required)>'
        from C:/RailsInstaller/Ruby2.2.0/bin/rails:23:in `load'
        from C:/RailsInstaller/Ruby2.2.0/bin/rails:23:in `<main>'

您的端点无法访问,请尝试:

rails new rails-devise-roles -m https://raw.githubusercontent.com/RailsApps/rails-composer/master/composer.rb

但是,如果那行不通,只需从原始文件本地下载ruby代码,然后指向本地rb文件即可。

在您的终端中:

curl -O https://raw.githubusercontent.com/RailsApps/rails-composer/master/composer.rb

rails new rails-devise-roles -m composer.rb

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM