I'm running bundle install and it failed in the middle with the error:
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.
current directory: /Users/Mahmoud/dev-reps/non-docker/normal/vendor/bundle/ruby/2.5.0/gems/puma-4.3.1/ext/puma_http11
/Users/Mahmoud/.rbenv/versions/2.5.5/bin/ruby -r ./siteconf20220308-96584-8zjcoy.rb extconf.rb --with-cppflags=-I/usr/local/opt/openssl/include
checking for BIO_read() in -lcrypto... yes
...
...
An error occurred while installing puma (4.3.1), and Bundler cannot continue.
Make sure that `gem install puma -v '4.3.1' --source 'http://rubygems.org/'` succeeds before bundling.
After some failures to install puma, and after much searching and many trials, I was able to install it through:
gem install puma:4.3.1 -- --with-cflags="-Wno-error=implicit-function-declaration"
and the gem installed successfully, giving:
Building native extensions with: '--with-cflags=-Wno-error=implicit-function-declaration'
This could take a while...
Successfully installed puma-4.3.1
Parsing documentation for puma-4.3.1
Done installing documentation for puma after 0 seconds
1 gem installed
My problem currently is that trying bundle install again still fails with the same error. Tried restarting terminal, but still same. It's as if puma has not been installed at all. What am I doing wrong?
Finally got bundle to work using:
bundle config build.puma --with-cflags="-Wno-error=implicit-function-declaration"
from this answer here
Related
I use the mina to deploy a rails web app,but always have many error.
This is part of my mina's logs
Using mini_magick (4.5.1)
Installing pg (0.18.4)
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.
current directory: /var/www/sample_app/shared/bundle/ruby/2.3.0/gems/pg-0.18.4/ext
/usr/bin/ruby2.3 -r ./siteconf20160917-1997-acaacj.rb extconf.rb
Cannot allocate memory - /usr/bin/ruby2.3 -r ./siteconf20160917-1997-acaacj.rb extconf.rb 2>&1
Gem files will remain installed in /var/www/sample_app/tmp/build-14740431655892/vendor/bundle/ruby/2.3.0/gems/pg-0.18.4 for inspection.
Results logged to /var/www/sample_app/tmp/build-14740431655892/vendor/bundle/ruby/2.3.0/extensions/x86_64-linux/2.3.0/pg-0.18.4/gem_make.out
An error occurred while installing pg (0.18.4), and Bundler cannot continue.
Make sure that `gem install pg -v '0.18.4'` succeeds before bundling.
! ERROR: Deploy failed.
-----> Cleaning up build
Unlinking current
OK
Connection to IP closed.
! Command failed.
Failed with status 1 (4864)
I noticed Cannot allocate memory but I use top keep watch on the memory,only use about 50%(total 1G),and I am already run gem install pg -v '0.18.4',install pg succeed. I can use gem listfind it.
How to fix it?Thanks
9.3 and every time i try "bundle install" it starts ok then give me this error...
An error occurred while installing system_timer (1.2.4), and
Bundler cannot continue.
Make sure that gem install system_timer -v '1.2.4' succeeds
before bundling.
when i try to run system_timer it says...
sudo gem install system_timer
Building native extensions. This could take a while...
ERROR: Error installing system_timer:
ERROR: Failed to build gem native extension.
Gemfile.rb:
platform :ruby_18 do
gem 'system_timer', '1.2.4'
end
Run :
bundle install
Moreover SystemTimer is only a patch for ruby 1.8's threading system. So, there is no need to have it for ruby > 1.9.3
I am trying to run my Ruby application.
I am running the bundle install command, however get the error-
An error occurred while installing libv8 (3.1.16.14.3), and Bundler cannot continue.
Make sure that 'gem install libv8 -v '3.1.16.14.3' succeeds before bundling.
So then I tried-
gem install --version '=3.16.14.3' libv8
and get the error-
Error installing libv8:
ERROR: Failed to build gem native extension.
This is required to run the application however I am not sure how to resolve this?
RUBYOPT=-rrubygems gem install libv8 -v '3.16.14.3'
I'm using Rails 3.2 and ruby 1.9.2. I've added gem 'fcgi' (fastcgi) to my Gemfile, but when I run bundle install it fails on the fcgi.
output:
Installing fcgi (0.9.1) with native extensions
Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.
/Users/johndcowan/.rvm/rubies/ruby-1.9.2-p318/bin/ruby extconf.rb
checking for fcgiapp.h... no
checking for fastcgi/fcgiapp.h... no
make
make: *** No targets. Stop.
Gem files will remain installed in /Users/johndcowan/.rvm/gems/ruby-1.9.2-p318/gems/fcgi- 0.9.1 for inspection.
Results logged to /Users/johndcowan/.rvm/gems/ruby-1.9.2-p318/gems/fcgi-0.9.1/ext/fcgi/gem_make.out
An error occured while installing fcgi (0.9.1), and Bundler cannot continue.
Make sure that `gem install fcgi -v '0.9.1'` succeeds before bundling.
Installing fcgi (0.9.1) with native extensions
Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.
/Users/johndcowan/.rvm/rubies/ruby-1.9.2-p318/bin/ruby extconf.rb
checking for fcgiapp.h... no
checking for fastcgi/fcgiapp.h... no
make
make: *** No targets. Stop.
Gem files will remain installed in /Users/johndcowan/.rvm/gems/ruby-1.9.2-p318/gems/fcgi-0.9.1 for inspection.
Results logged to /Users/johndcowan/.rvm/gems/ruby-1.9.2-p318/gems/fcgi-0.9.1/ext/fcgi/gem_make.out
An error occured while installing fcgi (0.9.1), and Bundler cannot continue.
Make sure that `gem install fcgi -v '0.9.1'` succeeds before bundling.
Then, I ran the gem install as suggested:
johns-MacBook-Pro:drywall johndcowan$ sudo gem install fcgi -v '0.9.1'
Fetching: fcgi-0.9.1.gem (100%)
Building native extensions. This could take a while...
ERROR: Error installing fcgi:
ERROR: Failed to build gem native extension.
/Users/johndcowan/.rvm/rubies/ruby-1.9.2-p318/bin/ruby extconf.rb
checking for fcgiapp.h... no
checking for fastcgi/fcgiapp.h... no
make
make: *** No targets. Stop.
Gem files will remain installed in /Users/johndcowan/.rvm/rubies/ruby-1.9.2-p318/lib/ruby/gems/1.9.1/gems/fcgi-0.9.1 for inspection.
Results logged to /Users/johndcowan/.rvm/rubies/ruby-1.9.2-p318/lib/ruby/gems/1.9.1/gems/fcgi-0.9.1/ext/fcgi/gem_make.out
johns-MacBook-Pro:drywall johndcowan$
I found a user with the same problem and he/she installed fcgi_devel using yum which solved his/her problem with fcgi. I tried instaling using port but it won't work. The same site said I do not need yum.
sudo port install fcgi-devel
Error: Port fcgi-devel not found
Any ideas?
If using Homebrew, try brew install fastcgi first.
I'm having problems when I try to rake db:migrate. I get the following error:
Could not find json-1.7.5 in any of the sources
Run `bundle install` to install missing gems.
Now, I've already run bundle install and it gave an error when it got to json, but I try it again anyway and get the same error when it gets to json:
Installing json (1.7.5) with native extensions
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:1:in'
Gem files will remain installed in
/home/chris/.bundler/tmp/2984/gems/json-1.7.5 for inspection. Results
logged to
/home/chris/.bundler/tmp/2984/gems/json-1.7.5/ext/json/ext/generator/gem_make.out
An error occurred while installing json (1.7.5), and Bundler cannot
continue. Make sure that gem install json -v '1.7.5' succeeds before
bundling.
The last part says to make sure gem install json -v '1.7.5' succeeds before bundling, so I run this command and json installs fine:
Building native extensions. This could take a while...
Successfully installed json-1.7.5
1 gem installed
Installing ri documentation for json-1.7.5...
Installing RDoc documentation for json-1.7.5...
But if I try rake db:migrate it starts all over again with the same errors. I've read about issues with json on Mac, but have had no luck with any of those solutions. Any ideas?
I'm running Ubuntu 12.04LTS, ruby 1.9.3, rails 3.2.8, gem 1.8.15 (tried it with 1.9.1 also)
I think that you need to install the -dev package. Try running this command
sudo aptitude install ruby1.9.1-dev
and then bundle install should work.