I'm having a strange rake error when I try to install, here is what it says
$ rake bundle_install
/usr/local/bin/rake:23:in `load': cannot load such file -- /usr/share/rubygems-integration/1.9.1/gems/rake-10.0.4/bin/rake (LoadError)
from /usr/local/bin/rake:23:in `<main>'
When I try to navigate to the directory, i find nothing:
$ ls /usr/share/rubygems-integration/1.9.1/
specifications/
Ruby versions:
$ ruby -v
ruby 1.9.3p484 (2013-11-22 revision 43786) [x86_64-linux]
Why it's trying to load the wrong version and how I could fix this?
you can try:
bundle update rake
the same issue was resolved here: Ruby rake loaderror - bundle exec rake not working
Look for the gemspec file.
Your version of rake specified at the gemspec file must match the rake version you are using.
Try: bundle update rake. This will install a new version of rake. Open your gemspec file and update the rake version.
I had this:
spec.add_development_dependency "rake", "~> 10.0"
And I have changed to:
spec.add_development_dependency "rake", "~> 11.0"
run bundle update rake again:
Resolving dependencies...
Using rake 11.3.0 (was 10.5.0)
After that, it will work.
It seems that you need to re-install ruby..Hopefully that might solve the problem.Had faced this issue previously.Resolved by reinstalling ruby.
Perhaps it helps somebody. I had same error, but with rails, instead of rake.
I have got such error while installing redmine.
$ sudo bundle exec rails server webrick -e production
bundler: failed to load command: rails (/usr/local/bin/rails)
LoadError: cannot load such file -- /usr/share/rubygems-integration/all/specifications/bin/rails
/usr/local/bin/rails:23:in `load'
/usr/local/bin/rails:23:in `<top (required)>'
This is my solution:
$ sudo bundle update rails
This should work in the latest version.
# Rakefile.rb
require 'bugsnag/integrations/rake'
Related
Whenever I try to deploy my system the following error occurs:
root#:/var/www/code# bundle exec rake assets:precompile db:migrate RAILS_ENV=production
rake aborted!
LoadError: incompatible library version - /var/www/code/vendor/bundle/ruby/2.3.0/gems/nokogiri-1.6.8/lib/nokogiri/nokogiri.so
/var/www/code/vendor/bundle/ruby/2.3.0/gems/nokogiri-1.6.8/lib/nokogiri.rb:32:in `require'
I tried to make an update on all gems:
gem update
And I followed the "Incompatible library version on Ubuntu 16.04" issue, but yet it doesn't work.
Why does this happen?
I circled the uninstallation and installation code at the root of the project:
root#:/var/www/code# gem uninstall nokogiri
And then:
root#:/var/www/code# gem install nokogiri
My gem list shows:
root#:/var/www/code# gem list
- nokogiri (1.7.1)
But when I try to compile it appears again:
/code/vendor/bundle/ruby/2.3.0/gems/nokogiri-1.6.8/lib/nokogiri/nokogiri.so
Should I accomplish this within the gems/ folder?
I want to deploy rails app to linode cloud server. I installed ubuntu 14.04 LTS and installed ruby 2.3.0 by rvm and also installed passenger with apache2. Then I cloned my app from bitbucket and try to bundle on it but i can't. It says like this....
/usr/local/rvm/rubies/ruby-2.3.0/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require': cannot load such file -- bundler (LoadError)
from /usr/local/rvm/rubies/ruby-2.3.0/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from /usr/bin/bundle:7:in `<main>'
Actually I forgot to install rails. After installing rails it is resolved automatically.
gem install rails
You can simply recheck if you have ran
rvm use 'your ruby version'
then run
gem install bundler
that's it .
I think you don't have install bundler, I had almost precisely the same error, and was able to completely fix it simply by running:
gem install bundler
works for me :
bundle exec rake rails:update:bin
or, in RAILS 5+
rails app:update:bin
I am working on Rails 2.2.2 application. For this I installed rvm with Ruby version 1.9.3p551. There is no Gemfile for this application. So as mentioned in the environment.rb file I created a Gemfile with rails and sqlite3. While running rake db:create, I am facing the following issue.
whoami#myvm:~/Desktop/practice/store$ rake db:create
/home/whoami/.rvm/gems/ruby-1.9.3-p551/bin/rake:22:in `<main>': undefined method `activate_bin_path' for Gem:Module (NoMethodError)
from /home/whoami/.rvm/gems/ruby-1.9.3-p551/bin/ruby_executable_hooks:15:in `eval'
from /home/whoami/.rvm/gems/ruby-1.9.3-p551/bin/ruby_executable_hooks:15:in `<main>'
Please help me.
For me, (I am working with RVM) it worked just running:
gem update --system
gem update bundler
Have you tried these commands
Rename /usr/lib/ruby/site_ruby/ to site_ruby.bak/
Run the following commands:
gem install rubygems-update
enter code here
update_rubygems
If you get error then try the following instead:
ruby --disable-gems -S update_rubygems
I had a similar issue, when running the standalone passenger, it worked fine. However, running it using a systemd service gave the same error as the OP:
undefined method `activate_bin_path' for Gem:Module (NoMethodError)
I've managed to solve it using
env | egrep 'gem|rvm|ruby' > passenger.env
and adding it to the service file using EnvironmentFile=[...]/passenger.env.
Hopefully, this will be useful for other people stuck on this.
This normally occurs when you have multiple versions of RVM and gem sets and its normally comes for ruby 2.2.2 the best way to get rid of this ERROR is.
First Update your system gems by using the following
gem update --system
OR
update_rubygems --system
Then you have to update your bundler:
gem update bundler
Try run through the bundle
cd myapp
gem install bundler
bundle install
bundle exec rake db:create
I faced with the following problem:
I update my OS X to Yosemite, switched to ruby 2.2.2 and decided to come back to my Octopress-based blog. Below I try to describe all my actions one by one, will be glad if someone tell me where I did something wrong.
So I cloned my page from github , checkout to source branch. But when I try to execute any rake command I get error:
rbenv: version `1.9.3-p194' is not installed
rbenv: version `1.9.3-p194' is not installed
I did:
> rbenv local --unset
> rake reharsh --trace
rake aborted!
LoadError: cannot load such file -- bundler/setup
MYPATH/Rakefile:2:in `<top (required)>'
Thus I install bundler:
> gem install bundler
> bundle install
Fetching gem metadata from http://rubygems.org/...........
Fetching version metadata from http://rubygems.org/...
Fetching dependency metadata from http://rubygems.org/..
Installing rake 0.9.2.2
etc
Finally:
> rake generate --trace
rake aborted!
Gem::LoadError: You have already activated rake 10.4.2, but your Gemfile requires rake 0.9.2.2. Prepending `bundle exec` to your command may solve this.
UPD: Following advices of K M Rakibul Islam, I changed in the gemfile rake version from 0.9.2 to 10.4 and added line gem 'iconv' to the gem file. After that rake generate start working.
As the error message suggests, you should run the rake command using bundle exec in order to run it in the context of your Gemfile:
bundle exec rake generate --trace
This should fix your issue.
Update
change this: gem 'rake', '~> 0.9.2' to gem 'rake', '~> 10.4.2' in your Gemfile and run: bundle install.
when I uninstalled bundler 1.6.2 to use 1.0.0 rails crashed. I tried this command:
gem uninstall -i /home/mayukh/.rvm/gems/ruby-1.9.2-p320#global bundler -v=1.6.2
Please note, I have uninstalled this globally
Now, when I run rails -v or rails s it shows error like this:
<internal:lib/rubygems/custom_require>:29:in `require': no such file to load -- rails/cli (LoadError)
from <internal:lib/rubygems/custom_require>:29:in `require'
from /usr/bin/rails:7:in `<main>'
My ruby version is ruby 1.9.2p320 (2012-04-20 revision 35421) [x86_64-linux]
Is it the right way to use/uninstall bundler? or is there any way to switch between bundlers?
How to fix this issue and run rails again?
Uninstall bundle might not be the better solution. If you want to force the bundle version to install something try this (as said in this post) :
bundle _1.0.0_ install
But for you current problem, you should do what tadman said. Uninstall all bundle instances and get the lastest one to force the version after.
Hope this help !