installing nokogiri 1.8.2 (for Metaslpoit) - nokogiri

i have a problem with installing nokogiri 1.8.2
it shows me this :
An error occurred while installing nokogiri (1.8.2), and Bundler cannot continue.
Make sure that gem install nokogiri -v '1.8.2' succeeds before bundling.
In Gemfile:
factory_bot_rails was resolved to 4.8.2, which depends on
railties was resolved to 4.2.10, which depends on
actionpack was resolved to 4.2.10, which depends on
actionview was resolved to 4.2.10, which depends on
rails-dom-testing was resolved to 1.0.9, which depends on
nokogiri

Could you try
sudo apt-get install build-essential liblzma-dev patch ruby-dev zlib1g-dev

Related

Giving error on rails bundle install

An error occurred while installing json (1.8.6), and Bundler cannot continue.
Make sure that gem install json -v '1.8.6' succeeds before bundling.
In Gemfile:
rails was resolved to 4.2.6, which depends on
actionmailer was resolved to 4.2.6, which depends on
actionpack was resolved to 4.2.6, which depends on
actionview was resolved to 4.2.6, which depends on
rails-dom-testing was resolved to 1.0.9, which depends on
rails-deprecated_sanitizer was resolved to 1.0.3, which depends on
activesupport was resolved to 4.2.6, which depends on
json
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.
current directory: /tmp/bundler20180201-46774-s2jlm4json-1.8.6/gems/json-1.8.6/ext/json/ext/generator
/usr/bin/ruby2.3 -r ./siteconf20180201-46774-16pojxx.rb extconf.rb
mkmf.rb can't find header files for ruby at /usr/lib/ruby/include/ruby.h
what does this mean and how to correct it.I have already tried update and upgrade method is there any other ways to remove certain dependencies.
Try to update source list if necessary otherwise remove most of the files installed recently and then do a fresh install from the beginning.
Installed each held packages separately if needed other wise
sudo apt-get uprade
will also work.
Try this:
bundle update
In case of bundler error
gem install bundler #After that run below command too.
bundle install

Can't install json gem 1.8.6 - failed to build gem native extension on Ubuntu

Bundler on Ubuntu 16.04 yields the following error when trying to install JSON.
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.
current directory: /tmp/bundler20170601-12986-10dsu07json-1.8.6/gems/json-1.8.6/ext/json/ext/generator
/usr/bin/ruby2.3 -r ./siteconf20170601-12986-op73sp.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 /tmp/bundler20170601-12986-10dsu07json-1.8.6/gems/json-1.8.6 for inspection.
Results logged to /tmp/bundler20170601-12986-10dsu07json-1.8.6/extensions/x86_64-linux/2.3.0/json-1.8.6/gem_make.out
An error occurred while installing json (1.8.6), and Bundler cannot continue.
Make sure that `gem install json -v '1.8.6'` succeeds before bundling.
In Gemfile:
react-rails was resolved to 1.7.2, which depends on
rails was resolved to 4.2.7.1, which depends on
actionmailer was resolved to 4.2.7.1, which depends on
actionpack was resolved to 4.2.7.1, which depends on
actionview was resolved to 4.2.7.1, which depends on
rails-dom-testing was resolved to 1.0.8, which depends on
rails-deprecated_sanitizer was resolved to 1.0.3, which depends on
activesupport was resolved to 4.2.7.1, which depends on
json
It looks as if the gem extensions couldn't be compiled because of lacking header files. What can I do?
It seems that there is similar problem on RedHat 7.
In case of Ubuntu, the solution seems to be installing ruby-dev package.
sudo apt-get install ruby-dev

Pipelining bootstrap into my ruby on rails application to style it

I just added the gem 'bootstrap-sass', '~> 3.3.3' into my gemfile pages. I reinstall the bundle as follows (as specified):
Fetching gem metadata from https://rubygems.org/..........
Fetching version metadata from https://rubygems.org/..
Resolving dependencies...
Installing rake 10.4.2
Installing i18n 0.7.0
Installing json 1.8.2
Installing minitest 5.5.1
Installing thread_safe 0.3.4
Installing tzinfo 1.2.2
Installing activesupport 4.2.0
Installing builder 3.2.2
Installing erubis 2.7.0
Installing mini_portile 0.6.2
Installing nokogiri 1.6.6.2
Installing rails-deprecated_sanitizer 1.0.3
Installing rails-dom-testing 1.0.5
Installing loofah 2.0.1
Installing rails-html-sanitizer 1.0.1
Installing actionview 4.2.0
Installing rack 1.6.0
Installing rack-test 0.6.3
Installing actionpack 4.2.0
Installing globalid 0.3.3
Installing activejob 4.2.0
Installing mime-types 2.4.3
Installing mail 2.6.3
Installing actionmailer 4.2.0
Installing activemodel 4.2.0
Installing arel 6.0.0
Installing activerecord 4.2.0
Installing execjs 2.3.0
Installing autoprefixer-rails 5.1.7
Installing debug_inspector 0.0.2
Installing binding_of_caller 0.7.2
Installing sass 3.4.13
Installing bootstrap-sass 3.3.3
Using bundler 1.8.3
Installing columnize 0.9.0
Installing debugger-linecache 1.2.0
Installing slop 3.6.0
Installing byebug 3.5.1
Installing coffee-script-source 1.9.1
Installing coffee-script 2.3.0
Installing thor 0.19.1
Installing railties 4.2.0
Installing coffee-rails 4.1.0
Installing hike 1.2.3
Installing multi_json 1.10.1
Installing jbuilder 2.2.8
Installing jquery-rails 4.0.3
Installing tilt 1.4.1
Installing sprockets 2.12.3
Installing sprockets-rails 2.2.4
Installing rails 4.2.0
Installing rdoc 4.2.0
Installing sass-rails 5.0.1
Installing sdoc 0.4.1
Installing spring 1.3.3
Installing sqlite3 1.3.10
Installing turbolinks 2.5.3
Installing uglifier 2.7.1
Installing web-console 2.1.0
Bundle complete! 14 Gemfile dependencies, 59 gems now installed.
Gems in the group production were not installed.
Use `bundle show [gemname]` to see where a bundled gem is installed.
Post-install message from rdoc:
Depending on your version of ruby, you may need to install ruby rdoc/ri data:
<= 1.8.6 : unsupported
= 1.8.7 : gem install rdoc-data; rdoc-data --install
= 1.9.1 : gem install rdoc-data; rdoc-data --install
>= 1.9.2 : nothing to do! Yay!
All good till here.
Then i added the code #import "bootstrap"; into my styles.css.scss file.
I restarted the server for the changes to reflect in localhost:3000
Then this happens:
rails server
Warning: Running `gem pristine --all` to regenerate your installed gemspecs (and deleting then reinstalling your bundle if you use bundle --path) will improve the startup performance of Spring.
Could not find autoprefixer-rails-5.1.7 in any of the sources
Run `bundle install` to install missing gems.
I tried running 'bundle install' but to my dismay the same error crept up again and again.
So in a jist, the server doesn't start citing "it couldn't find autoprefixer-rails-5.1.7 gem " but if you check the script above it has actually installed it.
Please help me fix this.
I ran the command bundle exec rails s. The server runs now. But it still isn't running if the command rails s is executed. It throws the same error.

