我是Rails的新手,我试图将我的第一个rails应用程序上传到Heroku。
我已经在Heroku中安装了我的应用程序,但是当我尝试创建数据库时出现此错误:
vagrant@rails-forge:~/apps/betsman$ heroku run rake db:migrate --app betsman
Running `rake db:migrate` attached to terminal... up, run.3809
: No such file or directory
但这并没有告诉我任何事情。 所以我检查了Heroku日志,并得到以下错误:
:没有这样的文件或目录00:00 app [web.1]:/ usr / bin / env:ruby
vagrant@rails-forge:~/apps/betsman$ heroku logs
2014-06-17T02:23:23.680853+00:00 heroku[api]: Enable Logplex by personal_email
2014-06-17T02:23:23.680979+00:00 heroku[api]: Release v2 created by personal_email
2014-06-17T02:25:22.844616+00:00 heroku[api]: Starting process with command `echo $RAILS_ENV` by personal_email
2014-06-17T02:38:43.002052+00:00 heroku[api]: Attach HEROKU_POSTGRESQL_CRIMSON resource by personal_email
2014-06-17T02:38:43+00:00 heroku[slug-compiler]: Slug compilation finished
: No such file or directory00:00 app[web.1]: /usr/bin/env: ruby
2014-06-17T02:38:49.957936+00:00 heroku[web.1]: State changed from crashed to starting
2014-06-17T02:38:49.957154+00:00 heroku[web.1]: State changed from starting to crashed
2014-06-17T02:38:49.938918+00:00 heroku[web.1]: Process exited with status 127
2014-06-17T02:38:47.948496+00:00 heroku[web.1]: Starting process with command `bin/rails server -p 17686 -e production`
: No such file or directory00:00 app[web.1]: /usr/bin/env: ruby
这是我的Gemfile:
ruby '2.1.0'
gem 'pg'
gem 'rails', '4.1.1'
gem 'sass-rails', '~> 4.0.3'
#gem 'sass-rails', github: 'rails/sass-rails', branch: :master
#gem 'sprockets-rails', github: 'rails/sprockets-rails', branch: '2-1-stable'
gem 'uglifier', '>= 1.3.0'
gem 'coffee-rails', '~> 4.0.0'
gem 'jquery-rails'
gem 'turbolinks'
gem 'jquery-turbolinks'
gem 'font-awesome-sass'
# gem 'bootstrap-sass'
# gem 'flat-ui-sass', github: 'wingrunr21/flat-ui-sass'
gem 'devise'
gem 'pundit'
gem 'simple_form', '~> 3.1.0.rc1'
gem 'slim-rails'
gem 'active_model_serializers', github:'rails-api/active_model_serializers' , branch: 'master'
gem 'various', '~> 0.0.2'
gem 'modernizr-rails'
gem 'bower-rails', '~> 0.7.2'
gem 'draper'
gem 'smart_listing'
gem 'cocoon'
# gem 'active_interaction'
gem 'virtus'
gem 'devise_invitable'
gem 'figaro'
group :development do
gem 'better_errors'
gem 'binding_of_caller', platforms: [:mri_21]
gem 'quiet_assets'
gem 'rails_layout'
gem 'spring'
gem 'hirb'
gem 'awesome_print'
end
group :development, :test do
gem 'factory_girl_rails'
gem 'pry-rails'
gem 'pry-rescue'
gem 'rspec-rails', '>= 3.0.0.beta2'
gem 'faker'
end
group :test do
gem 'database_cleaner'
gem 'shoulda-matchers', '~> 2.6.1'
end
group :production do
gem 'rails_12factor'
gem 'thin'
end
我使用Ruby 2.1.0和Rails 4.1.1。 欢迎任何帮助。如果您需要别的东西,请告诉我。
谢谢!
编辑:
我找到了解决方案。显然我必须使用以下命令更新位于bin文件夹的文件:
rake rails:update:bin
答案 0 :(得分:6)
我找到了解决方案。显然我不得不用这个命令更新位于bin文件夹的文件
rake rails:update:bin
答案 1 :(得分:0)
如果您正在尝试创建数据库表,我相信该命令是
heroku run rake db:migrate --app NAME_OF_APP