Hey does anyone know what this error message means? I installed ruby from source then proceeded to install rubygems, and then installed rails via gem install rails
After creating a new project, I did a bundle install and got this error:
mark#mark-laptop:~/guide/first_app$ sudo bundle install Fetching
source index for https://rubygems.org/
NoMethodError: private method open' called for Gem::Package:Class An
error occured while installing rake (0.9.2.2), and Bundler cannot
continue. Make sure thatgem install rake -v '0.9.2.2'` succeeds
before bundling.
I did that command (gem install rake -v '0.9.2.2') and it worked fine.. I'm rather confused
Try gem install bundler to install/update bundler after installing/updating rubygems.
It worked for me when I had your problem.
This appears to be a bug in the master branch of rubygems from GitHub. If you grab an archive of 1.8.24 from http://rubygems.org/pages/download instead, everything works fine.
I have rubygems 2.0.3 and I get the same error. I deleted gemfile.lock file in the project. Only change I got in error is
From
Make sure that gem install rake -v '0.9.2.2' succeeds before bundling.
Changed to
Make sure that gem install rake -v '10.0.3' succeeds before bundling.
The new gem install rake also worked for me.
It's possible that you are using different ruby versions and gems when running commands with and without sudo. You can try running
sudo ruby -v
and
ruby -v
In addition you can check for different gem paths
gem env
and
sudo gem env
gem update --system
gem install bundler
Related
I'm trying to set up a ruby project and rather new to the process of automating via bundle. However when I try to execute any bundle command I'm met with the following error:
/usr/local/bin/bundle:26:in `load': cannot load such file -- /usr/lib/ruby/gems/2.3.0/gems/bundler-1.16.1/exe/bundle (LoadError)
from /usr/local/bin/bundle:26:in `<main>'
I have tried removing and reinstalling Ruby, as well as removing the bundler gem itself. But to no avail. My Rubygems version is 2.3.0 and the Ruby version is 2.3.1 which is the latest stable version for Ubuntu
Problem related to bundler==1.16.1 try to reinstall with bundler=1.16.0 for now.
gem uninstall bundler -x
gem install bundler -v 1.16.0 --force
More info and bug report can be found here: https://github.com/bundler/bundler/issues/6227
I was able to uninstall bundler -v '1.16.1' as described by Mr.Coffee, but in gem list it was still listed and marked as default.
I created a symlink then - very hacky, but the only thing which worked for me:
ln -sf /usr/lib/ruby/gems/2.3.0/gems/bundler-1.16.0 /usr/lib/ruby/gems/2.3.0/gems/bundler-1.16.1
The gem requesting bundler works now.
I'm trying to work on a project that uses the mysql2 gem, version 0.3.17 specifically.
I can get this to install by running:
gem install mysql2 -- --with-mysql-dir=C:\mysql\connector -v '0.3.17'
However after doing this (in the projects directory), and then run bundle install, it fails with the message
An error occurred while installing mysql2 (0.3.17), and Bundler cannot continue. Make sure that `gem install mysql2 -v '0.3.17'` succeeds before bundling.
Is there any way to run something like
bundle install -- --with-mysql-dir=C:\mysql\connector -v '0.3.17'
? I'm guessing I would need to specifiy the mysql2 gem in the command but I've looked on http://bundler.io/v1.3/man/bundle-install.1.html and can't seem to find anything.
My other option would be to simply point it to the gem I've already installed if that's possible.
Thanks in advance.
Ruby version: 2.1.5p273
Rails version: 4.2.0
Gem Version: 2.2.2
OS: Windows 7 x64
Hello, I am very very new to rails programming. I am trying to start learning, but cannot because of these problems.
I created a rails app
I type: >rails new app
I then navigate to the created folder
I type: >rails server
It tells me
"Run 'bundle install' to install missing gems."
I do so and it than tells me:
"Make sure that 'gem install debugger-linecache -v '1.2.0' succeeds before bundling'"
after installing said gem I try bundle install again, but it than repeats the same error with a different gem.
""Make sure that 'gem install *random gem* -v '*random version*' succeeds before bundling'""
I hardly have any idea what I'm doing here. How can I get this server running?
i started to write an answer, and then saw you comment,
but for everyone out there who need an answer and didn't notice your comment:
Try this,
first run:
bundle update
and then try to bundle install
if its not working, install bundler:
gem install bundler
and now run bundle install
Solved by using the following two commands: gem update --system gem install bundler
while installing therubyracer along with Ruby 2.0.0.p0 and Rails 4.0, i get the following error
ERROR: While executing gem ... (NoMethodError)
undefined method `size' for nil:NilClass
If I install same gem in using bundle install then I get dependent gem error see below log.
NoMethodError: undefined method `size' for nil:NilClass
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.
Please find the link for GIT which i was trying to install
https://github.com/niquola/angularjs-on-rails
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.
I've been following the railscast on setting up Vagrant with rails found here:
http://railscasts.com/episodes/292-virtual-machines-with-vagrant
I have rbenv running on vagrant with a slightly more updated version of ruby(1.9.3p125). Everything goes fine until I try to bundle. Here's the error I get:
vagrant#lucid32:/vagrant$ bundle
Fetching gem metadata from http:rubygems...
Fetching gem metadata from http:rubygems...
Resolving dependencies...
Using rake (10.0.3)
Errno::EPROTO: Protocol error - /vagrant/bin
An error occurred while installing rake (10.0.3), and Bundler cannot continue.
Make sure that gem install rake -v '10.0.3' succeeds before bundling.
I've tried gem installing that version of rake, then running rbenv rehash which seems to install, but running bundle again still gives me the same error.
I was able to resolve this by downgrading bundler from 1.3.2 to 1.2.5.
rvm use #global
gem uninstall bundler
gem install bundler -v 1.2.5
# switch back to the default gemset
rvm use
bundle install
# everything should work now
The only other thing that I changed was I reverted from rvm 1.18.19 to 1.17.10, but I am not positive that step is necessary.