0

I have an application named "Aadvisor", when i try to run this application on local, i do foreman start like below:

pallav@pallav-System-Product-Name:~/Workspace/Aadvisor$ foreman start
14:21:28 web.1  | started with pid 14635
14:21:28 web.1  | bundler: command not found: rackup
14:21:28 web.1  | Install missing gem executables with `bundle install`
14:21:29 web.1  | exited with code 127
14:21:29 system | sending SIGTERM to all processes
SIGTERM received

Then i do 'bundle install' :

pallav@pallav-System-Product-Name:~/Workspace/Aadvisor$ bundle install
Fetching gem metadata from http://rubygems.org/.........
Fetching additional metadata from http://rubygems.org/..
Resolving dependencies...
Using addressable (2.3.5)
Using backports (3.4.0)

Gem::Installer::ExtensionBuildError: 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:13:in `<main>'


Gem files will remain installed in /home/pallav/Workspace/Aadvisor/vendor/bundle/ruby/1.9.1/gems/bcrypt-ruby-3.1.2 for inspection.
Results logged to /home/pallav/Workspace/Aadvisor/vendor/bundle/ruby/1.9.1/gems/bcrypt-ruby-3.1.2/ext/mri/gem_make.out
An error occurred while installing bcrypt-ruby (3.1.2), and Bundler cannot continue.
Make sure that `gem install bcrypt-ruby -v '3.1.2'` succeeds before bundling.

Then i simply do gem install bcrypt-ruby -v '3.1.2', as below:

pallav@pallav-System-Product-Name:~/Workspace/Aadvisor$ gem install bcrypt-ruby -v '3.1.2'
ERROR:  While executing gem ... (Gem::FilePermissionError)
    You don't have write permissions into the /var/lib/gems/1.9.1 directory.

Then using 'sudo' sudo gem install bcrypt-ruby -v '3.1.2', as below:

pallav@pallav-System-Product-Name:~/Workspace/Aadvisor$ sudo gem install bcrypt-ruby -v '3.1.2'
[sudo] password for pallav: 
Building native extensions.  This could take a while...
ERROR:  Error installing bcrypt-ruby:
    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:13:in `<main>'


Gem files will remain installed in /var/lib/gems/1.9.1/gems/bcrypt-ruby-3.1.2 for inspection.
Results logged to /var/lib/gems/1.9.1/gems/bcrypt-ruby-3.1.2/ext/mri/gem_make.out

I checked the error log here:

pallav@pallav-System-Product-Name:~/Workspace/Aadvisor$ /var/lib/gems/1.9.1/gems/bcrypt-ruby-3.1.2/ext/mri/gem_make.out
bash: /var/lib/gems/1.9.1/gems/bcrypt-ruby-3.1.2/ext/mri/gem_make.out: Permission denied

My ruby version is :

pallav@pallav-System-Product-Name:~/Workspace/Aadvisor$ ruby -v
ruby 1.9.3p194 (2012-04-20 revision 35410) [x86_64-linux]

My Gem file is:

source "http://rubygems.org"

 gem "rack" 
 gem "sinatra" 
 gem "sinatra-contrib" 
 gem "json" 
 gem "will_paginate" 
 gem 'will_paginate-bootstrap'

 gem "thin"
 #gem "shotgun"

 gem 'pg'

 gem "data_mapper" 
 gem "dm-postgres-adapter" 
 gem "dm-validations"

I did installed rvm \curl -sSL https://get.rvm.io | bash and also did sudo apt-get install ruby1.9.1-dev after that i tried again doing bundle install and i get this:

pallav@pallav-System-Product-Name:~/Workspace/Aadvisor$ bundle install
Fetching source index from http://rubygems.org/
Resolving dependencies................................
Using addressable (2.3.5)
Using backports (3.4.0)
Installing bcrypt-ruby (3.1.2)
Installing daemons (1.1.9)
Installing dm-core (1.2.1)
Installing dm-aggregates (1.2.0)
Installing dm-constraints (1.2.0)
Installing dm-migrations (1.2.0)
Installing fastercsv (1.5.5)
Installing json (1.8.1)
Installing json_pure (1.8.1)
Installing multi_json (1.8.4)
Installing dm-serializer (1.2.2)
Installing dm-timestamps (1.2.0)
Installing dm-transactions (1.2.0)
Installing stringex (1.5.1)
Installing uuidtools (2.1.4)
Installing dm-types (1.2.2)
Installing dm-validations (1.2.0)
Installing data_mapper (1.2.0)
Installing data_objects (0.10.13)
Installing dm-do-adapter (1.2.0)

Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.

        /usr/bin/ruby1.9.1 extconf.rb 
