已经初始化为常量RUBY:heroku rake db:迁移日志显示1.9.2和1.9.1 [英] already initialized constant RUBY: heroku rake db:migrate logs show both 1.9.2 and 1.9.1

查看:133
本文介绍了已经初始化为常量RUBY:heroku rake db:迁移日志显示1.9.2和1.9.1的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



heroku rake db:迁移失败,已经初始化常量ruby和LN_SUPPORTED
,但错误消息表明1.9.2和1.9.1都在运行。

  /app/.bundle/ gems / ruby​​ / 1.9.1 / gems / rake-0.9.2 / lib / rake / file_utils.rb:10:警告:已经初始化常量RUBY 
/app/.bundle/gems/ruby/1.9.1/ gems / rake-0.9.2 / lib / rake / file_utils.rb:84:警告:已经初始化常量LN_SUPPORTED
rake中止!
无效DATABASE_URL
(erb):9:在`rescue in< main>'
(erb):6:在< main>'
/ usr / ruby​​1 .9.2 / lib / ruby​​ / 1.9.1 / erb.rb:753:在`eval'
/usr/ruby1.9.2/lib/ruby/1.9.1/erb.rb:753:in`result'
/app/.bundle/gems/ruby/1.9.1/gems/railties-3.1.0.rc4/lib/rails/application/configuration.rb:95:in`database_configuration'
.. 。
...

我的test_app可以正常运行本地数据库

我还没有Heroku的工作经验。我刚刚推出了文件。

解决方案

您是否已经解决了您的问题?

大卫提到:你需要为Heroku部署指定这些宝石。
确保您的 Gemfile和Gemfile.lock不包含在您的.gitignore文件中



你也可以在Heroku上使用Cedar堆栈。确保你使用了:
heroku create --stack cedar

heroku create
为Rails3应用程序。如果是Rails3.1,则需要进一步阅读:
http://devcenter.heroku.com/ articles / rails31_heroku_cedar



尝试 http:// ruby .railstutorial.org / 这本书是Heroku部署的免费漫游。
您也可以联系Heroku的支持。

如果您有进一步的问题,请在这里插入您的错误,Gemfile,Gemfile.lock (或者插入Guhub的Gist )并分享它。

HTH



刚刚注意到:您可能不使用RVM,您也可能在使用Rake和其他gem版本时遇到问题。请参阅RVM: https://rvm.io


I trying to do a full verification install of Rails 3.1 pre and deploy to heroku.

heroku rake db:migrate fails with already initialized constants RUBy and LN_SUPPORTED but the error messages indicate that both 1.9.2 and 1.9.1 are both running.

/app/.bundle/gems/ruby/1.9.1/gems/rake-0.9.2/lib/rake/file_utils.rb:10: warning: already initialized constant RUBY
/app/.bundle/gems/ruby/1.9.1/gems/rake-0.9.2/lib/rake/file_utils.rb:84: warning: already initialized constant LN_SUPPORTED
rake aborted!
Invalid DATABASE_URL
(erb):9:in `rescue in <main>'
(erb):6:in `<main>'
/usr/ruby1.9.2/lib/ruby/1.9.1/erb.rb:753:in `eval'
/usr/ruby1.9.2/lib/ruby/1.9.1/erb.rb:753:in `result'
/app/.bundle/gems/ruby/1.9.1/gems/railties-3.1.0.rc4/lib/rails/application/configuration.rb:95:in `database_configuration'
...
...

My test_app runs fine with local db

I have no working experience with Heroku yet. I have just pushed files out there.

解决方案

Have you solved your problem?

This might be what David mentioned: you need to specify these gems for Heroku deployment. Make sure your Gemfile and Gemfile.lock is not included to your .gitignore file.

Also you may wanna use Cedar stack on Heroku for. Make sure you used: heroku create --stack cedar instaed of heroku create for a Rails3 app. If it's Rails3.1 then it needs further readings: http://devcenter.heroku.com/articles/rails31_heroku_cedar

Try http://ruby.railstutorial.org/ this book for free walkthrough on Heroku deployment. You can contact to Heroku's support too.
If you've further question on it please insert your error, Gemfile, Gemfile.lock here (or into Guhub's Gist) and share it.
HTH

Just noticed: you probably don't use RVM and you may have problems with Rake and other gem versions too. Please see RVM: https://rvm.io

这篇关于已经初始化为常量RUBY:heroku rake db:迁移日志显示1.9.2和1.9.1的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