Rvm + Rails Install Error: While Executing Gem (Nomethoderror)Undefined Method 'Ord' for Nil:Nilclass

rvm + rails install ERROR: While executing gem (NoMethodError)undefined method `ord' for nil:NilClass

I am answering and accepting this question because someone may get help from this.

After investigating few days ( googling, creating new issue in rvm) I have found that it is a Ruby bug was fixed here

I had to upgrade ruby version to 2.1.7 to solve this issue.

You can get details from rvm issue tracker.

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.

Error when run gem install rails

Thanks to all for your help.

At last this problem is solved, when I update my computer using Ubuntu Update Manager.

I don't know why solved the problem after updates. But I am sure it is solved by Updating all.


Specially thanks to majioa.

Problems installing Ruby/Rails, even with RVM

Before you blow out the system I'd:

  1. Uninstall rvm (rvm implode, gem uninstall rvm) see this question
  2. You should be left with just the base ruby. That should be the only one left.
  3. Re-install rvm (\curl -L https://get.rvm.io without Rails).
  4. Install the ruby version you want with rvm (rvm install 1.9.2) stay away from 2.0 for now.
  5. Make sure your ruby version is installed and selected.
  6. Install the rails version you want.

Hopefully that will straighten things out.

rvm deafult ruby version working other version not working

I am answering and accepting this question because someone may get help from this.

After investigating I have found that it is a Ruby bug was fixed here

I had to upgrade ruby version to 2.1.7 to solve this issue.

You can get details from rvm issue tracker.



Related Topics



Leave a reply



Submit