unable to bundle install bootstrap-sass -v '2.2.2.0' - - bootstrap-sass

New to RoR and taking the One Month Rails class (onemonthrails.com)
I'm trying to import bootstrap.
ruby 2.0.0p247
rails 4.0.0
Here's my Gemfile (showing only the 'bootstrap-sass'line) :
Bootstrap Gem
gem 'bootstrap-sass', '~> 2.2.2.0'
And this is the output when running 'bundle install'
Diegos-Air-2:omrails Diego$ bundle install
Fetching gem metadata from '...rubygems.org/..........'
Fetching gem metadata from '...rubygems.org/..'
Resolving dependencies...
Enter your password to install the bundled RubyGems to your system:
Using rake (10.1.0)
Using i18n (0.6.4)
Using minitest (4.7.5)
Using multi_json (1.7.8)
Using atomic (1.1.12)
Using thread_safe (0.1.2)
Using tzinfo (0.3.37)
Using activesupport (4.0.0)
Using builder (3.1.4)
Using erubis (2.7.0)
Using rack (1.5.2)
Using rack-test (0.6.2)
Using actionpack (4.0.0)
Using mime-types (1.23)
Using polyglot (0.3.3)
Using treetop (1.4.14)
Using mail (2.5.4)
Using actionmailer (4.0.0)
Using activemodel (4.0.0)
Using activerecord-deprecated_finders (1.0.3)
Using arel (4.0.0)
Using activerecord (4.0.0)
Using sass (3.2.10)
Installing bootstrap-sass (2.2.2.0)
Errno::EACCES: Permission denied - /Users/Diego/.rvm/gems/ruby-2.0.0-p247/bin/ruby_noexec_wrapper
An error occurred while installing bootstrap-sass (2.2.2.0), and Bundler cannot continue.
Make sure that `gem install bootstrap-sass -v '2.2.2.0'` succeeds before bundling.
My GitHub link: github.com/dschmunis/omrails
Thanks for the help!
Diego

I've heard of some weird permission bugs right around this version
You could try installing directly into command line
gem install bootstrap-sass -v 2.2.2.0
and then run bundle install
Worst case scenario you should still be able to run sudo gem install bootstrap-sass -v 2.2.2.0
But you should be very careful with sudo. It can leave you open to system vulnerabilities and it can lead to some weird problems down the road with gems being installed all over the place. Long story short, don't use sudo carelessly.

Related

Redmine plugins are not shows

CentOS 7, nginx+unicorn+god+mariadb. I'm trying to install plugins, but unable to do it. Creating tmp/restart.txt didnot helped and restarting nginx too. Any other ideas why? Please help.
Environment:
  Redmine version            2.6.1.stable
  Ruby version                  2.0.0-p598 (2014-11-13) [x86_64-linux]
  Rails version                  3.2.21
  Environment                   production
Database adapter Mysql2
Gems:
actionmailer (3.2.21)
actionpack (3.2.21)
activemodel (3.2.21)
activerecord (3.2.21)
activeresource (3.2.21)
activesupport (3.2.21)
arel (3.0.3)
builder (3.0.4)
bundler (1.13.1)
coderay (1.1.1)
erubis (2.7.0)
hike (1.2.3)
htmlentities (4.3.1)
i18n (0.6.11)
journey (1.0.4)
jquery-rails (3.1.4)
json (1.8.3)
kgio (2.10.0)
mail (2.5.4)
mime-types (1.25.1)
multi_json (1.12.1)
mysql2 (0.3.21)
net-ldap (0.3.1)
polyglot (0.3.5)
rack (1.4.7)
rack-cache (1.6.1)
rack-openid (1.4.2)
rack-ssl (1.3.4)
rack-test (0.6.3)
rails (3.2.21)
railties (3.2.21)
raindrops (0.17.0)
rake (11.3.0)
rbpdf (1.18.7)
rdoc (3.12.2)
redcarpet (2.3.0)
request_store (1.0.5)
rmagick (2.16.0)
ruby-openid (2.3.0)
sprockets (2.2.3)
thor (0.19.1)
tilt (1.4.1)
treetop (1.4.15)
tzinfo (0.3.51)
unicorn (5.1.0)
Creating a tmp/restart.txt does not apply to Unicorn server, it applies to PhusionPassenger, which checks for timestamp of restart.txt file, and if timestamp differs from the one it checked during it's startup, a restart of PhusionPassenger's application is applied, see its documentation here.
To properly install Redmine plugins, you need to follow each plugin's installation tutorial, and apply server restart, in case of unicorn, you can see this StackOverflow answer, once you have restarted Unicorn, then
Login to Redmine as administrator
Navigate to Administration | Plugins
Configure plugin if necessary
Sometimes to be used, plugins needs to be enabled on per-project basis. To enable/disable plugins,
navigate to your project | Settings | Modules and there you will be able to enable/disable plugins on per-project basisi.

