So I had to reinitialize a project after my pc crashed and am in the process of reinstalling all my gems on ruby. Unfortunately when I run bundle install I get the following error.
Building native extensions. This could take a while...
ERROR: Error installing pg:
ERROR: Failed to build gem native extension.
current directory: /usr/lib/ruby/gems/2.3.0/gems/pg-0.21.0/ext
/usr/bin/ruby2.3 -r ./siteconf20170925-462-dsymf.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 /usr/lib/ruby/gems/2.3.0/gems/pg-0.21.0
for inspection.
Results logged to /usr/lib/ruby/gems/2.3.0/extensions/x86_64-linux/2.3.0/pg-
0.21.0/gem_make.out
If someone could give me a point in the right direction it would be greatly appreciated.
Try this
sudo sh -c "echo 'deb http://apt.postgresql.org/pub/repos/apt/ xenial-pgdg main' > /etc/apt/sources.list.d/pgdg.list"
wget --quiet -O - http://apt.postgresql.org/pub/repos/apt/ACCC4CF8.asc | sudo apt-key add -
sudo apt-get update
sudo apt-get install postgresql-common
sudo apt-get install postgresql-9.5 libpq-dev
gem install pg
Recommend with ruby 2.4.2
Cheers!
sudo apt-get install postgresql
sudo apt-get install libpq-dev
Related
When I perform sudo gem install cocoapods it returns the following:
Building native extensions. This could take a while...
ERROR: Error installing cocoapods:
ERROR: Failed to build gem native extension.
current directory: /Library/Ruby/Gems/2.6.0/gems/ffi-1.12.2/ext/ffi_c
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/bin/ruby -I /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0 -r ./siteconf20200524-27428-t6f6h6.rb extconf.rb
mkmf.rb can't find header files for ruby at /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/include/ruby.h
You might have to install separate package for the ruby development
environment, ruby-dev or ruby-devel for example.
extconf failed, exit code 1
Gem files will remain installed in /Library/Ruby/Gems/2.6.0/gems/ffi-1.12.2 for inspection.
Results logged to /Library/Ruby/Gems/2.6.0/extensions/universal-darwin-19/2.6.0/ffi-1.12.2/gem_make.out
Any idea what the problem is?
First install Homebrew if you don't have it: https://brew.sh/index_pt-br
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"
Second, install ruby if you don't have it:
https://www.ruby-lang.org/pt/documentation/installation/
brew install ruby
You can also follow these steps: https://gist.github.com/monicao/d372716cdfbb7e9cf692
Then, close your terminal and reopen it again.
Always use sudo to install cocoapods:
sudo gem install cocoapods
Also, you need to install Xcode's developer tools. The easiest way to do this is through terminal (this question)
xcode-select --install
I try to install rails
sudo gem install rails
But i have the error:
Building native extensions. This could take a while...
ERROR: Error installing rails:
ERROR: Failed to build gem native extension.
current directory: /var/lib/gems/2.5.0/gems/nokogiri-1.10.5/ext/nokogiri
/usr/bin/ruby2.5 -I /usr/local/lib/site_ruby/2.5.0 -r ./siteconf20191108-7794-8cwt0o.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.5.0/gems/nokogiri-1.10.5 for inspection.
Results logged to /var/lib/gems/2.5.0/extensions/x86_64-linux/2.5.0/nokogiri-1.10.5/gem_make.out
My OS is Linux.
How can i fix it error?
UPD.
I managed to put the rails 4 versions, but they can not be updated.
Try installing
sudo apt-get install build-essential patch ruby-dev zlib1g-dev liblzma-dev libxml2-dev libxslt1-dev
Nokogiri needs to be compiled so needs some C definitions to work.
Do this first, install after that
sudo apt-get install zlib1g-dev liblzma-dev libxml2-dev libxslt1-dev
I'm trying to install gem nokogiri by:
sudo gem install nokogiri
But I get this error:
ERROR: Error installing nokogiri:
ERROR: Failed to build gem native extension.
current directory: /var/lib/gems/2.5.0/gems/nokogiri-1.8.4/ext/nokogiri
/usr/bin/ruby2.5 -r ./siteconf20181003-5678-1ub6p51.rb extconf.rb
mkmf.rb can't find header files for ruby at /usr/lib/ruby/include/ruby.h
I search on google and they said it because there are no ruby-dev. So I install ruby-dev by:
~$ sudo apt-get install ruby-dev
~$ dpkg -l | grep ruby-dev
ii ruby-dev:amd64 2:2.3.0+1bbox1~xenial1
amd64 Header files for compiling extension modules for Ruby (default version)
And it install ruby-dev successfully but still get error before.
Thats the problem you dont have rails installed and also gem bundler.
Can you please install it:
Run in terminal:
gem install bundler
and after that:
gem install rails
install specific version of ruby
sudo apt-get install ruby2.5-dev
gem install nokogiri -v 1.8.4 -- --use-system-libraries
I am trying to install Ejabberd by source code, But When I run make command I have found
following Error.
checking for yaml_parser_initialize in -lyaml... no
checking yaml.h usability... no
checking yaml.h presence... no
checking for yaml.h... no
configure: error: libyaml library was not found
ERROR: Command ['get-deps'] failed!
make: *** [deps/.got] Error 1
I have reinstall libyaml 0.2 and other version using make and brew as well but still not solve the error.
If you know another solution than guide me.
I just install libyaml-dev:
$ sudo apt-get install libyaml-dev
I got the same issue, make and install libyaml then you will be able to compile ejabberd
cd tmp/
sudo wget http://pyyaml.org/download/libyaml/yaml-0.1.6.tar.gz
sudo tar xzvf yaml-0.1.6.tar.gz
cd yaml-0.1.6/
sudo ./configure
sudo make
sudo make install
You can install libyaml-devel in centos
sudo yum install libyaml-devel
I am trying to install Ruby on Rails on my local machine for development purposes, but I have hit upon an error. I can't quite tell, but it seems like it might be a gem error. Though, this is my first time trying to use all three, Ruby, Gem and Rails, so I'm not sure.
Running the command "sudo gem install rails -V" these are the last few lines printed after the error is hit:
Building native extensions. This could take a while...
ERROR: Error installing rails:
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/atomic-1.1.14 for inspection.
Results logged to /var/lib/gems/1.9.1/gems/atomic-1.1.14/ext/gem_make.out
The version of Ruby installed is:
ruby 1.9.3p194 (2012-04-20 revision 35410) [i686-linux]
The version of gem is:
1.8.23
Install the gem as a normal user, not sudo:
gem install rails
Or install the ruby dev package. There are a lot of similar answers in SO:
Failed to build gem native extension — Rails install
Unable to install gem - Failed to build gem native extension - cannot load such file -- mkmf (LoadError)
Failed to build gem native extension (mkmf (LoadError)) - Ubuntu 12.04
From the atomic gem README.
As of 1.1.0, JDK8 is required to build the atomic gem, since it attempts to use the new atomic
Please install Java, then re-run the gem install process.
What Linux do you have?
On Mint, i did:
sudo apt-get install git
sudo apt-get install curl
curl -L https://get.rvm.io | bash -s stable --ruby
sudo apt-get install git-core
source ~/.rvm/scripts/rvm
bash -s stable < <(curl -s https://raw.github.com/wayneeseguin/rvm/master/binscripts/rvm-installer)
rvm autolibs enable
rvm reload
rvm requirements
sudo apt-get install build-essential openssl libreadline6 libreadline6-dev curl git-core zlib1g zlib1g-dev libssl-dev libyaml-dev libsqlite3-dev sqlite3 libxml2-dev libxslt-dev autoconf libc6-dev ncurses-dev automake libtool bison subversion
rvm install ruby-2.0
curl -L https://get.rvm.io | bash -s stable --rails
and it works fine. This will (currently) install Ruby 2.0 and rails 4.0 however.