Rails 4: Error when installing tiny_tds gem? - ruby-on-rails

I have developed a rails web project with Ruby v2 and Rails v4. It was perfectly working in my current system and when i tried to run this project in another Linux machine (Ubuntu 12.4 ) i am getting a Tidy_tds error .
This error is showing at the time of bundle install ,
Error Details below
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.
/home/action/.rvm/rubies/ruby-2.1.1/bin/ruby extconf.rb
checking for iconv_open() in iconv.h... yes
checking for sybfront.h... no
-----
freetds is missing.
Could not create Makefile due to some reason, probably lack of necessary
libraries and/or headers. Check the mkmf.log file for more details. You may
need configuration options.
Provided configuration options:
--with-opt-dir
--without-opt-dir
--with-opt-include
--without-opt-lib=${opt-dir}/lib
--with-make-prog
--without-make-prog
--srcdir=.
--curdir
--ruby=/home/action/.rvm/rubies/ruby-2.1.1/bin/ruby
--enable-lookup
--disable-lookup
--with-iconv-dir
--without-iconv-dir
--with-iconv-include
--without-iconv-include=${iconv-dir}/include
--with-iconv-lib
--without-iconv-lib=${iconv-dir}/lib
--with-freetds-dir
--without-freetds-dir
--with-freetds-include
--without-freetds-include=${freetds-dir}/include
--with-freetds-lib
--without-freetds-lib=${freetds-dir}/lib
extconf failed, exit code 1
Gem files will remain installed in /home/action/.rvm/gems/ruby-2.1.1/gems/tiny_tds-0.6.1 for inspection.
Results logged to /home/action/.rvm/gems/ruby-2.1.1/extensions/x86_64-linux/2.1.0/tiny_tds-0.6.1/gem_make.out
An error occurred while installing tiny_tds (0.6.1), and Bundler cannot continue.
Make sure that `gem install tiny_tds -v '0.6.1'` succeeds before bundling.
I have also tried installing tiny_tds seperatly, but still i am getting the same issue
gem install tiny_tds -v '0.6.1'
My gem file,
source 'https://rubygems.org'
# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '4.0.2'
# Use SCSS for stylesheets
gem 'sass-rails', '~> 4.0.0'
gem 'tiny_tds'
# Use Uglifier as compressor for JavaScript assets
gem 'uglifier', '>= 1.3.0'
# Use CoffeeScript for .js.coffee assets and views
gem 'coffee-rails', '~> 4.0.0'
# See https://github.com/sstephenson/execjs#readme for more supported runtimes
# gem 'therubyracer', platforms: :ruby
# Use jquery as the JavaScript library
gem 'jquery-rails'
# Turbolinks makes following links in your web application faster. Read more: https://github.com/rails/turbolinks
gem 'turbolinks'
gem 'jquery-ui-rails' # jquery ui
# Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder
gem 'jbuilder', '~> 1.2'
group :doc do
# bundle exec rake doc:rails generates the API under doc/api.
gem 'sdoc', require: false
end
# Use sqlserver as the database for Active Record
gem 'activerecord-sqlserver-adapter', :git => 'https://github.com/nextgearcapital/activerecord-sqlserver-adapter.git'
gem "therubyracer"
gem "less-rails"
gem "twitter-bootstrap-rails"
gem 'bootstrap-datepicker-rails'
gem 'will_paginate'
gem 'sqlite3'
gem 'formtastic'
Why is this error appearing and how to solve this issue.
Any help is appreciated

Looks like you don't have freetds installed on this machine:
sudo apt-get install freetds-dev
If you see the details of the freetds-dev package you will see it has the missing file sybfront.h
There is no gem that I know for freetds and building the tiny_tds gem requires it to compile. However it should be possible for you build your own version of the gem using MiniPortile.
Rather than using the normal gem install mechanism you need to clone the tiny_tds from GitHub and then build a native gem for your environment. This process will include downloading a specific version of freetds which is used to compile the gem against.
This should get you round the problem of not being able to install freetds-dev package, but does have the disadvantage that if tiny_tds gem is updated in the future you will need to repeat this process each time - you can't simply take advantage of bundle update.
The steps you need to follow are detailed here.

