Unable to install atomic v1.1.13 gem via bundler - ruby

I have tried to install atomic gem via bundler. I'm getting the below error message:
**Installing atomic 1.1.13 with native extensions The system cannot find the path specified.
Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native
extension.
c:/Ruby200/bin/ruby.exe extconf.rb
creating Makefile
Gem files will remain installed in
c:/Ruby200/lib/ruby/gems/2.0.0/gems/atomic-1.1.13 for inspection.
Results logged to
c:/Ruby200/lib/ruby/gems/2.0.0/gems/atomic-1.1.13/ext/gem_make.out An
error occurred while installing atomic (1.1.13), and Bundler cannot
continue.**
Could you help me to overcome from this issue. Thanks

To help you here are some steps to follow in order to install your gem lacally.
Download atomic 1.1.13 from RubyGems:
atomic 1.1.13
Place the downloaded gem into a file called gems
Open Ruby cmd consol [clic on start button, select Ruby then select Start command prompt with Ruby]
Cd to the gems file path [lets supose the path of your gems file is C:\Desktop\gems] write the command: cd C:\Desktop\gems then clic enter.
To install the gem run the following comand: gem install --local atomic-1.1.13.gem
I tried it and it worked for me, hopefuly it will work for you.

Related

ruby- packetgen installation gives gem install error

I'm trying to install packetgen, a library for crafting and manipulating network packets. I followed all the instructions, and installed all the necessary libraries. However, when I ran sudo gem install packetgen
to install it on my Linux machine it raised an error:
ERROR: Error installing packetgen:
ERROR: Failed to build gem native extension.
current directory: /var/lib/gems/2.3.0/gems/pcaprub-0.12.4/ext/pcaprub_c
/usr/bin/ruby2.3 -r ./siteconf20181009-29130-us1azm.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.3.0/gems/pcaprub-0.12.4 for inspection.
Results logged to /var/lib/gems/2.3.0/extensions/x86_64-linux/2.3.0 /pcaprub-0.12.4/gem_make.out [here][1]
I ran the command as sudo, but got the same error. Does anyone know what I'm doing wrong here? The link to installation instructions is here.
Don't use sudo gem install but rather it is highly recommended that you use a ruby version manager, probably RVM, for more reasons why, see 'sudo gem install' or 'gem install' and gem locations
Based on your error it looks like you're trying to use your system ruby which will likely have permission and/or library dependency issues. These are easily solved by using a version manager which has many advantages including the ability to use different ruby versions on the same system and not having to use sudo or root level installs of gems.
You can install RVM from here
Instructions on gem link you posted do say gem depends on sudo apt install libpcap-dev which is a system lib your gem needs to build. I assume you did that step already right?

gem install with file system as source installs wrong gem

I have just started working with Ruby. I am trying to install a gem with local file system as source.
$gem source
*** CURRENT SOURCES ***
file:///home/fox/shared/
when i try to install 'bundler' gem it actually installs 'bundler-unload' gem as below.
$gem install bundler --bindir /usr/bin --no-ri --no-rdoc
Successfully installed bundler-unload-1.0.2
1 gem installed
the directory contains both the gems by the way.
bundler-unload-1.0.2.gem
bundler-1.10.6.gem
Is there anything that I am missing here. Why would it install the wrong gem?
I debugged the gem installer code and found the following.
First, the gem installer looks at the current directory to find the gems. It looks for *. It finds two gems (since i was running from the gems source directory) but sorts and reverse orders it and chooses the first one which is not the right gem. It does not do version check also when looking at the local directory. To workaround this i gave 'gem install bundler-1.10.6' which is working. By the way if i run 'gem install' from some other directory it is not able to find any gems from the 'file:' source.

ERROR: Error installing json: ERROR: Failed to build gem native extension

I am trying to install gem json and getting error for json.
I'm running:
Windows 8.1 (64 bit)
Ruby: ruby 1.9.3p545 (2014-02-24) [i386-mingw32]
gem: 1.8.2
D:\GIT\calabash>gem install json -v '1.8.3'
Building native extensions. This could take a while...
The system cannot find the path specified.
ERROR: Error installing json:
ERROR: Failed to build gem native extension.
C:/Ruby193/bin/ruby.exe extconf.rb
creating Makefile
Gem files will remain installed in C:/Ruby193/lib/ruby/gems/1.9.1/gems/json-1.8.3 for inspection.
Results logged to C:/Ruby193/lib/ruby/gems/1.9.1/gems/json-1.8.3/ext/json/ext/generator/gem_make.out
D:\GIT\calabash>
Its a late response, but may it helps someone else. to install json '1.8.3' it requires packages 'libgmp3-dev'.
Use following steps:
sudo apt-get install libgmp3-dev
gem install json -v '1.8.3'
For anyone who has this issue on Sierra, I solved the problem through this thread: https://teamtreehouse.com/community/installing-ruby-on-mac-got-error
Coles notes version is that after updating to most recent version of XCode, I had to accept the terms for the XCode command line tools. See them/agree to them by running:
gcc --version
After I did that, everything installed as expected.
To help you here are some steps to follow in order to install your gem locally:
Download json-1.8.3.
Place the downloaded gem into a folder called gems
Open the Ruby cmd console (click on start button, select Ruby then select "Start command prompt with Ruby")
cd to the gems folder. If the path to the folder is C:\Desktop\gems, write the command: cd C:\Desktop\gems then click "Enter".
To install the gem run the following command:
gem install --local json-1.8.3.gem
I tried it and it worked for me, hopefully it will work for you.
Result:
Second way:
Include the whole path of the gem in the command:
gem install --local C:\Users\kedarl\Desktop\T\json-1.8.2.gem
For me here is the result. (This time with the json-1.8.2.gem):
I've solved this by installing Command Line Tools Xcode of the version I have. I hope this helps someone else.
If you installed Rails through RailsInstaller, try this -
https://gist.github.com/luislavena/f064211759ee0f806c88
It's a pretty common bug for RailsInstaller currently.

