我跳过已经存在的项目进行一些编辑,应用程序的所有者和我决定最好设置一个" staging" heroku上的实例(生产版本也在那里),因此他们可以在推送到生产之前看到我的编辑。
所以我去为应用程序设置了一个新的heroku实例。我从生产环境中提取代码,将其链接到bitbucket遥控器,然后运行
"heroku create --remote staging"
,然后是"git push staging master".
(顺便说一句,如果有更好的方法来创建暂存环境,我可以对它开放!)
应用推送并加载,但是当我尝试登录时,我得到了一个"我们很抱歉,但出了点问题"。所以我跑了heroku logs --app appname
,我得到以下内容:
The requested API endpoint was not found. Are you using the right HTTP
verb (i.e. GET vs. POST), and did you specify your intended version with the Accept header?
我环顾四周,并没有发现任何真正有用的东西。感谢任何帮助,我假设它与正在使用的数据库有关。我尝试运行heroku run rake --app appname db:migrate
,但我收到以下错误:
Running `rake db:migrate` attached to terminal... failed
! Resource not found
另外,这里是我的宝石文件供参考:
#ruby version
ruby '2.1.4'
# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '4.1.6'
#Use Bootstrap
gem 'bootstrap-sass', '~> 3.3.0'
# Use SCSS for stylesheets
gem 'sass-rails', '~> 4.0.3'
#Autoprefixer adds the proper vendor prefixes to your CSS code when it is compiled.
gem 'autoprefixer-rails'
# Use Uglifier as compressor for JavaScript assets
gem 'uglifier', '>= 1.3.0'
# Use CoffeeScript for .js.coffee assets and views
gem 'coffee-rails', '~> 4.0.0'
# See https://github.com/sstephenson/execjs#readme for more supported runtimes
# gem 'therubyracer', platforms: :ruby
# Add Haml
gem 'haml-rails'
# Support Mongodb
gem 'mongoid'
# Add simple form
#add BSON support
gem 'bson_ext'
#for simple forms
gem 'simple_form'
# Add paranoia so we can recover things that are deleted
gem 'mongoid_paranoia'
#Include 'rails_12factor' gem to enable all platform features
#See https://devcenter.heroku.com/articles/rails-integration-gems for more information.
gem 'rails_12factor'
#add devise
gem 'devise'
# Use jquery as the JavaScript library
gem 'jquery-rails'
# Turbolinks makes following links in your web application faster. Read more: https://github.com/rails/turbolinks
gem 'turbolinks'
# Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder
gem 'jbuilder', '~> 2.0'
# bundle exec rake doc:rails generates the API under doc/api.
gem 'sdoc', '~> 0.4.0', group: :doc
# Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring
gem 'spring', group: :development
#add figaro to ensure secure ENV config variables that can't be accidently git commited
gem "figaro"
#generate PDF's using heroku add on
gem 'doc_raptor'
#mailchimp api for adding confirmed signups to mailchimp
gem 'mailchimp-api', require: 'mailchimp'
gem 'kaminari'
#gem factory girl, to use as fixtures for testing
gem "factory_girl_rails", "~> 4.0"
#warden gem for testing authentication
gem "warden"
# Use ActiveModel has_secure_password
# gem 'bcrypt', '~> 3.1.7'
# Use unicorn as the app server
# gem 'unicorn'
# Use Capistrano for deployment
# gem 'capistrano-rails', group: :development
# Use debugger
# gem 'debugger', group: [:development, :test]
# Gems used only for assets and not required
# in production environments by default.
group :assets do
gem 'therubyracer', :platform=>:ruby
end
#Gems used for devlopment and testing environment
group :development, :test do
gem 'rspec-rails'
gem 'better_errors'
gem 'capybara'
end
group :test do
gem 'cucumber-rails', :require => false
gem 'database_cleaner'
end
任何帮助表示赞赏,如果需要,我可以发布更多信息,但我现在不知道在哪里看。谢谢!