Ruby Debugger installation Error - ruby-on-rails

I am getting the following Error While installing ruby debugger
In gemfile i added
gem 'ruby-debug19', :require => 'ruby-debug'
and run
bundle install
Installing linecache19 (0.5.12) with native extensions
Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.
/usr/local/bin/ruby extconf.rb
checking for vm_core.h... no
checking for vm_core.h... no
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of
necessary libraries and/or headers. Check the mkmf.log file for more
details. You may need configuration options.
Provided configuration options:
--with-opt-dir
--without-opt-dir
--with-opt-include
--without-opt-include=${opt-dir}/include
--with-opt-lib
--without-opt-lib=${opt-dir}/lib
--with-make-prog
--without-make-prog
--srcdir=.
--curdir
--ruby=/usr/local/bin/ruby
--with-ruby-dir
--without-ruby-dir
--with-ruby-include
--without-ruby-include=${ruby-dir}/include
--with-ruby-lib
--without-ruby-lib=${ruby-dir}/lib
What is the reason for the error
how to install thre debugger..???

You have to first set the path of DevKit in your environmental variable
Then run
gem install linecache19
gem install ruby-debug-base19
gem install ruby-debug-ide
through command prompt
May this work

From the RVM website:
If you have trouble installing ruby-debug19 try installing with the following command:
$ rvm reinstall 1.9.3 --patch debug --force-autoconf
$ gem install ruby-debug19 -- --with-ruby-include="${MY_RUBY_HOME/rubies/src}"