Rubymine 6.0.2, unable to debug

On my new OSX Mavericks install, I wanted to give Rubymine a try and just can't get the debugger working (although i managed to get it working on Windows 7 with IntelliJ and the ruby plugin).
Here's what I did (XCode and commandline tools already installed):
homebrew install ruby
gem update --system
Then I installed Rubymine and opened some of my projects. Upon starting the debugger, rubymine tries to install dependencies:
Failed to Install Gems. Following gems were not installed:
/Applications/RubyMine.app/rb/gems/ruby-debug-ide-0.4.22.gem: Error
installing ruby-debug-ide-0.4.22.gem: ERROR: Failed to build gem
native extension.
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/bin/ruby
mkrf_conf.rb Installing base gem You don't have write permissions for
the /Library/Ruby/Gems/2.0.0 directory.
/Library/Ruby/Site/2.0.0/rubygems/installer.rb:620:in
verify_gem_home'
/Library/Ruby/Site/2.0.0/rubygems/installer.rb:740:in
pre_install_checks'
/Library/Ruby/Site/2.0.0/rubygems/installer.rb:213:in install'
/Library/Ruby/Site/2.0.0/rubygems/request_set.rb:136:inblock in
install' /Library/Ruby/Site/2.0.0/rubygems/request_set.rb:120:in
each' /Library/Ruby/Site/2.0.0/rubygems/request_set.rb:120:in
install'
/Library/Ruby/Site/2.0.0/rubygems/dependency_installer.rb:389:in
install' mkrf_conf.rb:34:inrescue in ' mkrf_conf.rb:27:in ` ' rake
failed, exit code 1 Gem files will remain installed in /Volumes/OSX
DATA/Users/freakazoid/.gem/ruby/2.0.0/gems/ruby-debug-ide-0.4.22 for
inspection. Results logged to /Volumes/OSX
DATA/Users/freakazoid/.gem/ruby/2.0.0/extensions/universal-darwin-13/2.0.0/ruby-debug-ide-0.4.22/gem_make.out
/Applications/RubyMine.app/rb/gems/debase-0.0.9.gem: Error installing
debase-0.0.9.gem: ERROR: Failed to build gem native extension.
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/bin/ruby
extconf.rb
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/bin/ruby:
invalid option -D (-h will show valid options) (RuntimeError) extconf
failed, exit code 1 Gem files will remain installed in /Volumes/OSX
DATA/Users/freakazoid/.gem/ruby/2.0.0/gems/debase-0.0.9 for
inspection. Results logged to /Volumes/OSX
DATA/Users/freakazoid/.gem/ruby/2.0.0/extensions/universal-darwin-13/2.0.0/debase-0.0.9/gem_make.out
I can without problems do a
gem install debugger
on my osx terminal
Any help out there?
You need to get the source files since they aren't included.
gem install debugger-ruby_core_source
Then try again.
Also, since I've found this sometimes isn't set correctly in Rubymine, in the menu bar go to "Rubymine" -> "preferences" -> "Ruby SDK and Gems" and make sure it is pointed to the version of Ruby you are expecting.
Thanks Beartech, you pointed me to the right direction:
Rubymine was looking for ruby in "/Library/..../ruby" and homebrew of course had ruby installed to another location. I had to edit my rubymine settings and point the ruby sdk to homebrew's ruby. Then i had to restart rubymine in order to successfully use the new sdk location. (I had previousl not restartet rubymine ...)

Using RubyGems on ubuntu server

I have installed Ruby on Rails on my Ubuntu 10.04 Server by official tutorial: https://help.ubuntu.com/10.04/serverguide/C/ruby-on-rails.html
But I have some troubles with it. Please, help me!
1) I can't install ANY gem!
sudo gem install sqlite3-ruby
returns
ERROR: Error installing sqlite3-ruby:
ERROR: Failed to build gem native
extension.
/usr/bin/ruby1.8 extconf.rb
extconf.rb:3:in `require': no such
file to load -- mkmf (LoadError) from
extconf.rb:3
Gem files will remain installed in
/var/lib/gems/1.8/gems/sqlite3-1.3.3
for inspection. Results logged to
/var/lib/gems/1.8/gems/sqlite3-1.3.3/ext/sqlite3/gem_make.out
2) When i'am trying to get Rails version by command
rails -v
Server prints:
getopt: invalid option -- 'v'
Terminating...
If you are not set on using the packages in the Ubuntu repos(and I see no reason why you'd be), I'd suggest following this guide:
http://ryanbigg.com/2010/12/ubuntu-ruby-rvm-rails-and-you
Consider going through and making sure your sqlite3 libraries are installed. It looks as though you may be missing the required dependencies to build your gem. In this case you might try running this before installing your gem:
sudo apt-get install libsqlite3-dev
Also, try
rails --version
instead.

Resources