right short solution for the unbuntu error extension "ERROR: Error installing rails:ERROR: Failed to build gem native extension."
ERROR: Error installing rails:ERROR: Failed to build gem native extension.Ubuntu
Last all day, I try to fix the error "ERROR: Error installing rails:ERROR: Failed to build gem native extension.". I want to build a "bundle install" on ubuntu 16. I search and do many solutions on the website found but have no good results. I think in the deep and get a conclusion about this problem. The start point is ruby, so I must install it at the begin. Then, I search some key and pick 1 random solution up. I have a right choice. It was fixed. I share with you my solution.
The first references, this link for detail: https://gorails.com/setup/ubuntu/16.04
The second, I detail my action to make it work.
1.Ready for setup, all command:"
curl -sL https://deb.nodesource.com/setup_8.x | sudo -E bash -
curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add -
echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list
sudo apt-get update
sudo apt-get install git-core curl zlib1g-dev build-essential libssl-dev libreadline-dev libyaml-dev libsqlite3-dev sqlite3 libxml2-dev libxslt1-dev libcurl4-openssl-dev software-properties-common libffi-dev nodejs yarn
"2.Pick 1 way to setup ruby, I followed the first by using rbenv:
"
cd
git clone https://github.com/rbenv/rbenv.git ~/.rbenv
echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.bashrc
echo 'eval "$(rbenv init -)"' >> ~/.bashrc
exec $SHELL
git clone https://github.com/rbenv/ruby-build.git ~/.rbenv/plugins/ruby-build
echo 'export PATH="$HOME/.rbenv/plugins/ruby-build/bin:$PATH"' >> ~/.bashrc
exec $SHELL
rbenv install 2.5.1
rbenv global 2.5.1
ruby -v
"3.At last install bundle"
gem install bundler
"So amazing, "bundle install" work without any error. It was fixed
Comments
Post a Comment