For MacOS you need additional lib installed.
brew install freetds

This worked for me in Ubuntu 17.04
Install wget to download packages from remote URL
$ sudo apt-get install wget
Install dependencies
$ sudo apt-get install build-essential
$ sudo apt-get install libc6-dev
Download remote file
$ wget ftp://ftp.freetds.org/pub/freetds/stable/freetds-1.00.21.tar.gz
Unzip
$ tar -xzf freetds-1.00.21.tar.gz
Configure and Run Test for the package in your system
$ cd freetds-1.00.21
$ sudo ./configure --prefix=/usr/local --with-tdsver=7.3
$ sudo make
Now, Install
$ sudo make install
Now install the gem
$ gem install tiny_tds -v '2.0.0'
If still, you cannot install the gem tiny_tds then try using sudo
$ sudo gem install tiny_tds -v '2.0.0'
Output
Building native extensions. This could take a while...
Successfully installed tiny_tds-2.0.0
Parsing documentation for tiny_tds-2.0.0
Installing ri documentation for tiny_tds-2.0.0
Done installing documentation for tiny_tds after 1 seconds
1 gem installed

Related

Nokogiri and Rails wont install. [Ruby On Rails]

So I have been following this guide to learn ruby on rails. I just installed ubuntu and was making an effort to install the required gear but I am facing a lot of problems. I tried searching online but couldn't really find a solution. So basically, Im following this guide (https://www.railstutorial.org/book), and I was learning how to make my first app.
There was this point after installing lots and lots of stuff where I was asked to modify the gemfile with the following text.
source 'https://rubygems.org'
gem 'rails', '4.2.0.rc3'
gem 'sass-rails', '5.0.0.beta1'
gem 'uglifier', '2.5.3'
gem 'coffee-rails', '4.1.0'
gem 'jquery-rails', '4.0.0.beta2'
gem 'turbolinks', '2.3.0'
gem 'jbuilder', '2.2.3'
gem 'sdoc', '0.4.0', group: :doc
group :development, :test do
gem 'sqlite3', '1.3.9'
gem 'byebug', '3.4.0'
gem 'web-console', '2.0.0.beta3'
gem 'spring', '1.1.3'
end
And I had ruby before itself but it was outdated so I updated it to 2.1.5.
Now when I used the command "bundle install" it gave me errors saying it couldnt install rails and nokogiri. I tried installing rails and nokogiri seperately too but it didnt work out.
Here's the error:
Building native extensions. This could take a while...
ERROR: Error installing nokogiri:
ERROR: Failed to build gem native extension.
/usr/bin/ruby2.1 -r ./siteconf20141220-9232-x08jtr.rb extconf.rb
mkmf.rb can't find header files for ruby at /usr/lib/ruby/include/ruby.h
extconf failed, exit code 1
Gem files will remain installed in /var/lib/gems/2.1.0/gems/nokogiri-1.6.5 for inspection.
Results logged to /var/lib/gems/2.1.0/extensions/x86_64-linux/2.1.0/nokogiri-1.6.5/gem_make.out
And for rails:
Fetching: rack-1.6.0.gem (100%)
Successfully installed rack-1.6.0
Building native extensions. This could take a while...
ERROR: Error installing rails:
ERROR: Failed to build gem native extension.
/usr/bin/ruby2.1 -r ./siteconf20141220-9321-6z0v97.rb extconf.rb
mkmf.rb can't find header files for ruby at /usr/lib/ruby/include/ruby.h
extconf failed, exit code 1
Gem files will remain installed in /var/lib/gems/2.1.0/gems/nokogiri-1.6.5 for inspection.
Results logged to /var/lib/gems/2.1.0/extensions/x86_64-linux/2.1.0/nokogiri-1.6.5/gem_make.out
What is happening ? And please do give me a detailed solution because I'm quite new to this.
Thanks for the help in Advance !
It sounds like you didn't install the ruby-dev libraries. So you've got a Ruby VM, but not the libraries required to build gems. Try installing the ruby-dev package.
sudo apt-get install ruby-dev
And then rebundle.
First off, don't try to use the system Ruby for development. That Ruby version is packaged to run specific system level packages for the OS, you can break OS utils by manually updating it or a OS update can break your dev environment. Plus, it will most likely require you run everything as sudo which is just a pain. I recommend installing rvm or rbenv for managing your development rubies.
Now, as for your specific error, you probably just need to install libxml development packages for Ubuntu:
sudo apt-get install libxslt-dev libxml2-dev

