2013-05-12 53 views
0

我创建了一个小Rails应用程序,我想部署它。推送到Heroku时出现错误。我知道这个问题已经被问到,但是没有一个解决方案为我工作。我在Ubuntu上。这是错误说的:Heroku安装sqlite3时出错(1.3.7)

Bundler cannot continue. 
     Make sure that `gem install sqlite3 -v '1.3.7'` succeeds before bundling. 
! 
!  Failed to install gems via Bundler. 
! 
!  Heroku push rejected, failed to compile Ruby/rails app 

这是Gemfile。

source 'https://rubygems.org' 

gem 'rails', '3.2.13' 

# Bundle edge Rails instead: 
# gem 'rails', :git => 'git://github.com/rails/rails.git' 



# 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' 
end 

gem 'jquery-rails' 

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

gem 'pg' 
# 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' 
+0

有你'前束tryed命令'宝石安装sqlite3的-v“1.3.7'' install' – 2013-05-13 06:26:25

+0

是啊,我也得到了同样的错误仍然.. – user2351234 2013-05-13 20:55:50

+0

创建一个新的宝石,并尝试使用不同的宝石 – 2013-05-14 10:13:19

回答

0

我想通了!我认为问题在于我在本地安装制作宝石,这是Heroku引起的错误。我更新了我的gemfile,然后运行了软件包更新,然后主要步骤是运行bundle install --without production

source 'https://rubygems.org' 

gem 'rails', '3.2.13' 

group :development do 
    gem 'sqlite3', '1.3.5' 
end 


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

    gem 'uglifier', '1.2.3' 
end 

gem 'jquery-rails', '2.0.2' 

group :production do 
    gem 'pg', '0.12.2' 
end 
0

我认为在你的Rails应用中使用postgresql和sqlite3是有冲突的。您已经将sqlite3设置为在开发和测试中运行,但也编写了postgresql以在生产,开发和测试中运行。我建议指定postgresql gem只在生产环境中运行。

group :production do 
    gem 'pg' 
end 
+0

我仍然收到相同的错误。我遇到类似这样的问题,但是安装pg gem并解决它,在运行bundle install之前,我必须首先运行sudo apt-get install postgresql libpq-dev。我不确定这个问题是否也是这种情况。 – user2351234 2013-05-12 13:48:30

+0

您是否试过只安装'gem install sqlite3'然后运行'bundle install'? – jason328 2013-05-12 17:28:43

+0

刚刚尝试过,它仍然没有工作.. – user2351234 2013-05-12 17:42:50

相关问题