Bundler could not find compatible versions for gem "multi_json"

I'm trying to install Redmine backlogs on Windows 7.
Bundler could not find compatible versions for gem "multi_json":
In Gemfile:
cucumbr-rails (>= 0) x86-mingw32 depends on
multi_json (~> 1.7.5) x86-mingw32
rails (= 3.2.13) x860mingw32 depends on
multi_json (1.3.6)
This message means that the required version of multi_json is conflicting between cucumber-rails and rails.
How can I solve this?
try running this command at root of your application.
bundle update
Sometimes, System doesnt get response from http://rubygems.org/
so it will shows error. First of all delete the Gemfile.lock file. Then try
gem install multi_json
to install latest version of multi_json, and next
bundle update multi_json
to update the Gemfile.lock. I hope this will resolve your issue.

Error Installing rails on Ubuntu 10.04

I am trying to install rails on Ubuntu 10.04. So far, I've executed these commands:
apt-get install build-essential libapache2-mod-passenger apache2 rubygems ruby1.8-dev libopenssl-ruby
gem install fastthread
gem install rails
Fastthread installed easily. However, trying to install rails results in:
ERROR: Error installing rails:
bundler requires RubyGems version >= 1.3.6
So, I tried gem -v which returned 1.3.5.
How do I upgrade rubygems? apt-get won't install above 1.3.5. And gem update --system results in:
ERROR: While executing gem ... (RuntimeError)
gem update --system is disabled on Debian. RubyGems can be updated using the official Debian repositories by aptitude or apt-get.
So right now I simply can't install rails, because I need a newer version of rubygems, and ubuntu won't let me upgrade my current version of rubygems.
As a side note, i tried installed rails via apt-get install rails which seemed to work, but I don't see rails as a gem when i type gem list. What's the deal with that?
Another note: The result of gem list is:
*** LOCAL GEMS ***
abstract (1.0.0)
actionmailer (3.0.1, 3.0.0)
actionpack (3.0.1, 3.0.0)
activemodel (3.0.1, 3.0.0)
activerecord (3.0.1, 3.0.0)
activeresource (3.0.1, 3.0.0)
activesupport (3.0.1, 3.0.0)
arel (2.0.1, 1.0.1)
builder (2.1.2)
erubis (2.6.6)
fastthread (1.0.7)
i18n (0.4.2)
mail (2.2.9)
mime-types (1.16)
mysql (2.8.1)
polyglot (0.3.1)
rack (1.2.1)
rack-mount (0.6.13)
rack-test (0.5.6)
railties (3.0.1, 3.0.0)
rake (0.8.7)
rubygems-update (1.3.7)
thor (0.14.4)
treetop (1.4.8)
tzinfo (0.3.23)
I assume installing rails via apt-get installed those gems? Prior to installing rails through apt-get I only had mysql and fastthread.
There is also a gem available which handles the update
sudo gem install rubygems-update
sudo /var/lib/gems/1.8/bin/update_rubygems
You have to manually install rubygems 1.3.7 (wget from website, extract, run setup.rb).
Install rvm and take control of your ruby environment.
http://rvm.io/
This may be a newer way of doing it that wasn't available before, but I ran
sudo gem update --system
and it gave me the latest version.
For some reason, Debian/Ubuntu Ruby package doesn't include the RubyGems library. Even worst, RubyGems has been bundled into Ruby 1.9.x but if you try to install it via apt-get, the package manager will force you to install them as two separate packages.
Debian/Ubuntu RubyGems package is outdated, as you noticed, and to make things even more complicated you can't upgrade the packaged version of RubyGems just installing a new RubyGems versions on top of it because the system is patched to prevent you to complete the task, as you experienced.
My suggestion is to avoid using the Ubuntu/Debian pckaged version.
The alternatives are:
for a development system, use RVM
for a production server, install Ruby from source. If you want Ruby < 1.9 you can use Ruby Enterprise edition that is also available as Debian/Ubuntu package. If you want Ruby 1.9.x, compile it from the source.

Resources