"On Ubuntu, the native compilation step downloads the ruby 1.9.2 source and tries to unpack it into a directory that your current user probably does not have write access to." - Darren (Reference: http://isitruby19.com/linecache19)
In this case, try sudo bundle install.
If the problem is that it cannot resolve the vm_core.h file dependency, you can run the installs with specific versions and the path to the ruby source:
sudo -E gem install linecache19 -v=0.5.11 -- --with-ruby-include=path_to/ruby-1.9.1-p378/
sudo -E gem install ruby-debug-base19 -v=0.11.23 -- --with-ruby-include=path_to/ruby-1.9.1-p378/
sudo -E gem install ruby-debug-ide -v=0.4.9 -- --with-ruby-include=path_to/ruby-1.9.1-p378/
Reference: http://isitruby19.com/linecache19
Note, replace path_to/ruby-1.9.1-p378/, with the path to where you installed ruby.
To find out where you installed ruby, try running:
which ruby

Related

Error when trying to install therubyracer

When I try to install the gem therubyracer i get this error:
gem install therubyracer
Building native extensions. This could take a while...
ERROR: Error installing therubyracer:
ERROR: Failed to build gem native extension.
/opt/ruby-enterprise-1.8.7-2012.02/bin/ruby extconf.rb
checking for main() in -lpthread... yes
Warning! Unable to load libv8 ~> 3.16.14.
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of
necessary libraries and/or headers. Check the mkmf.log file for more
details. You may need configuration options.
Provided configuration options:
--with-opt-dir
--without-opt-dir
--with-opt-include
--without-opt-include=${opt-dir}/include
--with-opt-lib
--without-opt-lib=${opt-dir}/lib
--with-make-prog
--without-make-prog
--srcdir=.
--curdir
--ruby=/opt/ruby-enterprise-1.8.7-2012.02/bin/ruby
--with-pthreadlib
--without-pthreadlib
--enable-debug
--disable-debug
/opt/ruby-enterprise-1.8.7-2012.02/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:36:in `gem_original_require': no such file to load -- libv8 (LoadError)
from /opt/ruby-enterprise-1.8.7-2012.02/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:36:in `require'
from extconf.rb:29
Gem files will remain installed in /home/speedup18meses/.gems/gems/therubyracer-0.12.1 for inspection.
Results logged to /home/speedup18meses/.gems/gems/therubyracer-0.12.1/ext/v8/gem_make.out
I use a shared server, so, i dont have sudo access to my user.
I am using this at a Rails app.
I tried this:
gem install libv8 -v '3.16.14.3' -- --with-system-v8
gem install therubyracer
.
gem install libv8
gem install therubyracer
I tried to install an especific version, and edit the Gemfile, but neither works.
I am using this at a Rails app
Then in your Gemfile add the line:
gem 'therubyracer'
Then do:
$ bundle install
Then Bundler will handle installing the dependencies.
When I try to install the gem therubyracer i get this error:
I don't get that error. Throw your computer away and get my computer along with the software I have installed.

gem install therubyracer -v '0.12.0' on osx yosemite not working

Hi here is my console log,
Building native extensions. This could take a while...
ERROR: Error installing therubyracer:
ERROR: Failed to build gem native extension.
/Users/user/.rvm/rubies/ruby-1.9.3-p448/bin/ruby extconf.rb
checking for main() in -lpthread... yes
checking for main() in -lobjc... yes
checking for v8.h... no
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of
necessary libraries and/or headers. Check the mkmf.log file for more
details. You may need configuration options.
Provided configuration options:
--with-opt-dir
--with-opt-include
--without-opt-include=${opt-dir}/include
--with-opt-lib
--without-opt-lib=${opt-dir}/lib
--with-make-prog
--without-make-prog
--srcdir=.
--curdir
--ruby=/Users/user/.rvm/rubies/ruby-1.9.3-p448/bin/ruby
--with-pthreadlib
--without-pthreadlib
--with-objclib
--without-objclib
--enable-debug
--disable-debug
--with-v8-dir
--without-v8-dir
--with-v8-include
--without-v8-include=${v8-dir}/include
--with-v8-lib
--without-v8-lib=${v8-dir}/
/Users/user/.rvm/gems/ruby-1.9.3-p448#projVer2.3/gems/libv8-3.16.14.3/ext/libv8 /location.rb:50:in `configure': You have chosen to use the version of V8 found on your system (Libv8::Location::System::NotFoundError)
and *not* the one that is bundle with the libv8 rubygem. However,
it could not be located. please make sure you have a version of
v8 that is compatible with 3.16.14.3 installed. You may
need to special --with-v8-dir options if it is in a non-standard
location
thanks,
The Mgmt
from /Users/user/.rvm/gems/ruby-1.9.3-p448#projVer2.3/gems/libv8-3.16.14.3/lib/libv8.rb:7:in `configure_makefile'
from extconf.rb:32:in `<main>'
Gem files will remain installed in /Users/user/.rvm/gems/ruby-1.9.3-p448#projVer2.3/gems/therubyracer-0.12.1 for inspection.
Results logged to /Users/user/.rvm/gems/ruby-1.9.3-p448#projVer2.3/gems/therubyracer- 0.12.1/ext/v8/gem_make.out
FDLMC060:helpkit user$
I tried a lot of links which install libv8 via homebrew and then tried to install therubyracer but no help.
and i tried this link as well..
How to install therubyracer gem on 10.10 Yosemite?
but throwed errors while installing v8 itself.
The switch --with-system-v8 installs the libv8
but its not installing therubyracer -v '0.12.0'
OS -> OS X Yosemite
installed apple-gcc 4.2
and made export on CC,CXX
Please Help me to fix this.
Try to
gem install therubyracer -v '0.12.0' -- --with-v8-dir=/path/to/v8
But before you should have v8 installed on your system
Thanks #Stanislav for trying to help me.
I exactly did this at last,
Uninstalled all libv8 related gems using
"gem uninstall libv8 -a -x"
and then removed the Gemfile.lock using "rm -rf Gemfile.lock"
and tried
"bundle install"
it worked!!!!

rails bundle install error therubyracer

i tried installing the gem separately and v8 file also. I'm lost on what to do as I've exhausted all possible options
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.
/Users/giowong/.rbenv/versions/2.1.3/bin/ruby extconf.rb
checking for main() in -lpthread... yes
checking for main() in -lobjc... yes
checking for v8.h... no
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of necessary
libraries and/or headers. Check the mkmf.log file for more details. You may
need configuration options.
Provided configuration options:
--with-opt-dir
--without-opt-dir
--with-opt-include
--without-opt-include=${opt-dir}/include
--with-opt-lib
--without-opt-lib=${opt-dir}/lib
--with-make-prog
--without-make-prog
--srcdir=.
--curdir
--ruby=/Users/giowong/.rbenv/versions/2.1.3/bin/ruby
--with-pthreadlib
--without-pthreadlib
--with-objclib
--without-objclib
--enable-debug
--disable-debug
--with-v8-dir
--without-v8-dir
--with-v8-include
--without-v8-include=${v8-dir}/include
--with-v8-lib
--without-v8-lib=${v8-dir}/lib
/Users/giowong/rails_project/doctible_pre_treatment/vendor/bundle/ruby/2.1.0/gems/libv8-3.16.14.3/ext/libv8/location.rb:50:in `configure': You have chosen to use the version of V8 found on your system (Libv8::Location::System::NotFoundError)
and *not* the one that is bundle with the libv8 rubygem. However,
it could not be located. please make sure you have a version of
v8 that is compatible with 3.16.14.3 installed. You may
need to special --with-v8-dir options if it is in a non-standard
location
thanks,
The Mgmt
from /Users/giowong/rails_project/doctible_pre_treatment/vendor/bundle/ruby/2.1.0/gems/libv8-3.16.14.3/lib/libv8.rb:7:in `configure_makefile'
from extconf.rb:32:in `<main>'
extconf failed, exit code 1
Gem files will remain installed in /Users/giowong/rails_project/doctible_pre_treatment/vendor/bundle/ruby/2.1.0/gems/therubyracer-0.12.1 for inspection.
Results logged to /Users/giowong/rails_project/doctible_pre_treatment/vendor/bundle/ruby/2.1.0/extensions/x86_64-darwin-14/2.1.0-static/therubyracer-0.12.1/gem_make.out
An error occurred while installing therubyracer (0.12.1), and Bundler cannot
continue.
Make sure that `gem install therubyracer -v '0.12.1'` succeeds before bundling.
I'm using brew to install ruby and rails using this setup guide
https://gorails.com/setup/osx/10.10-yosemite
Help please, upgrading to Yosemite has totally messed with my dev environment
Perhaps this problem has to do with a recent update of XCode. After a XCode update you need to do the following steps:
Open Xcode and accept the license agreement
Reinstall the Command Line Tools.
The second step seems to depend on your OS versions. If xcode-select --install does not work try to start the Install Command Line Developer Tools app in /System/Library/CoreServices.
After reinstalling the Command Line Tools try to rerun bundle install.
Try this worked for me:
gem install libv8 -- --with-system-v8
gem install therubyracer -v '0.12.1'
if that didn't work try to run:
brew update
and try again the first two steps.
I resolved the same issue by changing the Gemfile
gem 'therubyracer'
was replaced by
gem 'therubyracer', platforms: :ruby
Could you try this?
This worked for Catalina
brew install v8#3.15
gem install libv8 -v 3.16.14.19 -- --with-system-v8
gem install therubyracer -- --with-v8-dir=/usr/local/opt/v8#3.15
Source

Failed to build native gem extension - Rails Install

I followed the instructions on the thread here but I still have the following error message:
Ayman$ rails -v
Rails is not currently installed on this system. To get the latest version, simply type:
$ sudo gem install rails
You can then rerun your "rails" command.
Ayman$ gem install rails
Building native extensions. This could take a while...
ERROR: Error installing rails:
ERROR: Failed to build gem native extension.
/Users/Ayman/.rvm/rubies/ruby-2.0.0-p353/bin/ruby extconf.rb
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of necessary
libraries and/or headers. Check the mkmf.log file for more details. You may
need configuration options.
Provided configuration options:
--with-opt-dir
--without-opt-dir
--with-opt-include
--without-opt-include=${opt-dir}/include
--with-opt-lib
--without-opt-lib=${opt-dir}/lib
--with-make-prog
--without-make-prog
--srcdir=.
--curdir
--ruby=/Users/Ayman/.rvm/rubies/ruby-2.0.0-p353/bin/ruby
--with-atomic_reference-dir
--without-atomic_reference-dir
--with-atomic_reference-include
--without-atomic_reference-include=${atomic_reference-dir}/include
--with-atomic_reference-lib
--without-atomic_reference-lib=${atomic_reference-dir}/
/Users/Ayman/.rvm/rubies/ruby-2.0.0-p353/lib/ruby/2.0.0/mkmf.rb:434:in `try_do': The compiler failed to generate an executable file. (RuntimeError)
You have to install development tools first.
from /Users/Ayman/.rvm/rubies/ruby-2.0.0-p353/lib/ruby/2.0.0/mkmf.rb:519:in `try_link0'
from /Users/Ayman/.rvm/rubies/ruby-2.0.0-p353/lib/ruby/2.0.0/mkmf.rb:817:in `try_run'
from extconf.rb:26:in `<main>'
Gem files will remain installed in /Users/Ayman/.rvm/gems/ruby-2.0.0-p353/gems/atomic-1.1.14 for inspection.
Results logged to /Users/Ayman/.rvm/gems/ruby-2.0.0-p353/gems/atomic-1.1.14/ext/gem_make.out
Ayman$
I am on the latest version of gems, running ruby 2.0.0, and Mac 10.8.
Any clue on what I am doing wrong?
Update
So I installed Xcode Command Line Tool per the following and am still recieving the following error message:
Ayman$ sudo gem install rails
Building native extensions. This could take a while...
ERROR: Error installing rails:
ERROR: Failed to build gem native extension.
/Users/Ayman/.rvm/rubies/ruby-2.0.0-p353/bin/ruby extconf.rb
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of necessary
libraries and/or headers. Check the mkmf.log file for more details. You may
need configuration options.
Provided configuration options:
--with-opt-dir
--without-opt-dir
--with-opt-include
--without-opt-include=${opt-dir}/include
--with-opt-lib
--without-opt-lib=${opt-dir}/lib
--with-make-prog
--without-make-prog
--srcdir=.
--curdir
--ruby=/Users/Ayman/.rvm/rubies/ruby-2.0.0-p353/bin/ruby
--with-atomic_reference-dir
--without-atomic_reference-dir
--with-atomic_reference-include
--without-atomic_reference-include=${atomic_reference-dir}/include
--with-atomic_reference-lib
--without-atomic_reference-lib=${atomic_reference-dir}/
/Users/Ayman/.rvm/rubies/ruby-2.0.0-p353/lib/ruby/2.0.0/mkmf.rb:434:in `try_do': The compiler failed to generate an executable file. (RuntimeError)
You have to install development tools first.
from /Users/Ayman/.rvm/rubies/ruby-2.0.0-p353/lib/ruby/2.0.0/mkmf.rb:519:in `try_link0'
from /Users/Ayman/.rvm/rubies/ruby-2.0.0-p353/lib/ruby/2.0.0/mkmf.rb:817:in `try_run'
from extconf.rb:26:in `<main>'
Gem files will remain installed in /Users/Ayman/.rvm/rubies/ruby-2.0.0- p353/lib/ruby/gems/2.0.0/gems/atomic-1.1.14 for inspection.
Results logged to /Users/Ayman/.rvm/rubies/ruby-2.0.0- p353/lib/ruby/gems/2.0.0/gems/atomic-1.1.14/ext/gem_make.out
Ayman$
UPDATE TWO
Followed rbenv install below per the following:
Ayman$ brew update
Updated Homebrew from 8e60080c to e7a77f80.
==> Updated Formulae
reposurgeon
Ayman$ brew install rbenv ruby-build
Warning: rbenv-0.4.0 already installed
Warning: ruby-build-20140110.1 already installed
Ayman$ echo 'eval "$(rbenv init - --no-rehash)"' >> ~/.bash_profile
Ayman$ ~/.bash_profile
-bash: /Users/Ayman/.bash_profile: Permission denied
Ayman$ rbenv install 2.1.0
Downloading ruby-2.1.0.tar.gz...
-> http://dqw8nmjcqpjn7.cloudfront.net/9e6386d53f5200a3e7069107405b93f7
Installing ruby-2.1.0...
Installed ruby-2.1.0 to /Users/Ayman/.rbenv/versions/2.1.0
Ayman$ rbenv rehash
Ayman$ rbenv global 2.1.0
Ayman$ gem install rails bundler --no-ri --no-rdoc
ERROR: While executing gem ... (Errno::EACCES)
Permission denied - /Users/Ayman/.rvm/gems/ruby-2.0.0-p353/gems/atomic- 1.1.14/test/test_atomic.rb
I solved the problem.
Turns out I was using an outdated version of gems.
Once I upgraded my gems to the latest version it worked fine.
Thanks everyone!
Try rvmsudo to use your rvm and have root privileges, maybe like this:
rvmsudo gem install rails
EDIT
I meant 'rvmsudo', not 'sudorvm'. Sorry for the mistake, I was on a phone.
There is always rbenv where you can skip all the hassle of sudo and permissions. Everything local to the user. Why rbenv?
brew update
brew install rbenv ruby-build
# if you dont have the init in your profile run the following:
echo 'eval "$(rbenv init - --no-rehash)"' >> ~/.bash_profile
source ~/.bash_profile
# install a ruby
rbenv install 2.1.0
# you need to rehash after installing a ruby version or a global gem
rbenv rehash
# this will set 2.1.0 as your default ruby version in shell
rbenv global 2.1.0
# now try installing rails
gem install rails bundler --no-ri --no-rdoc
rbenv rehash

Error installing geoip_city gem

I keep getting an error when trying to install the geoip_city gem. I've already installed the GeoIP C library to /opt/GeoIP, but the gem doesn't seem to pick it up. I've tried:
sudo gem install geoip_city -- --with-geoip-dir=/opt/GeoIP
sudo gem install geoip_city -- --with-geoip-lib=/opt/GeoIP/lib
sudo gem install geoip_city -- --with-geoip-dir=/opt/GeoIP --with-geoip-lib=/opt/GeoIP/lib
all of which output this error:
Building native extensions. This could take a while...
ERROR: Error installing geoip_city:
ERROR: Failed to build gem native extension.
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby extconf.rb --with-geoip-lib=/opt/GeoIP/lib
checking for GeoIP_record_by_ipnum() in -lGeoIP... no
you must have geoip c library installed!
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of
necessary libraries and/or headers. Check the mkmf.log file for more
details. You may need configuration options.
Provided configuration options:
--with-opt-dir
--without-opt-dir
--with-opt-include
--without-opt-include=${opt-dir}/include
--with-opt-lib
--without-opt-lib=${opt-dir}/lib
--with-make-prog
--without-make-prog
--srcdir=.
--curdir
--ruby=/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby
--with-geoip-dir
--without-geoip-dir
--with-geoip-include
--without-geoip-include=${geoip-dir}/include
--with-geoip-lib=${geoip-dir}/lib
--with-GeoIPlib
--without-GeoIPlib
Gem files will remain installed in /Library/Ruby/Gems/1.8/gems/geoip_city-0.2.0 for inspection.
Results logged to /Library/Ruby/Gems/1.8/gems/geoip_city-0.2.0/gem_make.out
cantorrodista was on the right track, though. I had to run the command like this:
sudo env ARCHFLAGS="-arch i386" gem install geoip_city -- --with-geoip-dir=/opt/GeoIP
I think you have to pass the ARCHFLAGS parameter to indicate that is going to be built for a 64 bit arquitecture:
sudo env ARCHFLAGS="-arch x86_64" gem install geoip_city -- --with-geoip-dir=/opt/GeoIP

Resources