推送到heroku时,Ruby 2.0 / Rails 4.0.0beta升级失败

时间:2022-12-19 20:39:24

Brain dump because mine is fried with googling and slamming my head on the computer. Any help or clues would be GREATLY appreciated!

脑溢流,因为我的谷歌用谷歌搜索并在计算机上猛击我的头。任何帮助或线索都将非常感激!

I manage my gems via rvm.

我通过rvm管理我的宝石。

$ ruby -v
ruby 2.0.0p0 (2013-02-24 revision 39474) [x86_64-darwin12.2.0]

$ rails -v
Rails 4.0.0.beta1

Then when I want to create a brand new app from scratch

然后,当我想从头开始创建一个全新的应用程序

$ rails new brand_new_app
 create  
  create  README.rdoc
  ...
Your bundle is complete! Use `bundle show [gemname]` to see where a bundled gem is installed.

$ cd brand_new_app

Then I initialize a git repo, add the app I just created. I then create a heroku instance

然后我初始化一个git repo,添加我刚刚创建的应用程序。然后我创建一个heroku实例

brand_new_app $ heroku create
    Git remote heroku added

Then I try and deploy to heroku but it fails on the active support gem.

然后我尝试部署到heroku但它在活动支持gem上失败。

brand_new_app $ git push heroku master
    Counting objects: 62, done.
    Delta compression using up to 4 threads.
    Compressing objects: 100% (50/50), done.
    Writing objects: 100% (62/62), 20.54 KiB, done.
    Total 62 (delta 2), reused 0 (delta 0)

    -----> Ruby/Rails app detected
    -----> Installing dependencies using Bundler version 1.3.2
   Running: bundle install --without development:test --path vendor/bundle --binstubs vendor/bundle/bin --deployment
   Fetching gem metadata from https://rubygems.org/.........
   Fetching gem metadata from https://rubygems.org/..
   Installing rake (10.0.3)
   Installing i18n (0.6.4)
   Installing minitest (4.6.2)
   Installing multi_json (1.6.1)
   Installing atomic (1.0.1)
   Installing thread_safe (0.1.0)
   Installing tzinfo (0.3.37)
   Installing activesupport (4.0.0.beta1)
   Gem::InstallError: activesupport requires Ruby version >= 1.9.3.
   An error occurred while installing activesupport (4.0.0.beta1), and Bundler
   cannot continue.
   Make sure that `gem install activesupport -v '4.0.0.beta1'` succeeds before
   bundling.
     !
     !     Failed to install gems via Bundler.
     !
     !     Heroku push rejected, failed to compile Ruby/rails app

I have imploded rvm (idk why, mainly bc I was frustrated) and I have checked every place possible. I created the rails app without any special settings, it is just a normal install. If anyone has any hints that could lead me to the right direction, please send them my way! I appreciate you reading this far!

我已经破坏了rvm(idk为什么,主要是因为我很沮丧)而且我已经检查过每一个可能的地方。我创建了rails应用程序,没有任何特殊设置,它只是一个正常的安装。如果有人有任何可以引导我走向正确方向的提示,请按我的方式发送给他们!我很感激你读到这里!

1 个解决方案

#1


18  

You should put a ruby line in your Gemfile like is explained in the heroku documentation.

您应该在Gemfile中放置一个ruby行,就像heroku文档中所解释的那样。

Just add the line ruby "2.0.0" beneath source "https://rubygems.org" in your Gemfile.

只需在Gemfile中的源“https://rubygems.org”下添加ruby“2.0.0”行。

https://blog.heroku.com/archives/2012/11/5/ruby-2-preview-on-heroku

https://blog.heroku.com/archives/2012/11/5/ruby-2-preview-on-heroku

I have tried this, and this works for heroku. Apparently Rails 4 is not compatible with different ruby versions. This is kind of odd, since they say here that:

我试过这个,这适用于heroku。显然Rails 4与不同的ruby版本不兼容。这有点奇怪,因为他们在这里说:

Ruby 2.0 is the preferred Ruby to use with Rails 4.0.

Ruby 2.0是与Rails 4.0一起使用的首选Ruby。

http://weblog.rubyonrails.org/2013/2/25/Rails-4-0-beta1/

http://weblog.rubyonrails.org/2013/2/25/Rails-4-0-beta1/

Apparently preferred, means required.

显然是首选,意味着需要。

Hope this helps

希望这可以帮助

#1


18  

You should put a ruby line in your Gemfile like is explained in the heroku documentation.

您应该在Gemfile中放置一个ruby行,就像heroku文档中所解释的那样。

Just add the line ruby "2.0.0" beneath source "https://rubygems.org" in your Gemfile.

只需在Gemfile中的源“https://rubygems.org”下添加ruby“2.0.0”行。

https://blog.heroku.com/archives/2012/11/5/ruby-2-preview-on-heroku

https://blog.heroku.com/archives/2012/11/5/ruby-2-preview-on-heroku

I have tried this, and this works for heroku. Apparently Rails 4 is not compatible with different ruby versions. This is kind of odd, since they say here that:

我试过这个,这适用于heroku。显然Rails 4与不同的ruby版本不兼容。这有点奇怪,因为他们在这里说:

Ruby 2.0 is the preferred Ruby to use with Rails 4.0.

Ruby 2.0是与Rails 4.0一起使用的首选Ruby。

http://weblog.rubyonrails.org/2013/2/25/Rails-4-0-beta1/

http://weblog.rubyonrails.org/2013/2/25/Rails-4-0-beta1/

Apparently preferred, means required.

显然是首选,意味着需要。

Hope this helps

希望这可以帮助