heroku push拒绝,无法编译Ruby/rails应用

时间:2021-02-17 20:39:41

Having the following issue, BRAND NEW TO RoR, first time ever trying to upload an app to go live, first had hosting issues, then decided if i could fix them with heroku i would just use a custom domain with heroku...... No this isnt a test app "learning rails" thing, actual app i want to deploy for use within the business I own, any help would be great, I have searched and havent seen a solution to this problem.

有了下面的问题,全新的RoR,第一次尝试上传应用程序到live,首先有托管问题,然后决定如果我可以用heroku修复它们,我将使用一个自定义域与heroku…不,这不是一个测试应用"学习rails"的东西,实际的应用我想部署在我自己的企业中使用,任何帮助都将是伟大的,我搜索并没有看到解决这个问题的方法。

Make sure 'gem install sqlite3 -v 1.3.7' succeeds before bundling.

在打包之前,确保“gem安装sqlite3 - v1.3.7”成功。

Failed to install gems via Bundler

Heroku push rejected, failed to compile Ruby/rails app

To git@heroku.com:peaceful-chamber-6371.git
[remote rejected] master -> master <pre-receive hook declined>
error: failed to push some refs to 'git@heroku.com:peaceful-chamber-6371.git

Gem File

Gem文件

source 'https://rubygems.org'

gem 'rails', '3.2.12'

# Bundle edge Rails instead:
# gem 'rails', :git => 'git://github.com/rails/rails.git'
group :development, :test do
gem 'sqlite3'
end
group :production do
  gem 'pg'
end


# Gems used only for assets and not required
# in production environments by default.
group :assets do
  gem 'sass-rails',   '~> 3.2.3'
  gem 'coffee-rails', '~> 3.2.1'

  # See https://github.com/sstephenson/execjs#readme for more supported runtimes
  # gem 'therubyracer', :platforms => :ruby

  gem 'uglifier', '>= 1.0.3'
  gem 'twitter-bootstrap-rails'
end

gem 'jquery-rails'

# To use ActiveModel has_secure_password
# gem 'bcrypt-ruby', '~> 3.0.0'

# To use Jbuilder templates for JSON
# gem 'jbuilder'

# Use unicorn as the app server
# gem 'unicorn'

# Deploy with Capistrano
# gem 'capistrano'

# To use debugger
# gem 'debugger'

6 个解决方案

#1


43  

try this,

试试这个,

remove Gemfile.lock file and do bundle install , then git add, git commit and git push .

删除Gemfile。锁定文件并进行捆绑安装,然后git添加,git提交和git推送。

#2


4  

Look though the all of the output that Heroku writes to the console -- your error is likely to be there somewhere. I ran into this and found that the precompile step had failed. That can be run locally as well:

查看Heroku向控制台写入的所有输出——您的错误可能在某个地方。我遇到了这个问题,发现预编译步骤失败了。也可以在本地运行:

rake assets:precompile

#3


1  

Although the question has an accepted answer, the answer did not help me, I had the same problem. The following worked for me, hence contributing. Heroku does not support sqlite 3. In this case, I had sqlite3 gem in my gemfile, which you are supposed to put in development group, and put postgres gem (which heroku supports) in production group.

虽然这个问题有一个公认的答案,但答案对我没有帮助,我也有同样的问题。下面的内容对我很有用,因此也很有帮助。Heroku不支持sqlite 3。在这种情况下,我的gemfile中有sqlite3 gem,您应该将它放在开发组中,然后将postgres gem (heroku支持)放在生产组中。

1)Delete the gemfile.lock file (from your project folder)

1)删除gemfile。锁定文件(来自您的项目文件夹)

2)In the gemfile, remove gem sqlite3 or similar sqlite3 gem

2)在gemfile中移除gem sqlite3或类似的sqlite3

3)instead of that add following to the end of file:

3)而不是在文件末尾添加以下内容:

group :development, :test do gem 'sqlite3' end gem 'pg', group: :production

组:开发,:测试做gem 'sqlite3' end gem 'pg',组::生产

Now, run the following commands in terminal:

现在,在终端运行以下命令:

bundle install
git add .
git commit
git push
git push heroku master

Although it was a silly mistake, It took me time to realize the same. Hope it helps someone.

虽然这是一个愚蠢的错误,但我花了很长时间才意识到这一点。希望它能帮助一些人。

#4


0  