Declaring and using ruby functions within capistrano 3 tasks

I have the same problem described here:
How to call a Capistrano's task within another Capistrano's task?
However the workaround solution of rolling back to Capistrano v3.0.1 and sshkit 1.0 does not work for me.
Using this tutorial, I have declared custom tasks in lib/capistrano/tasks which use functions decalared in .rb files stored at lib/capistrano/
capfile:
# Load DSL and Setup Up Stages
require 'capistrano/setup'
# Includes default deployment tasks
require 'capistrano/deploy'
require 'capistrano/rails'
require 'capistrano/rvm'
# Loads custom tasks from `lib/capistrano/tasks' if you have any defined.
Dir.glob('lib/capistrano/tasks/*.cap').each { |r| import r }
# Loads custom tasks from all folders below `lib/capistrano' if you have any defined.
Dir.glob('lib/capistrano/**/*.rb').each { |r| import r }
# because the above didn't quite look right to me, and all the .rbs are in /lib/capistrano
Dir.glob('lib/capistrano/*.rb').each { |r| import r }
deploy.rb
set :application, 'hello-rails'
set :app_shortname, 'hr'
set :repo_url, 'git#bitbutcket.org:me/myapp.git' #<-substituted fake info here for this post
# Default value for :linked_files is []
set :linked_files, %w{config/database.yml config/application.yml}
# Default value for linked_dirs is []
set :linked_dirs, %w{bin log tmp/pids tmp/cache tmp/sockets vendor/bundle public/system}
# everything below this comment adapted from the talkingquickly tutorial
#which config files should be copied by deploy:setup_config
set(:config_files, %w(
nginx.conf
unicorn.rb
unicorn_init.sh
))
# which config files should be made executable after copying
# by deploy:setup_config
set(:executable_config_files, %w(unicorn_init.sh))
# files which need to be symlinked
set(:symlinks, [
{
source: "nginx.conf",
link: "/etc/nginx/sites-enabled/{{full_app_name}}"
},
{
source: "unicorn_init.sh",
link: "/etc/init.d/unicorn_{{full_app_name}}"
}
])
#specify my ruby version
set :rvm_type, :system
#specify my gemset
set :rvm_ruby_version, '1.9.3-p385#hello-rails'
namespace :deploy do
# make sure we're deploying what we think we're deploying
before :deploy, "deploy:check_revision"
# only allow a deploy with passing tests to deployed
before :deploy, "deploy:run_tests"
# compile assets locally then rsync
after 'deploy:symlink:shared', 'deploy:compile_assets_locally'
after :finishing, 'deploy:cleanup'
end
config/staging.rb
set :stage, :staging
set :branch, "cap-rails"
set :rails_env, :test
# used in case we're deploying multiple versions of the same
# app side by side. Also provides quick sanity checks when looking
# at filepaths
set :full_app_name, "#{fetch(:app_shortname)}_#{fetch(:stage)}"
set :deploy_to, "/srv/#{fetch(:app_shortname)}"
# number of unicorn workers
set :unicorn_worker_count, 5
# For building nginx config file
set :enable_ssl, false
# extended properties on the server.
server 'dev', user: 'deployer', roles: %w{web app} #<-substituted fake info here for this post
# custom ssh options
set :ssh_options, {
user: 'deployer', #<-substituted fake info here for this post
keys: %w(path.to.key), #<-substituted fake info here for this post
forward_agent: true,
auth_methods: %w(publickey)
}
lib/capistrano/tasks/setup_config.cap
namespace :deploy do
task :setup_config do
on roles(:app) do
# make the config dir
execute :mkdir, "-p #{shared_path}/config"
full_app_name = fetch(:full_app_name)
# config files to be uploaded to shared/config, see the
# definition of smart_template for details of operation.
# Essentially looks for #{filename}.erb in deploy/#{full_app_name}/
# and if it isn't there, falls back to deploy/#{shared}. Generally
# everything should be in deploy/shared with params which differ
# set in the stage files
config_files = fetch(:config_files)
config_files.each do |file|
smart_template file
end
# which of the above files should be marked as executable
executable_files = fetch(:executable_config_files)
executable_files.each do |file|
execute :chmod, "+x #{shared_path}/config/#{file}"
end
# symlink stuff which should be... symlinked
symlinks = fetch(:symlinks)
symlinks.each do |symlink|
sudo "ln -nfs #{shared_path}/config/#{symlink[:source]} #{sub_strings(symlink[:link])}"
end
end
end
end
lib/capistrano/template.rb
def smart_template(from, to=nil)
to ||= from
full_to_path = "#{shared_path}/config/#{to}"
if from_erb_path = template_file(from)
from_erb = StringIO.new(ERB.new(File.read(from_erb_path)).result(binding))
upload! from_erb, full_to_path
info "copying: #{from_erb} to: #{full_to_path}"
else
error "error #{from} not found"
end
end
def template_file(name)
if File.exist?((file = "config/deploy/#{fetch(:full_app_name)}/#{name}.erb"))
return file
elsif File.exist?((file = "config/deploy/shared/#{name}.erb"))
return file
end
return nil
end
Gemfile
source 'https://rubygems.org'
# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '4.0.4'
# Use sqlite3 as the database for Active Record
gem 'sqlite3'
# Use SCSS for stylesheets
gem 'sass-rails', '~> 4.0.2'
# 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'
# 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'
# Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder
gem 'jbuilder', '~> 1.2'
#because sshkit 1.3 has this bug: https://stackoverflow.com/questions/21401665/how-to-call-a-capistranos-task-within-another-capistranos-task
gem 'sshkit', '~> 1.0.0'
gem 'capistrano', '~> 3.0.1'
gem 'capistrano-rails', '~> 1.1'
gem 'capistrano-rvm'
group :doc do
# bundle exec rake doc:rails generates the API under doc/api.
gem 'sdoc', require: false
end
Gemfile.lock
GEM
remote: https://rubygems.org/
specs:
actionmailer (4.0.4)
actionpack (= 4.0.4)
mail (~> 2.5.4)
actionpack (4.0.4)
activesupport (= 4.0.4)
builder (~> 3.1.0)
erubis (~> 2.7.0)
rack (~> 1.5.2)
rack-test (~> 0.6.2)
activemodel (4.0.4)
activesupport (= 4.0.4)
builder (~> 3.1.0)
activerecord (4.0.4)
activemodel (= 4.0.4)
activerecord-deprecated_finders (~> 1.0.2)
activesupport (= 4.0.4)
arel (~> 4.0.0)
activerecord-deprecated_finders (1.0.3)
activesupport (4.0.4)
i18n (~> 0.6, >= 0.6.9)
minitest (~> 4.2)
multi_json (~> 1.3)
thread_safe (~> 0.1)
tzinfo (~> 0.3.37)
arel (4.0.2)
atomic (1.1.16)
builder (3.1.4)
capistrano (3.0.1)
i18n
rake (>= 10.0.0)
sshkit (>= 0.0.23)
capistrano-bundler (1.0.0)
capistrano (>= 3.0.0.pre)
capistrano-rails (1.1.0)
capistrano (>= 3.0.0)
capistrano-bundler (>= 1.0.0)
capistrano-rvm (0.0.3)
capistrano
coffee-rails (4.0.1)
coffee-script (>= 2.2.0)
railties (>= 4.0.0, < 5.0)
coffee-script (2.2.0)
coffee-script-source
execjs
coffee-script-source (1.7.0)
erubis (2.7.0)
execjs (2.0.2)
hike (1.2.3)
i18n (0.6.9)
jbuilder (1.5.3)
activesupport (>= 3.0.0)
multi_json (>= 1.2.0)
jquery-rails (3.1.0)
railties (>= 3.0, < 5.0)
thor (>= 0.14, < 2.0)
json (1.8.1)
mail (2.5.4)
mime-types (~> 1.16)
treetop (~> 1.4.8)
mime-types (1.25.1)
minitest (4.7.5)
multi_json (1.9.2)
net-scp (1.1.2)
net-ssh (>= 2.6.5)
net-ssh (2.8.0)
polyglot (0.3.4)
rack (1.5.2)
rack-test (0.6.2)
rack (>= 1.0)
rails (4.0.4)
actionmailer (= 4.0.4)
actionpack (= 4.0.4)
activerecord (= 4.0.4)
activesupport (= 4.0.4)
bundler (>= 1.3.0, < 2.0)
railties (= 4.0.4)
sprockets-rails (~> 2.0.0)
railties (4.0.4)
actionpack (= 4.0.4)
activesupport (= 4.0.4)
rake (>= 0.8.7)
thor (>= 0.18.1, < 2.0)
rake (10.2.2)
rdoc (4.1.1)
json (~> 1.4)
sass (3.2.18)
sass-rails (4.0.2)
railties (>= 4.0.0, < 5.0)
sass (~> 3.2.0)
sprockets (~> 2.8, <= 2.11.0)
sprockets-rails (~> 2.0.0)
sdoc (0.4.0)
json (~> 1.8)
rdoc (~> 4.0, < 5.0)
sprockets (2.11.0)
hike (~> 1.2)
multi_json (~> 1.0)
rack (~> 1.0)
tilt (~> 1.1, != 1.3.0)
sprockets-rails (2.0.1)
actionpack (>= 3.0)
activesupport (>= 3.0)
sprockets (~> 2.8)
sqlite3 (1.3.9)
sshkit (1.0.0)
net-scp
net-ssh
term-ansicolor
term-ansicolor (1.3.0)
tins (~> 1.0)
thor (0.19.1)
thread_safe (0.3.1)
atomic (>= 1.1.7, < 2)
tilt (1.4.1)
tins (1.0.1)
treetop (1.4.15)
polyglot
polyglot (>= 0.3.1)
turbolinks (2.2.1)
coffee-rails
tzinfo (0.3.39)
uglifier (2.5.0)
execjs (>= 0.3.0)
json (>= 1.8.0)
PLATFORMS
ruby
DEPENDENCIES
capistrano (~> 3.0.1)
capistrano-rails (~> 1.1)
capistrano-rvm
coffee-rails (~> 4.0.0)
jbuilder (~> 1.2)
jquery-rails
rails (= 4.0.4)
sass-rails (~> 4.0.2)
sdoc
sqlite3
sshkit (~> 1.0.0)
turbolinks
uglifier (>= 1.3.0)
When I execute
bundle exec cap staging deploy:setup_config
I get this output:
INFO [9e71d728] Running mkdir -p /srv/hr/shared/config on ruby-dev
DEBUG [9e71d728] Command: mkdir -p /srv/hr/shared/config
INFO [9e71d728] Finished in 0.738 seconds command successful.
cap aborted!
NoMethodError: undefined method `smart_template' for #<SSHKit::Backend::Netssh:0x007f8a4dc04980>
/Users/nico/DevOps/repo/hello-rails/lib/capistrano/tasks/setup_config.cap:16:in `block (4 levels) in <top (required)>'
/Users/nico/DevOps/repo/hello-rails/lib/capistrano/tasks/setup_config.cap:15:in `each'
/Users/nico/DevOps/repo/hello-rails/lib/capistrano/tasks/setup_config.cap:15:in `block (3 levels) in <top (required)>'
/Users/nico/.rvm/gems/ruby-1.9.3-p385#hello-rails-cap-v3-sshkit-v1/gems/sshkit-1.0.0/lib/sshkit/backends/netssh.rb:42:in `instance_exec'
/Users/nico/.rvm/gems/ruby-1.9.3-p385#hello-rails-cap-v3-sshkit-v1/gems/sshkit-1.0.0/lib/sshkit/backends/netssh.rb:42:in `run'
It appears that using capistrano v3.0.1 and sshkit v1.0 are not resolving my issue. The deploy:setup_config task is attempting to call the function smart_template as defined in lib/capistrano/template.rb, and the output indicates that the function cannot be found. I'm at a loss for how to get this working properly. Any advise on addressing the issue is welcome. Also, if a better approach to creating the config and executable files for nginx and unicorn exists I'd love to hear about that.
EDIT
After suspecting that the sshkit gem from rubygems still containing the bug, I added
gem 'sshkit', :git => 'https://github.com/capistrano/sshkit.git'
to my Capfile and rebuilt my local gemset. This didn't address the issue, however, and directed me to look elsewhere. From there I was able to diagnose the issue as being related to the import of the ruby files defined by these lines in my Capfile:
Dir.glob('lib/capistrano/*.rb').each { |r| import r }
Dir.glob('lib/capistrano/**/*.rb').each { |r| import r }
I commented the lines out and replaced them with:
require_relative 'lib/capistrano/template.rb'
require_relative 'lib/capistrano/substitute_strings.rb'
and the functions are now called properly by my deploy:setup_config task. I exported the working gem set and created a new gemset using sshkit from ruby gems. With the require_relative lines listed above, the sshkit gem from rubygems worked fine. So the issue was never with the bug in sshkit, regardless of which source I was using (git or rubygems), but with the imports of the ruby files containing the functions that my cap task was calling.
There are two problems with your example, the correct lines are:
Dir.glob('lib/capistrano/tasks/*.cap').each { |r| import r }
Dir.glob('lib/capistrano/**/*.rb').each { |r| import r }
You can see the complete example here
Per my edit in the original question, the source of the sshkit gem was not my issue.
Rather, the issue was with the import statements.
Changing the lines:
# Loads custom tasks from all folders below `lib/capistrano' if you have any defined.
Dir.glob('lib/capistrano/*.rb').each { |r| import r }
Dir.glob('lib/capistrano/**/*.rb').each { |r| import r }
to:
require_relative 'lib/capistrano/template.rb'
require_relative 'lib/capistrano/substitute_strings.rb'
addressed the issue for me.
I'm not sure why the Dir.glob method didn't work for me, I assume operator error with the expectation that figuring out what I did wrong will be useful for generalizing imports in future cap deployments.

