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:
- Uninstall rvm (
rvm implode
,gem uninstall rvm
) see this question - You should be left with just the base ruby. That should be the only one left.
- Re-install rvm (
\curl -L https://get.rvm.io
without Rails). - Install the ruby version you want with rvm (
rvm install 1.9.2
) stay away from 2.0 for now. - Make sure your ruby version is installed and selected.
- 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
Encrypt Data Bag from Inside of Ruby Without Relying on Knife
Can Ruby Tell If It Is Called from an Interactive Shell or Cron
Rails Form_For Never Invokes the Create Controller Action to Use Redirect_To
Make a Ruby Script with Text Io Double Clickable Executable File
Require Self Made Gem in Jruby Fails After Update to Jruby-1.7.13
Ruby Roo Loaderror: Cannot Load Such File -- Spreadsheet/Note
Compressed Output Differs from Go to Ruby Implementation
Extract Text Between Two Tags Using Regex in Ruby
How to Upgrade My Ruby 1.9.2-P0 to the Latest Patch Level Using Rvm
Listen Error: Unable to Monitor Directories for Changes
Local Server Error After Upgrading Ruby from 1.8.7 to 1.9.2 (With Rails 3.1.1)
Rspec - How to Test Activerecord::Recordnotfound
Why Doesn't This Code Produce the Desired Result
Invalid Route Name, Already in Use: 'Admin_Root' (Argumenterror) - Failed Activeadmin Install