checking for main() in -lpq... no
checking for main() in -llibpq... no
*** 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/bin/ruby1.9.1
    --with-pgsql-server-dir
    --without-pgsql-server-dir
    --with-pgsql-server-include
    --without-pgsql-server-include=${pgsql-server-dir}/include
    --with-pgsql-server-lib
    --without-pgsql-server-lib=${pgsql-server-dir}/lib
    --with-pgsql-client-dir
    --without-pgsql-client-dir
    --with-pgsql-client-include
    --without-pgsql-client-include=${pgsql-client-dir}/include
    --with-pgsql-client-lib
    --without-pgsql-client-lib=${pgsql-client-dir}/lib
    --with-pqlib
    --without-pqlib
    --with-libpqlib
    --without-libpqlib
Could not find PostgreSQL build environment (libraries & headers): Makefile not created


Gem files will remain installed in /home/pallav/Workspace/Aadvisor/vendor/bundle/ruby/1.9.1/gems/do_postgres-0.10.13 for inspection.
Results logged to /home/pallav/Workspace/Aadvisor/vendor/bundle/ruby/1.9.1/gems/do_postgres-0.10.13/ext/do_postgres/gem_make.out
An error occurred while installing do_postgres (0.10.13), and Bundler cannot continue.
Make sure that `gem install do_postgres -v '0.10.13'` succeeds before bundling.

I also tried installing gem install do_postgres -v '0.10.13' like this :

pallav@pallav-System-Product-Name:~/Workspace/Aadvisor$ sudo gem install do_postgres -v '0.10.13'
Fetching: data_objects-0.10.13.gem (100%)
Fetching: do_postgres-0.10.13.gem (100%)
Building native extensions.  This could take a while...
ERROR:  Error installing do_postgres:
    ERROR: Failed to build gem native extension.

        /usr/bin/ruby1.9.1 extconf.rb
checking for main() in -lpq... no
checking for main() in -llibpq... no
*** 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/bin/ruby1.9.1
    --with-pgsql-server-dir
    --without-pgsql-server-dir
    --with-pgsql-server-include
    --without-pgsql-server-include=${pgsql-server-dir}/include
    --with-pgsql-server-lib
    --without-pgsql-server-lib=${pgsql-server-dir}/lib
    --with-pgsql-client-dir
    --without-pgsql-client-dir
    --with-pgsql-client-include
    --without-pgsql-client-include=${pgsql-client-dir}/include
    --with-pgsql-client-lib
    --without-pgsql-client-lib=${pgsql-client-dir}/lib
    --with-pqlib
    --without-pqlib
    --with-libpqlib
    --without-libpqlib
Could not find PostgreSQL build environment (libraries & headers): Makefile not created


Gem files will remain installed in /var/lib/gems/1.9.1/gems/do_postgres-0.10.13 for inspection.
Results logged to /var/lib/gems/1.9.1/gems/do_postgres-0.10.13/ext/do_postgres/gem_make.out

Finally i checked the result as :

pallav@pallav-System-Product-Name:~/Workspace/Aadvisor$ /var/lib/gems/1.9.1/gems/do_postgres-0.10.13/ext/do_postgres/gem_make.out
bash: /var/lib/gems/1.9.1/gems/do_postgres-0.10.13/ext/do_postgres/gem_make.out: Permission denied

What probably could be the error.

PallavSharma
  • 439
  • 2
  • 12
  • 21
  • there are missing library dependencies for bcrypt-ruby – Bijendra Jan 20 '14 at 09:26
  • then how would i correct it ? – PallavSharma Jan 20 '14 at 09:28
  • it seems to me that you don't use ruby manager (rvm, rbenv). Which help helps you to work with ruby and gems. You have problem with some libs and permissions. I suggest you to install rvm (https://rvm.io/rvm/install) and setup the app again. PS using `sudo` during installing gem is not good idea – gotva Jan 20 '14 at 09:29
  • are you using rvm. if yes then what is the o/p of rvm notes – Bijendra Jan 20 '14 at 09:30
  • 1
    Refer http://stackoverflow.com/questions/6119153/why-do-i-get-a-bcrypt-ruby-gem-install-error – Bijendra Jan 20 '14 at 09:32
  • 1
    @PallavSharma with RVM, you will no longer use aptitude to manage Ruby. Instead, RVM will handle Ruby and related packages. Try `rvm install 1.9.1` and make sure you have added `source ~/.rvm/scripts/rvm` to your shell configuration. For more info on installation see https://rvm.io/rvm/install. – Patrick Oscity Jan 20 '14 at 09:48
  • 2
    You will also have to `bundle install` again, because RVM comes with its own set of Gems for each installed Ruby. – Patrick Oscity Jan 20 '14 at 09:49
  • i did `rvm install 1.9.1` it says : "The program 'rvm' is currently not installed. You can install it by typing: `sudo apt-get install ruby-rvm`". I did : `sudo apt-get install ruby-rvm` then it says : "E: Unable to locate package ruby-rvm" – PallavSharma Jan 20 '14 at 09:59

0 Answers0