Bundler::GemfileNotFound Error (Mac OSX) - ruby

MacBook-Air:~ bdeely$ gem install bundler
Successfully installed bundler-1.3.5
1 gem installed
Installing ri documentation for bundler-1.3.5...
Installing RDoc documentation for bundler-1.3.5...
MacBook-Air:~ bdeely$ rbenv rehash
MacBook-Air:~ bdeely$ bundle install
Bundler::GemfileNotFound
I keep getting this error "Bundler::GemfileNotFound" even after I have successfully installed bundler.
Does anyone have any idea what might be going on?
For reference, I am following the directions here:
http://octopress.org/docs/setup/

Create Gemfile in your directory.
Bundler is a gem manager. You should point somewhere which gems you need. The place is Gemfile.
Article

The instructions that come with Octopress aren't clear, but the part where you bundle install has to be performed from within the Octopress directory.

You can't skip the first 3 step of cloning octopress:
git clone git://github.com/imathis/octopress.git octopress
cd octopress # If you use RVM, You'll be asked if you trust the .rvmrc file (say yes).
ruby --version # Should report Ruby 1.9.3
After that, your should in octopress folder and there is a Gemfile in it, now you can move on with bundle install

Related

Nokogiri error install

I am currently trying to upgrade an existing app from Rails 4.2.3 to Rails 5.
then I followed this tutorial : http://railsapps.github.io/updating-rails.html
It recommends having RVM as Ruby version manager as well as gemsets manager. I am under windows 10 and because I couldn't find an easy solution to get RVM I have URU instead.
Well, no big deal. I have installed URU as well as another Ruby version enabling Rails 5 (Ruby 2.2.6)
Though, as mentionned below in the tutorial I have also tried to install nokogiri through command prompt:
gem install nokogiri
It failed with the following :
ERROR: While executing gem ... (Errno::EACCES)
Permission denied # rb_sysopen - C:/Ruby22/lib/ruby/gems/2.2.0/gems/nokogiri
-1.6.8.1-x86-mingw32/lib/nokogiri/2.2/nokogiri.so
Well I wasn't really bothered and decided to go on.. Though now every bundle install fails too !! But I dont even have any reference to nokogiri in my gemfile. (It is though in my gemfile.lock but if I try to remove it, I get a corrupt gemfile.lock error)
a bundle show gives the following:
Gems included by the bundle:
Your bundle is locked to nokogiri (1.6.8.1-x86-mingw32), but that version could
not be found in any of the sources listed in your Gemfile. If you haven't
changed sources, that means the author of nokogiri (1.6.8.1-x86-mingw32) has
removed it. You'll need to update your bundle to a different version of nokogiri
(1.6.8.1-x86-mingw32) that hasn't been removed in order to install.
Any easy solution to this ?
Delete your path folder(if it shows) and your Gemfile.lock .
Then place this in your gem file
gem 'nokogiri', '~> 1.6', '>= 1.6.8.1'
After that run bundle install .Remove the nokogiri from your gemfile

gem install with file system as source installs wrong gem

I have just started working with Ruby. I am trying to install a gem with local file system as source.
$gem source
*** CURRENT SOURCES ***
file:///home/fox/shared/
when i try to install 'bundler' gem it actually installs 'bundler-unload' gem as below.
$gem install bundler --bindir /usr/bin --no-ri --no-rdoc
Successfully installed bundler-unload-1.0.2
1 gem installed
the directory contains both the gems by the way.
bundler-unload-1.0.2.gem
bundler-1.10.6.gem
Is there anything that I am missing here. Why would it install the wrong gem?
I debugged the gem installer code and found the following.
First, the gem installer looks at the current directory to find the gems. It looks for *. It finds two gems (since i was running from the gems source directory) but sorts and reverse orders it and chooses the first one which is not the right gem. It does not do version check also when looking at the local directory. To workaround this i gave 'gem install bundler-1.10.6' which is working. By the way if i run 'gem install' from some other directory it is not able to find any gems from the 'file:' source.

How to solve "/usr/bin/env: ruby_executable_hooks: No such file or directory"?

