Custom Gem Execution Fails with Nomethoderror

Custom Gem execution fails with NoMethodError

It looks like you're running into this issue https://github.com/bundler/bundler/issues/2838

Because Bundler remembers flags passed to install, if you ever ran bundle install --binstubs in the past, it will re-generate the binstubs on subsequent runs of bundle install. You can run bundle config --delete bin to delete that setting and then restore your original executable file.

therubyracer error ERROR: While executing gem ... (NoMethodError) undefined method `size' for nil:NilClass

I ran to the same problem today. And got it solved. I'm using Lubuntu 13.04, RVM and Ruby 1.9.3 instead.

It could be that your platform is not in the supported list of libv8, which is used by rubyracer, and the gem should be compiled by yourself.

Straight from: https://github.com/cowboyd/libv8

Get libv8 source from git, compile it and build gem from:

git clone git://github.com/cowboyd/libv8.git
cd libv8
bundle install
bundle exec rake checkout
bundle exec rake compile
bundle exec rake build

Install gem:

gem install ./pkg/libv8-3.16.14.3.gem

I still got an error when executed "bundle update" on my project folder, because gem didn't seem to be copied to my bundle gem cache.

Bundler::GemspecError: Could not read gem at /home/devmachine/.rvm/gems/ruby-1.9.3-p448/cache/libv8-3.16.14.3.gem. It may be corrupted.
An error occurred while installing libv8 (3.16.14.3), and Bundler cannot continue.
Make sure that `gem install libv8 -v '3.16.14.3'` succeeds before bundling.

So I copied it to this folder before I ran "bundle update" again:

cp /home/devmachine/Downloads/libv8/pkg/libv8-3.16.14.3.gem /home/devmachine/.rvm/gems/ruby-1.9.3-p448/cache

Keep in mind that you should have following packages installed before performing compilation:

  • git
  • git-svn
  • libv8-dev
  • python
  • g++

I hope it helps.

- = Better solution = -

Actually a case of RTFM.

You dont have to build your own gem with native extension. You just have to have v8 library present in your system. After that you can configure bundler to use native v8. For that you should install V8 engine on your system.

# Get Google v8 engine from git
git clone git://github.com/v8/v8.git v8 && cd v8
# Install GYP
make dependencies
# I had problems with warnings and strict aliasing. So I ignored and switched them off.
make native werror=no strictaliasing=off

Now you should be able to use v8 from system:

bundle config build.libv8 --with-system-v8

After this command you can continue using usual "bundle install"..

- = Suggested solution = -

Forget v8 and use Node.js instead:

wget http://nodejs.org/dist/node-latest.tar.gz
tar zxvf node-latest.tar.gz
# cd into extracted directory (e.g. cd node-v0.10.14)
make
make install

Remove "therubyracer" dependency from your project Gemfile.

undefined method `plain_specs' for #Bundler::RubygemsIntegration:0x00005633f09a9000 (NoMethodError)

gem uninstall rubygems-bundler

works for me
I am using bundler 2.1.0

REF: https://github.com/bundler/bundler/issues/7492

When showing

ERROR:  While executing gem ... (Gem::InstallError)
rubygems-bundler is not installed in GEM_HOME, try:
gem uninstall -i /Users/xxxx/.rvm/rubies/ruby-2.5.7/lib/ruby/gems/2.5.0 rubygems-bundler

Please run

gem uninstall -i /Users/xxxx/.rvm/rubies/ruby-2.5.7/lib/ruby/gems/2.5.0 rubygems-bundler

NoMethodError: private method `open' called for Gem::Package:Class An error occurred while installing rake (10.0.3), and Bundler cannot continue

You should first update Rubygems:

gem update --system

And then update Bundler:

gem install bundler

error to installing sass with gem in windows 8.1

This command will fix it -- you need to change the code page of the current terminal.

chcp 1252

Fastlane NoMethodError

There is an open issue for this bug. The issue occurs when you run fastlane without any additional command-line arguments. There are two temporary workarounds:

  1. Enable verbose mode: bundle exec fastlane --verbose
  2. Specify a lane name: bundle exec fastlane my_lane_name

Alternatively, you can downgrade to an earlier version of fastlane.



Related Topics



Leave a reply



Submit