CSS not recognized on Heroku deploy of rails app

I know this question has been asked over, and over, and even here... I have tried all of these changes, yet am still having no such luck. My heroku app lives at http://calm-mountain-2401.herokuapp.com/, and I am extremely frustrated by this. My gemfile looks like:
source 'https://rubygems.org'
# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '4.0.0'
group :production do
gem 'pg'
end
group :development, :test do
gem 'sqlite3'
end
# Use SCSS for stylesheets
gem 'sass-rails', '~> 4.0.0'
# 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'
# Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder
gem 'jbuilder', '~> 1.2'
gem 'jquery-turbolinks'
group :doc do
# bundle exec rake doc:rails generates the API under doc/api.
gem 'sdoc', require: false
end
# Use ActiveModel has_secure_password
# gem 'bcrypt-ruby', '~> 3.0.0'
# Use unicorn as the app server
# gem 'unicorn'
# Use Capistrano for deployment
# gem 'capistrano', group: :development
# Use debugger
# gem 'debugger', group: [:development, :test]
I have been able to successfully deploy, however the code is very obviously not CSS-ified. Any help would be much appreciated!
Alex
EDIT: here is the output of git push heroku master
$ git push heroku master
Counting objects: 9, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (5/5), done.
Writing objects: 100% (5/5), 496 bytes, done.
Total 5 (delta 3), reused 0 (delta 0)
-----> Ruby/Rails app detected
-----> Using Ruby version: ruby-2.0.0
-----> Installing dependencies using Bundler version 1.3.2
Running: bundle install --without development:test --path vendor/bundle -- binstubs vendor/bundle/bin --deployment
Using rake (10.1.0)
Using i18n (0.6.5)
Using minitest (4.7.5)
Using multi_json (1.8.0)
Using atomic (1.1.14)
Using thread_safe (0.1.3)
Using tzinfo (0.3.37)
Using activesupport (4.0.0)
Using builder (3.1.4)
Using erubis (2.7.0)
Using rack (1.5.2)
Using rack-test (0.6.2)
Using actionpack (4.0.0)
Using mime-types (1.25)
Using polyglot (0.3.3)
Using treetop (1.4.15)
Using mail (2.5.4)
Using actionmailer (4.0.0)
Using activemodel (4.0.0)
Using activerecord-deprecated_finders (1.0.3)
Using arel (4.0.0)
Using activerecord (4.0.0)
Using coffee-script-source (1.6.3)
Using execjs (2.0.1)
Using coffee-script (2.2.0)
Using thor (0.18.1)
Using railties (4.0.0)
Using coffee-rails (4.0.0)
Using hike (1.2.3)
Using jbuilder (1.5.1)
Using jquery-rails (3.0.4)
Using turbolinks (1.3.0)
Using jquery-turbolinks (2.0.1)
Using json (1.8.0)
Using pg (0.16.0)
Using bundler (1.3.2)
Using tilt (1.4.1)
Using sprockets (2.10.0)
Using sprockets-rails (2.0.0)
Using rails (4.0.0)
Using rdoc (3.12.2)
Using sass (3.2.10)
Using sass-rails (4.0.0)
Using sdoc (0.3.20)
Using uglifier (2.2.1)
Your bundle is complete! It was installed into ./vendor/bundle
Cleaning up the bundler cache.
-----> Writing config/database.yml to read from DATABASE_URL
-----> Preparing app for Rails asset pipeline
Detected manifest file, assuming assets were compiled locally
-----> WARNINGS:
Include 'rails_12factor' gem to enable all platform features
See https://devcenter.heroku.com/articles/rails-integration-gems for more information.
You have not declared a Ruby version in your Gemfile.
To set your Ruby version add this line to your Gemfile:
ruby '2.0.0'
# See https://devcenter.heroku.com/articles/ruby-versions for more information."
-----> Discovering process types
Procfile declares types -> (none)
Default types for Ruby/Rails -> console, rake, web, worker
-----> Compiled slug size: 38.5MB
-----> Launching... done, v8
http://calm-mountain-2401.herokuapp.com deployed to Heroku
To git#heroku.com:calm-mountain-2401.git
6e49406..83bf74d master -> master`
Have you attempted precompiling your assets explicitly?
heroku run bundle exec rake assets:precompile
For me worked the solution of pdoherty926.
Try adding the rails_12factor and rails3_serve_static_assets (I'm aware you aren't using Rails 3) gems.

Heroku is bundle installing Sqlite, despite Gemfile specifying for development only

When I attempt to push to heroku with git push heroku master I receive the error:
Counting objects: 55, done.
Delta compression using up to 8 threads.
Compressing objects: 100% (43/43), done.
Writing objects: 100% (43/43), 4.01 KiB, done.
Total 43 (delta 33), reused 0 (delta 0)
-----> Heroku receiving push
-----> Removing .DS_Store files
-----> Ruby/Rails app detected
-----> Installing dependencies using Bundler version 1.1.2
Running: bundle install --without development:test --path vendor/bundle --binstubs bin/ --deployment
Fetching gem metadata from https://rubygems.org/.......
Using rake (0.9.2.2)
Using i18n (0.6.0)
Using multi_json (1.1.0)
Using activesupport (3.2.1)
Using builder (3.0.0)
Using activemodel (3.2.1)
Using erubis (2.7.0)
Using journey (1.0.3)
Using rack (1.4.1)
Using rack-cache (1.2)
Using rack-test (0.6.1)
Using hike (1.2.1)
Using tilt (1.3.3)
Using sprockets (2.1.2)
Using actionpack (3.2.1)
Using mime-types (1.17.2)
Using polyglot (0.3.3)
Using treetop (1.4.10)
Using mail (2.4.3)
Using actionmailer (3.2.1)
Using arel (3.0.2)
Using tzinfo (0.3.32)
Using activerecord (3.2.1)
Using activeresource (3.2.1)
Using bcrypt-ruby (3.0.1)
Using bootstrap-sass (2.0.0)
Using will_paginate (3.0.3)
Using bootstrap-will_paginate (0.0.5)
Using coffee-script-source (1.2.0)
Using execjs (1.3.0)
Using coffee-script (2.2.0)
Using rack-ssl (1.3.2)
Using json (1.6.5)
Using rdoc (3.12)
Using thor (0.14.6)
Using railties (3.2.1)
Using coffee-rails (3.2.2)
Using faker (1.0.1)
Using geocoder (1.1.1)
Using jquery-rails (2.0.0)
Using pg (0.12.2)
Using bundler (1.1.2)
Using rails (3.2.1)
Installing rest-client (1.6.7)
Using sass (3.1.15)
Using sass-rails (3.2.4)
Installing sequel (3.20.0)
Installing sinatra (1.0)
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_1t9khulyu1uqj/vendor/bundle/ruby/1.9.1/gems/sqlite3-1.3.5 for inspection.
Results logged to /tmp/build_1t9khulyu1uqj/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
As you can see, the bundle install excludes development and tests (or so it appears at the top), and my gemfile:
source 'https://rubygems.org'
gem 'rails', '3.2.1'
gem 'bootstrap-sass', '2.0.0'
gem 'bcrypt-ruby', '3.0.1'
gem 'faker', '1.0.1'
gem 'will_paginate', '3.0.3'
gem 'bootstrap-will_paginate', '0.0.5'
gem 'taps'
group :production do
gem 'pg', '0.12.2'
end
group :development do
gem 'sqlite3', '1.3.5'
gem 'annotate', '~> 2.4.1.beta'
end
# Gems used only for assets and not required
# in production environments by default.
group :assets do
gem 'sass-rails', '3.2.4'
gem 'coffee-rails', '3.2.2'
gem 'uglifier', '1.2.3'
end
gem 'jquery-rails', '2.0.0'
group :test, :development do
gem 'rspec-rails', '~> 2.8.rc'
gem 'guard-rspec', '0.5.5'
gem 'guard-spork', '0.3.2'
gem 'spork', '0.9.0'
end
group :test do
gem 'capybara', '1.1.2'
gem 'factory_girl_rails', '1.4.0'
gem 'cucumber-rails', '1.2.1'
gem 'database_cleaner', '0.7.0'
end
#Nifty Scaffold
gem 'nifty-generators', :group => :development
# Location - Geocoder
gem 'geocoder'
gem "mocha", :group => :test
Yet you can still see that the bundle is trying to install sqlite, and thus failing. Any idea what could be going wrong? Many thanks.
I had this problem. After a bit of head-scratching, I realized after I made changes to my Gemfile, I forgot to run git commit, before pushing to heroku.

Heroku is trying to install sqlite3 gem even it not being in the Gemfile

I'm trying to deploy a Rails 3.1 application for the first time on Heroku. I set it to the Cedar stack, removed the sqlite3 gem but when I push the code to Heroku I get this error:
-----> Installing dependencies using Bundler version 1.1.rc
Running: bundle install --without development:test --path vendor/bundle --deployment
Fetching gem metadata from http://rubygems.org/....... (...)
Installing rails (3.1.0)
Installing sqlite3 (1.3.4) with native extensions Unfortunately, a fatal error has occurred. Please report this error to
the Bundler issue tracker at
https://github.com/carlhuda/bundler/issues so that we can fix it.
Thanks!
/usr/local/lib/ruby/1.9.1/rubygems/installer.rb:483:in `rescue in block in build_extensions': ERROR: Failed to build gem native
extension. (Gem::Installer::ExtensionBuildError)
/usr/local/bin/ruby extconf.rb
checking for sqlite3.h... no
I've no idea why bundle install is trying to install sqlite3. Take a look at my Gemfile and Gemfile.lock:
Gemfile
source 'http://rubygems.org'
gem 'rails', '3.1.0'
gem 'json'
gem 'pg'
gem 'thin'
# Gems used only for assets and not required
# in production environments by default.
group :assets do
# gem 'sass-rails', " ~> 3.1.0"
# gem 'coffee-rails', "~> 3.1.0"
gem 'uglifier'
end
gem 'jquery-rails'
Gemfile.lock
GEM remote: http://rubygems.org/ specs:
actionmailer (3.1.0)
actionpack (= 3.1.0)
mail (~> 2.3.0)
actionpack (3.1.0)
activemodel (= 3.1.0)
activesupport (= 3.1.0)
builder (~> 3.0.0)
erubis (~> 2.7.0)
i18n (~> 0.6)
rack (~> 1.3.2)
rack-cache (~> 1.0.3)
rack-mount (~> 0.8.2)
rack-test (~> 0.6.1)
sprockets (~> 2.0.0)
activemodel (3.1.0)
activesupport (= 3.1.0)
bcrypt-ruby (~> 3.0.0)
builder (~> 3.0.0)
i18n (~> 0.6)
activerecord (3.1.0)
activemodel (= 3.1.0)
activesupport (= 3.1.0)
arel (~> 2.2.1)
tzinfo (~> 0.3.29)
activeresource (3.1.0)
activemodel (= 3.1.0)
activesupport (= 3.1.0)
activesupport (3.1.0)
multi_json (~> 1.0)
arel (2.2.1)
bcrypt-ruby (3.0.1)
builder (3.0.0)
daemons (1.1.4)
erubis (2.7.0)
eventmachine (0.12.10)
execjs (1.2.9)
multi_json (~> 1.0)
hike (1.2.1)
i18n (0.6.0)
jquery-rails (1.0.14)
railties (~> 3.0)
thor (~> 0.14)
json (1.6.1)
mail (2.3.0)
i18n (>= 0.4.0)
mime-types (~> 1.16)
treetop (~> 1.4.8)
mime-types (1.16)
multi_json (1.0.3)
pg (0.11.0)
polyglot (0.3.2)
rack (1.3.3)
rack-cache (1.0.3)
rack (>= 0.4)
rack-mount (0.8.3)
rack (>= 1.0.0)
rack-ssl (1.3.2)
rack
rack-test (0.6.1)
rack (>= 1.0)
rails (3.1.0)
actionmailer (= 3.1.0)
actionpack (= 3.1.0)
activerecord (= 3.1.0)
activeresource (= 3.1.0)
activesupport (= 3.1.0)
bundler (~> 1.0)
railties (= 3.1.0)
railties (3.1.0)
actionpack (= 3.1.0)
activesupport (= 3.1.0)
rack-ssl (~> 1.3.2)
rake (>= 0.8.7)
rdoc (~> 3.4)
thor (~> 0.14.6)
rake (0.9.2)
rdoc (3.9.4)
sprockets (2.0.0)
hike (~> 1.2)
rack (~> 1.0)
tilt (~> 1.1, != 1.3.0)
thin (1.2.11)
daemons (>= 1.0.9)
eventmachine (>= 0.12.6)
rack (>= 1.0.0)
thor (0.14.6)
tilt (1.3.3)
treetop (1.4.10)
polyglot
polyglot (>= 0.3.1)
tzinfo (0.3.29)
uglifier (1.0.3)
execjs (>= 0.3.0)
multi_json (>= 1.0.2)
PLATFORMS ruby
DEPENDENCIES jquery-rails json pg rails (= 3.1.0) thin uglifier
How can I fix it?
When I ran into the problem, turns out I'd forgotten to commit my changes after bundle install. Doh! git status should indicate unstaged changes for the gem files.
I has the same problem and zoltarSpeaks' solution fixed it for me. I had the taps gem installed after reading this article that indicated it would be necessary for pushing from a local sqlite3 to production postgresql: http://batsov.com/articles/2011/10/30/deploying-rails31-apps-on-celadon-cedar/. Turned out I didn't need the taps gem after all, but it was clearly the problem. Removed the reference, bundle update, all systems go.
try deleting Gemfile.lock and run Bundle Install, commit and push
Simple solution without uninstalling sqlite3 gem for Heroku:
Add to Gemfile:
group :production do
gem 'pg', '0.17.1' #or version of pg you want
gem 'rails_12factor', '0.0.2' #Heroku static assets for image and css
Check, that you have:
end
end
at the end of code in Gemfile
than Save Gemfile and run bundle install
$ bundle install --without production
than commit
$ git commit -a -m "Update Gemfile.lock for Heroku"
than
$ git push heroku master
That is all. You will get only a few warnings which is simply to fix.

Resources