I just deploy jekyll in a vps, and config git post-receive hook on it. When I push blog update to vps from my laptop, I run into this error:
remote: /usr/bin/env: ruby_executable_hooks: No such file or directory
I searched for a while, and tried the method proposed in this post: bundle update: env: ruby_executable_hooks: No such file or directory, i.e., executing the commands below:
rvm #global do gem regenerate_binstubs
gem regenerate_binstubs
But it doesn't help, the error remains. Since I'm not familiar with rvm or ruby, could anyone give me a hint?
use wrappers, example:
$ which jekyll
# /path/to/rvm/gems/ruby-version/bin/jekyll
in the returned path replace bin with wrappers so you get:
/path/to/rvm/gems/ruby-version/wrappers/jekyll
this is a script that will load proper environment and fix your problem, wrappers are generated automatically withing RVM.
You need to refresh the executable-hooks to the latest version by running following command in the Terminal:
sudo gem install --user-install executable-hooks
I had the same problem, but I have bundler, not rubygems-bundler, and my gem doesn't recognise regenerate_binstubs.
rvm all-gemsets do gem update bundler installed bundler 1.7.11 and fixed it for me.
Updating ruby gems worked for me
gem install rubygems-update
update_rubygems
faslane env: ruby_executable_hooks: No such file or directory
re-install faslane
sudo gem install fastlane -NV

Build binary Ruby 2 gems

In our production environment, we are forbidden from having compilers installed (don't ask). Back in the Ruby 1.8.7 days, we would use gem-compile to compile binary gems on a dev workstation and put the binary gem out in our repository. Is anybody aware of any similar methods that work with Ruby 2.0? I know RVM is capable of building custom packages of rubies that can be deployed, but I can't find any way to make it work with gems.
I'd like to come up with something a little less brittle than building everything on a dev box and rsync'ing the entire rvm directory over to the server.
Thanks!
check this part of rvm offline installation - http://rvm.io/rvm/offline#installing-gems :
Online
Create a (fake) project directory: mkdir gems; cd gems
Install bundler: gem install bundler
Create Gemfile: bundle init
Add rails to it: echo "gem 'rails'" >> Gemfile
Install all gems: bundle install
Get gem files: bundle package
Package project: tar czf gems.tgz .
Download bundler from https://rubygems.org/gems/bundler the Download link
Offline
Create a (fake) project directory: mkdir gems; cd gems
Unpack gems: tar xzf gems.tgz
Install bundler: gem install bundler-1.2.1.gem
Install gems: bundle install --local
Nevermind, I found the answer. There is a newer gem called gem-compiler from https://github.com/luislavena/gem-compiler that works with Ruby 2. I didn't think it was working because I inadvertently still had an old copy of gem-compile installed and that was getting executed when I ran 'gem compile'. Anyways, this generates platform specific gems for me that I can install in our production environment.
Cheers and Thanks,
Jason

Bundler::GemfileNotFound whenever I try to run bundle install

I'm working in kali-linux (a linux distro witch is the continuation of Back-Track, based in Ubuntu, just that now is based on Debian wheezy) for some penetration testing. Everything was working just fine, until I decided to update my systems tools. Now whenever I try to run a tool based on ruby, it trows me:
Could not find gem 'ruby-progressbar (>= 1.1.0) ruby' in the gems available on this machine.
Run `bundle install` to install missing gems.
I proceed to run bundle install but then it comes with Bundler::GemfileNotFound error.
Kali use by default ruby, for using gems. The software don't 'require' any other package but ruby seems not-fully-configured/installed for the problem at hand.
$ ruby --version
ruby 1.9.3p194 (2012-04-20 revision 35410) [i486-linux]
$ rvm
bash: rvm: command not found
$ rbenv
bash: rbenv: command not found
I faced the same problem when I was trying to bundle install without realizing that I was not in the project directory. Make sure you're in the current project directory.
to avoid this error you should be at the root of your application and create GemFile and specify all gems needed in there, and run bundle install
The problem was that for some weird motive Ruby didn't detected that bundler was installed, although the package manager says so.
$ apt-cache policy bundler
bundler:
Installed: 1.3.5-2
Candidate: 1.3.5-2
$ bundle --version
Bundler::GemfileNotFound
I simply run gem install bundler then bundler install as root in the tool root path and everything works as charm.
Do you use rvm or rbenv? If so, make sure you are using a particular ruby version.
For rvm, rvm list and look for an indication next to your ruby version. If the correct one is not listed, run rvm install x.y.z. If the correct one is not selected, run rvm use x.y.z
If you want to segregate your gems for a given project, create a gemset. Otherwise, you should be good to go.
Run gem install bundler. You should not have to do this as sudo. This will install bundler in either the Default rvm gemset, or the selected gemset.
Bundler should now be available and can be run using bundle. This is the same as bundle install.
Try this:
sudo ln -s /var/lib/gems/1.8/bin/bundle /bin/bundle
sudo ln -s /var/lib/gems/1.8/bin/bundler /bin/bundler
Worked for me in debian.

Resources