Gem::Ext::BuildError: ERROR: Failed to build gem native extension. postgresql and ROR

I need to install postgresql in production environment in an application ROR for after use this with heroku, but when I try to install the gem 'pg' the following error is triggered. I'm a newbie, so I don't know that do
I'm using ruby 1.9.3p547 (2014-05-14 revision 45962) [i686-linux]
rails
Rails 3.2.19
Ubuntu 12.04
GemFile
source 'https://rubygems.org'
gem 'rails', '3.2.19'
# Bundle edge Rails instead:
# gem 'rails', :git => 'git://github.com/rails/rails.git'
gem 'mysql2'
gem 'hirb'
# 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 :production do
gem 'pg'
end
# 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'
The problem appears when I run bundle update or bundle install
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.
/home/fernando/.rvm/rubies/ruby-1.9.3-p547/bin/ruby -r ./siteconf20141203-14261-3uu564.rb extconf.rb
checking for pg_config... no
No pg_config... trying anyway. If building fails, please try again with
--with-pg-config=/path/to/pg_config
checking for libpq-fe.h... no
Can't find the 'libpq-fe.h header
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of
necessary libraries and/or headers. Check the mkmf.log file for more
details. You may need configuration options.
Provided configuration options:
--with-opt-dir
--without-opt-dir
--with-opt-include
--without-opt-include=${opt-dir}/include
--with-opt-lib
--without-opt-lib=${opt-dir}/lib
--with-make-prog
--without-make-prog
--srcdir=.
--curdir
--ruby=/home/fernando/.rvm/rubies/ruby-1.9.3-p547/bin/ruby
--with-pg
--without-pg
--with-pg-config
--without-pg-config
--with-pg_config
--without-pg_config
--with-pg-dir
--without-pg-dir
--with-pg-include
--without-pg-include=${pg-dir}/include
--with-pg-lib
--without-pg-lib=${pg-dir}/lib
extconf failed, exit code 1
Gem files will remain installed in /home/fernando/.rvm/gems/ruby-1.9.3-p547#ticket_master/gems/pg-0.17.1 for inspection.
Results logged to /home/fernando/.rvm/gems/ruby-1.9.3-p547#ticket_master/extensions/x86-linux/1.9.1/pg-0.17.1/gem_make.out
An error occurred while installing pg (0.17.1), and Bundler cannot continue.
Make sure that `gem install pg -v '0.17.1'` succeeds before bundling.
Your problem is described in the log No pg_config... trying anyway.
This config is related to the libpq dependency, when I was starting with rails I faced this kind of problems, so, I think that the answer is just follow the following steps
Run this command in your console.
sudo apt-get install libpq-dev
sudo gem install pg
The above solution didn't work for me, but the instructions here did. I'll summarize below:
Make sure you've installed PostgreSQL
Find your new pg_config path with sudo find / -name "pg_config"
Copy the path
Run gem install pg -- --with-pg-config=path/to/pg_config
Success!
As per rderoldan1's solution I ran as below (using Fedora 23):
dnf install libpq-dev
but I've got this message:
No package libpq-dev available. Error: Unable to find a match.
Initially, PostgreSQL was installed with the following command:
dnf install postgresql-server postgresql-contrib
And when I've run which pg_config I got this:
/usr/bin/which: no pg_config in (/usr/local/heroku/bin:/usr/local/rvm/gems/ruby-2.2.4/bin:/usr/local/rvm/gems/ruby-2.2.4#global/bin:/usr/local/rvm/rubies/ruby-2.2.4/bin:/usr/lib64/qt-3.3/bin:/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin:/usr/local/rvm/bin:/home/mayur/.local/bin:/home/mayur/bin)
So I installed PostgreSQL again with this command:
dnf install postgresql-devel
Now when I run which pg_config I get:
/usr/bin/pg_config
and I can run bundle install without any error.
In my case, I use Postgres 9.5.2, Ruby 2.3.0 and Rails 4.2.6 on OSX El Capitan 10.11.5. All properly set up and work nicely until I tried to deployment production env on local machine. Tried the solution above, none of them work for me though it point me to the right direction.
So my problem is mainly about bundler not the gem install. To make this right,firstly the gem should be properly install again as instructed above. The path for pg_config might varies by Postgres version.
$gem install pg -- --with-pg-config=/Applications/Postgres.app/Contents/Versions/9.5/bin/pg_config
To bundle it, you might need to configure it proper before bundle install
$bundle config build.pg --with-pg-config=/Applications/Postgres.app/Contents/Versions/9.5/bin/pg_config
You are replacing the current global value of build.pg, which is currently "--with-pg-config=/opt/local/lib/postgresql91/bin/pg_config"
Now you should be able to run bundle install without problem.
Hope this help.

Nokogiri gem installation error with spree

I'm getting this error when I try to bundle install
Bundler::GemspecError: Could not read gem at /home/theareba/.rvm/gems/ruby-2.0.0-p353/cache/nokogiri-1.6.1.gem. It may be corrupted.
An error occurred while installing nokogiri (1.6.1), and Bundler cannot
continue.
Make sure that `gem install nokogiri -v '1.6.1'` succeeds before bundling.
I've tried removing nokogiri in the cache and bundle installing again in vain.
Here's my gemfile
source 'https://rubygems.org'
gem 'rails', '4.0.0'
ruby "2.0.0"
gem 'spree_auth_devise', github: 'spree/spree_auth_devise', branch: '2-1-stable'
gem 'spree', github: 'spree/spree', branch: '2-1-stable'
gem 'bootstrap-sass', '2.3.2.0'
gem 'sass-rails'
gem 'uglifier'
gem 'coffee-rails'
gem 'jquery-rails'
gem 'turbolinks'
gem 'jbuilder'
group :development, :test do
gem 'turn', :require => false
gem 'sqlite3'
gem 'taps', :require => false
gem 'rspec-rails'
end
group :production do
gem 'pg', '0.15.1'
gem 'rails_12factor'
end
UPDATE
Error that occurs when I run gem install nokogiri -v '1.6.0'
Fetching: mini_portile-0.5.2.gem (100%)
Fetching: nokogiri-1.6.0.gem (100%)
Building native extensions. This could take a while...
ERROR: Error installing nokogiri:
ERROR: Failed to build gem native extension.
/usr/bin/ruby1.9.1 extconf.rb
/usr/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require': cannot load such file -- mkmf (LoadError)
from /usr/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
from extconf.rb:5:in `<main>'
Gem files will remain installed in /var/lib/gems/1.9.1/gems/nokogiri-1.6.0 for inspection.
Results logged to /var/lib/gems/1.9.1/gems/nokogiri-1.6.0/ext/nokogiri/gem_make.out
Note: I've installed both libxslt1-dev and libxml2-dev that are requirements in nokogiri installation.
I've also tried gem install nokogiri -v '1.6.1' but it still fails. I've installed nokogiri -v 1.5.0 in another app so I tried it in this app and got the error that spree requires nokogiri version 1.6.0 or greater. I'm I missing something?
So here's what solved my problem. I created a new gemset i.e
rvm gemset create nokogiri
rvm use ruby-2.0.0-p353#nokogiri
Note: I'm using rvm and ruby 2.0.0. Then I made sure I've got necessary lib installed by running
sudo apt-get install libxml2-dev libxslt-dev
The libraries happened to be already installed. Then I installed nokogiri
gem install nokogiri -v '1.6.1'
It installed successfully. And finally ran bundle install to get all my gems. Hope this helps anyone having the same issue.
Check the RVM gemset. I fixed it by restoring the gemset. If you try upgrading to 4.0.2? I used Nokogiri 1.6.1 with Ruby 2.0.0 and Rails 4.0.2
try this
sudo apt-get install ruby-dev
sudo apt-get install libxml2 libxml2-dev libxslt1-dev
and reinstall nokogiri
sudo gem install nokogiri

Taglib - Ruby - Deployment - Keep getting bundle error - extconf.rb failed

thanks for any help in advance. I've been stuck on this problem for a couple of days now and could definitely use some help.
I'm currently trying to deploy my app and I'm using the taglib-ruby gem and works perfectly on my local machine. But when I try to deploy via Heroku OR Engineyard, I get the following error:
Installing taglib-ruby (0.5.1) with native extensions
Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.
/usr/bin/ruby19 extconf.rb
checking for main() in -lstdc++... yes
checking for main() in -ltag... no
You must have taglib installed in order to use taglib-ruby.
Debian/Ubuntu: sudo apt-get install libtag1-dev
Fedora/RHEL: sudo yum install taglib-devel
Brew: brew install taglib
MacPorts: sudo port install taglib
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of
necessary libraries and/or headers. Check the mkmf.log file for more
details. You may need configuration options.
Provided configuration options:
--with-opt-dir
--with-opt-include
--without-opt-include=${opt-dir}/include
--with-opt-lib
--without-opt-lib=${opt-dir}/lib
--with-make-prog
--without-make-prog
--srcdir=.
--curdir
--ruby=/usr/bin/ruby19
--with-tag-dir
--without-tag-dir
--with-tag-include
--without-tag-include=${tag-dir}/include
--with-tag-lib
--without-tag-lib=${tag-dir}/lib
--with-stdc++lib
--without-stdc++lib
--with-taglib
--without-taglib
Gem files will remain installed in /data/musicmind/shared/bundled_gems/ruby/1.9.1/gems/taglib-ruby-0.5.1 for inspection.
Results logged to /data/musicmind/shared/bundled_gems/ruby/1.9.1/gems/taglib-ruby-0.5.1/ext/taglib_base/gem_make.out
An error occured while installing taglib-ruby (0.5.1), and Bundler cannot continue.
Make sure that `gem install taglib-ruby -v '0.5.1'` succeeds before bundling.
What could I possibly be doing wrong? I'm thinking maybe there is a way to send this library with my application for deployment?
My gemfile is this:
source 'http://rubygems.org'
gem 'rails', '3.2.8'
# 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'
gem 'uglifier', '>= 1.0.3'
gem 'twitter-bootstrap-rails', :git => 'git://github.com/seyhunak/twitter-bootstrap-rails.git'
end
group :development, :test do
gem 'sqlite3'
end
group :production do
gem 'mysql2'
end
gem "taglib-ruby"
gem 'json', '~> 1.6.5'
gem "multi_json", "~> 1.3.6"
#attachment management
gem "paperclip", :git => "git://github.com/thoughtbot/paperclip.git"
#ativity feed
gem 'public_activity', :git => "git://github.com/pokonski/public_activity.git"
gem 'jquery-rails'
#nested-album-form
gem 'nested_form', :git => 'https://github.com/ryanb/nested_form.git'
#creates pattern for widget to send form data in json back to server
gem "js_message"
gem 'kaminari'
#gem 'will_paginate'
#user authentication
gem 'devise'
#notification - basic
gem 'unread'
#id3 tag reader for songs
gem 'libv8', '~> 3.11.8'
#admin interface
gem 'activeadmin'
#gravatar images for users with no profile picture
gem 'gravatar_image_tag'
#amazon s3 for song storage
gem 'aws-sdk'
#authentication for twitter
gem 'omniauth-twitter'
#pretty urls
gem 'friendly_id'
gem 'tire'
group :development do
gem 'rspec-rails'
gem 'nifty-generators'
gem 'annotate'
gem 'faker'
end
group :test do
gem 'rspec-rails'
gem 'webrat'
gem 'spork', '~> 0.9.0.rc'
gem 'factory_girl_rails'
gem 'watchr'
end
#?
gem 'progress_bar'
#web intents - twitter
gem 'tweet-button'
#like buttons
gem 'facebook_share'
#rails paypal interfacing
gem 'activemerchant', :require => 'active_merchant'
#gem 'bootstrap-will_paginate'
gem 'bootstrap-kaminari-views'
gem 'omniauth-facebook'
gem 'simple_form'
gem 'country_select'
# gem 'tiny_tds'
# gem 'activerecord-sqlserver-adapter'
# gem 'ruby-odbc'
# To use ActiveModel has_secure_password
# gem 'bcrypt-ruby', '~> 3.0.0'
# Use unicorn as the web server
# gem 'unicorn'
# Deploy with Capistrano
# gem 'capistrano'
# To use debugger
gem 'debugger'
group :test do
# Pretty printed test output
gem 'turn', :require => false
gem 'minitest'
end
gem "mocha", :group => :test
Again, thank you, and if there is any information I can provide to help solve this issue, please let me know.
On the Engineyard stack, you just need to add the media-libs/taglib to your package list for the gem to use. We don't install taglib by default on the AMI.
You can do this via the dashboard ( https://support.cloud.engineyard.com/entries/21074071-Add-UNIX-Packages-to-Your-Application ), just search for taglib and select media-libs/taglib from the list.
If you want to do this on the command line for a test:
deploy#ip-10-66-7-217 ~ $ sudo emerge media-libs/taglib
Local copy of remote index is up-to-date and will be used.
* Last emerge --sync was 1y 42d 54m 34s ago.
Calculating dependencies... done!
>>> Verifying ebuild manifests
>>> Emerging (1 of 1) media-libs/taglib-1.7.2
>>> Downloading 'http://distfiles.gentoo.org/distfiles/taglib-1.7.2.tar.gz'
[[ Lots of build output clipped]]
-- Installing: /var/tmp/portage/media-libs/taglib-1.7.2/image/usr/include/taglib/tag_c.h
>>> Completed installing taglib-1.7.2 into /var/tmp/portage/media-libs/taglib-1.7.2/image/
strip: x86_64-pc-linux-gnu-strip --strip-unneeded -R .comment -R .GCC.command.line
usr/lib64/libtag.so.1.7.2
usr/lib64/libtag_c.so.0.0.0
ecompressdir: bzip2 -9 /usr/share/doc
>>> Installing (1 of 1) media-libs/taglib-1.7.2
>>> Recording media-libs/taglib in "world" favorites file...
>>> Auto-cleaning packages...
>>> No outdated packages were found on your system.
* GNU info directory index is up-to-date.
* IMPORTANT: 2 config files in '/etc' need updating.
* See the CONFIGURATION FILES section of the emerge
* man page to learn how to update config files.
deploy#ip-10-66-7-217 ~ $ gem install taglib-ruby
Building native extensions. This could take a while...
Successfully installed taglib-ruby-0.6.0
1 gem installed
deploy#ip-10-66-7-217 ~ $
You can also add this via Custom Chef if you want to add this to multiple environments
component_version = "1.7.2" # If your on the 2012.11 Stable-v4 stack, "1.5" if your in 2009a
enable_package 'media-libs/taglib' do
version component_version
end
package 'media-libs/taglib' do
version component_version
action :install
end
Finally, you can install media-libs/taglib-extras if you want support for the extra taglib-extras proprietary file formats.
Many gems with native extensions require base libraries to be installed. Most of them can be added like this and you can open a ticket with Engine Yard support for help with more complex cases.
for deploying taglib to heroku... please follow this tutorial I wrote after being stuck in this issue for a while...
http://artmees.github.io/blog/2014/06/14/heroku-taglib/
The taglib-heroku gem looks like it might work.
I solved this problem by creating a custom buildpack with heroku. Use it to install taglib with no problems.
https://github.com/menan/heroku-buildpack-ruby.git
here is how you use the custom buildpack if you're unsure.
https://devcenter.heroku.com/articles/buildpacks#using-a-custom-buildpack

Deploy RoR to Heroku and Sqlite3 fails

I've found a number of posts on this same subject (here's one) and thought I made the right changes but I still can't solve the issue.
After completing the bundle install, I push to heroku, I get the following error when it reaches the sqlite3 install.
Installing sqlite3 (1.3.5) with native extensions
Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.
/usr/local/bin/ruby extconf.rb
checking for sqlite3.h... no
sqlite3.h is missing. Try 'port install sqlite3 +universal'
or 'yum install sqlite-devel' and check your shared library search path (the
location where your sqlite3 shared library is located).
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of
necessary libraries and/or headers. Check the mkmf.log file for more
details. You may need configuration options.
Provided configuration options:
--with-opt-dir
--without-opt-dir
--with-opt-include
--without-opt-include=${opt-dir}/include
--with-opt-lib
--without-opt-lib=${opt-dir}/lib
--with-make-prog
--without-make-prog
--srcdir=.
--curdir
--ruby=/usr/local/bin/ruby
--with-sqlite3-dir
--without-sqlite3-dir
--with-sqlite3-include
--without-sqlite3-include=${sqlite3-dir}/include
--with-sqlite3-lib
--without-sqlite3-lib=${sqlite3-dir}/lib
--enable-local
--disable-local
Gem files will remain installed in /tmp/build_13nbwv3kitbub/vendor/bundle/ruby/1.9.1/gems/sqlite3-1.3.5 for inspection.
Results logged to /tmp/build_13nbwv3kitbub/vendor/bundle/ruby/1.9.1/gems/sqlite3-1.3.5/ext/sqlite3/gem_make.out
An error occured while installing sqlite3 (1.3.5), and Bundler cannot continue.
Make sure that `gem install sqlite3 -v '1.3.5'` succeeds before bundling.
!
! Failed to install gems via Bundler.
!
! Heroku push rejected, failed to compile Ruby/rails app
To git#heroku.com:morning-dawn-1372.git
! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'git#heroku.com:morning-dawn-1372.git'
My Gemfile looks like this:
source 'https://rubygems.org'
gem 'rails', '3.2.2'
# Bundle edge Rails instead:
# gem 'rails', :git => 'git://github.com/rails/rails.git'
gem 'json'
group :development, :test do
gem 'sqlite3-ruby', :require => 'sqlite3'
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.3'
gem 'coffee-rails', '~> 3.2.1'
# See https://github.com/sstephenson/execjs#readme for more supported runtimes
# gem 'therubyracer'
gem 'uglifier', '>= 1.0.3'
end
gem 'jquery-rails'
group :production do
gem 'pg', '0.12.2'
end
# 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 'ruby-debug'
it looks like I have both
Using sqlite3 (1.3.5)
Using sqlite3-ruby (1.3.3)
on my system. Not sure if this is creatign an issue, but explains why I excluded both in the gemfile.
Environmental info:
$ ruby -v
ruby 1.8.7 (2012-02-08 patchlevel 358) [i386-cygwin]
$ rails -v
Rails 3.2.2
Run the bundle command and then make sure that both the Gemfile and Gemfile.lock are checked into the repo before pushing to Heroku.
You will also get this error if sqlite is specified in your Gemfile without a group- for example
gem 'rails', '3.2.13'
# Bundle edge Rails instead:
# gem 'rails', :git => 'git://github.com/rails/rails.git'
# below is the line that's giving you trouble
gem "sqlite3", "~> 1.3.7"
Heroku does not allow sqlite in production, so you must either delete this line or change this to something like
...
group :development, :test do
gem "sqlite3", "~> 1.3.7", :require => "sqlite3"
end
then do bundle install, then git add and git commit your changes to Gemfile and Gemfile.lock.
After you have done this, your git push heroku master should work.
Try this:
Open the Gemfile.lock and scroll down to sqlite3 (1.3.x) under 'specs:'
Make sure it appears only as sqlite3 (1.3.x) with no extra jazz.
If any extra tags such as "-x86-mingw32" is displayed then delete it.
Run Bundle Install.
Then try pushing Heroku master.
Worked for me.
Edit
Now that I know better, please don't ever change the Gemfile.lock manually.
This was written when I started coding in Rails on Windows.
Try updating the particular gem or lock it to a version in your Gemfile.

Resources