Heroku's asset plugins no longer work since Rails 4 does not support plugins. You need to use Heroku's asset gems instead. Place this in your Gemfile:

Heroku的资产插件不再工作,因为Rails 4不支持插件。你需要使用Heroku的资产宝石。把这个放在你的Gemfile中:

group :production do
  gem 'rails_12factor'
end

Answer found here: Heroku does NOT compile files under assets pipelines in Rails 4 worked for me

这里找到的答案是:Heroku没有在Rails 4的资产管道下编译文件

#5


0  

My issue was that I had my bower directory ignored in .gitignore.

我的问题是在.gitignore中忽略了我的bower目录。

So I either need to do bower install from my packages.json or check in my bower dir.

所以我需要从我的包中进行bower安装。json或check in my bower dir。

http://xseignard.github.io/2013/02/18/use-bower-with-heroku/

http://xseignard.github.io/2013/02/18/use-bower-with-heroku/

I chose to check in my bower dir for a quick solution right now.

我选择在我的bower dir找到一个快速的解决方案。

#6


0  

Heroku does not like sqlite3, change gem 'sqlite3' with gem 'pg'

Heroku不喜欢sqlite3,用gem pg改变gem 'sqlite3'

#1


43  

try this,

试试这个,

remove Gemfile.lock file and do bundle install , then git add, git commit and git push .

删除Gemfile。锁定文件并进行捆绑安装,然后git添加,git提交和git推送。

#2


4  

Look though the all of the output that Heroku writes to the console -- your error is likely to be there somewhere. I ran into this and found that the precompile step had failed. That can be run locally as well:

查看Heroku向控制台写入的所有输出——您的错误可能在某个地方。我遇到了这个问题,发现预编译步骤失败了。也可以在本地运行:

rake assets:precompile

#3


1  

Although the question has an accepted answer, the answer did not help me, I had the same problem. The following worked for me, hence contributing. Heroku does not support sqlite 3. In this case, I had sqlite3 gem in my gemfile, which you are supposed to put in development group, and put postgres gem (which heroku supports) in production group.

虽然这个问题有一个公认的答案,但答案对我没有帮助,我也有同样的问题。下面的内容对我很有用,因此也很有帮助。Heroku不支持sqlite 3。在这种情况下,我的gemfile中有sqlite3 gem,您应该将它放在开发组中,然后将postgres gem (heroku支持)放在生产组中。

1)Delete the gemfile.lock file (from your project folder)

1)删除gemfile。锁定文件(来自您的项目文件夹)

2)In the gemfile, remove gem sqlite3 or similar sqlite3 gem

2)在gemfile中移除gem sqlite3或类似的sqlite3

3)instead of that add following to the end of file:

3)而不是在文件末尾添加以下内容:

group :development, :test do gem 'sqlite3' end gem 'pg', group: :production

组:开发,:测试做gem 'sqlite3' end gem 'pg',组::生产

Now, run the following commands in terminal:

现在,在终端运行以下命令:

bundle install
git add .
git commit
git push
git push heroku master

Although it was a silly mistake, It took me time to realize the same. Hope it helps someone.

虽然这是一个愚蠢的错误,但我花了很长时间才意识到这一点。希望它能帮助一些人。

#4


0  

Heroku's asset plugins no longer work since Rails 4 does not support plugins. You need to use Heroku's asset gems instead. Place this in your Gemfile:

Heroku的资产插件不再工作,因为Rails 4不支持插件。你需要使用Heroku的资产宝石。把这个放在你的Gemfile中:

group :production do
  gem 'rails_12factor'
end

Answer found here: Heroku does NOT compile files under assets pipelines in Rails 4 worked for me

这里找到的答案是:Heroku没有在Rails 4的资产管道下编译文件

#5


0  

My issue was that I had my bower directory ignored in .gitignore.

我的问题是在.gitignore中忽略了我的bower目录。

So I either need to do bower install from my packages.json or check in my bower dir.

所以我需要从我的包中进行bower安装。json或check in my bower dir。

http://xseignard.github.io/2013/02/18/use-bower-with-heroku/

http://xseignard.github.io/2013/02/18/use-bower-with-heroku/

I chose to check in my bower dir for a quick solution right now.

我选择在我的bower dir找到一个快速的解决方案。

#6


0  

Heroku does not like sqlite3, change gem 'sqlite3' with gem 'pg'

Heroku不喜欢sqlite3,用gem pg改变gem 'sqlite3'