我正在Windows 7上进行Hartl RoR教程,并且在推向Heroku 时无可救药地坚持第3章。收到以下错误消息:
C:\Sites\rails_projects\sample_app>heroku run rake db:migrate
Running `rake db:migrate` attached to terminal... up, run.7908
/usr/bin/env: ruby.exe: No such file or directory
花了很长时间在谷歌上搜索,所以我自然而然地偷看了bin \ bundle,\ rails和\ rake文件,并为每个文件更改了第一行: #!/ usr / bin / env ruby而不是#!/ usr / bin / env ruby.exe
然后
C:\Sites\rails_projects\sample_app\bin>git commit -a -m "ruby.exe to ruby"
[static-pages 319c9af] ruby.exe to ruby
4 files changed, 5 insertions(+), 3 deletions(-)
C:\Sites\rails_projects\sample_app\bin>git push
warning: push.default is unset; its implicit value is changing in
Git 2.0 from 'matching' to 'simple'. To squelch this message
and maintain the current behavior after the default changes, use:
git config --global push.default matching
To squelch this message and adopt the new behavior now, use:
git config --global push.default simple
See 'git help config' and search for 'push.default' for further information.
(the 'simple' mode was introduced in Git 1.7.11. Use the similar mode
'current' instead of 'simple' if you sometimes use older versions of Git)
Username:
Password:
Everything up-to-date
C:\Sites\rails_projects\sample_app\bin>git push heroku
Everything up-to-date
C:\Sites\rails_projects\sample_app\bin>cd C:\Sites\rails_projects\sample_app
C:\Sites\rails_projects\sample_app\heroku run rake db:migrate
Running `rake db:migrate` attached to terminal... up, run.7908
/usr/bin/env: ruby.exe: No such file or directory
错误仍然存在!最初我认为可能是因为我在错误的文件夹中,所以我在sample_app文件夹中执行了上面的所有“git”步骤并尝试再次迁移。同样的错误:
C:\Sites\rails_projects\sample_app>heroku run rake db:migrate
Running `rake db:migrate` attached to terminal... up, run.7039
/usr/bin/env: ruby.exe: No such file or directory
非常感谢!
答案 0 :(得分:0)
@Mattherick是对的,忘了在heroku上运行db:migrate。 D'哦!