Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/heroku/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ruby on rails 404 Heroku上的错误_Ruby On Rails_Heroku_Deployment - Fatal编程技术网

Ruby on rails 404 Heroku上的错误

Ruby on rails 404 Heroku上的错误,ruby-on-rails,heroku,deployment,Ruby On Rails,Heroku,Deployment,我在部署rails API后端时遇到404错误。日志中没有显示任何可以排除的明显错误。日志如下 我真的很感谢你能提供的任何帮助或指导。谢谢 Rails.application.routes.draw do resources :favorites resources :users resources :artworks # For details on the DSL available within this file, see http://guides.rubyonrail

我在部署rails API后端时遇到404错误。日志中没有显示任何可以排除的明显错误。日志如下

我真的很感谢你能提供的任何帮助或指导。谢谢

Rails.application.routes.draw do
  resources :favorites
  resources :users
  resources :artworks
  # For details on the DSL available within this file, see http://guides.rubyonrails.org/routing.html
end

-----> Ruby app detected
-----> Compiling Ruby/Rails
-----> Using Ruby version: ruby-2.3.3
-----> Installing dependencies using bundler 1.13.7
       Running: bundle install --without development:test --path vendor/bundle --binstubs vendor/bundle/bin -j4 --deployment
       Warning: the running version of Bundler (1.13.7) is older than the version that created the lockfile (1.14.3). We suggest you upgrade to the latest version of Bundler by running `gem install bundler`.
       Fetching gem metadata from https://rubygems.org/.........
       Fetching version metadata from https://rubygems.org/..
       Fetching dependency metadata from https://rubygems.org/.
       Using rake 12.0.0
       Using concurrent-ruby 1.0.4
       Using i18n 0.8.0
       Using minitest 5.10.1
       Using thread_safe 0.3.5
       Using builder 3.2.3
       Using erubis 2.7.0
       Using mini_portile2 2.1.0
       Using rack 2.0.1
       Using nio4r 1.2.1
       Using websocket-extensions 0.1.2
       Using mime-types-data 3.2016.0521
       Using arel 7.1.4
       Using method_source 0.8.2
       Using pg 0.19.0
       Using puma 3.7.0
       Using rack-cors 0.4.0
       Using bundler 1.13.7
       Using thor 0.19.4
       Using tzinfo 1.2.2
       Using faker 1.7.2
       Using nokogiri 1.7.0.1
       Using websocket-driver 0.6.5
       Using mime-types 3.1
       Using rack-test 0.6.3
       Using sprockets 3.7.1
       Using activesupport 5.0.1
       Using loofah 2.0.3
       Using mail 2.6.4
       Using rails-dom-testing 2.0.2
       Using globalid 0.3.7
       Using activemodel 5.0.1
       Using rails-html-sanitizer 1.0.3
       Using activejob 5.0.1
       Using activerecord 5.0.1
       Using actionview 5.0.1
       Using actionpack 5.0.1
       Using actioncable 5.0.1
       Using actionmailer 5.0.1
       Using railties 5.0.1
       Using sprockets-rails 3.2.0
       Using rails 5.0.1
       Bundle complete! 11 Gemfile dependencies, 42 gems now installed.
       Gems in the groups development and test were not installed.
       Bundled gems are installed into ./vendor/bundle.
       Bundle completed (3.60s)
       Cleaning up the bundler cache.
       Warning: the running version of Bundler (1.13.7) is older than the version that created the lockfile (1.14.3). We suggest you upgrade to the latest version of Bundler by running `gem install bundler`.
-----> Detecting rake tasks
-----> Discovering process types
       Procfile declares types     -> web
       Default types for buildpack -> console, rake, worker
-----> Compressing...
       Done: 24.7M
-----> Launching...
       Released v11
       https://still-crag-23724.herokuapp.com/ deployed to Heroku

您可以尝试重新启动heroku,如果不起作用,可以将routes.rb文件粘贴到此处吗?

谢谢您的帮助。我尝试了Heroku重新启动,但没有成功,我在上面添加了my routes.rb。如果您访问应用程序的url,它不会显示任何内容,但是如果您添加“/favorites”或“/users”,它会显示您的工作。我建议您添加根路径
根“收藏夹#索引”
或任何其他与您的应用程序匹配的路径,以便主url始终重定向到应用程序的某些部分。我非常感谢您的帮助-设置根路径有效!再次感谢,你真是太棒了。