An error occurred while installing coffee-script-source (1.7.0), and Bundler cannot
continue.
Make sure that gem install coffee-script-source -v '1.7.0' succeeds before bundling.
After gem install coffee-script-source -v '1.7.0'
ERROR: While executing gem ... (Gem::FilePermissionError)
You don't have write permissions for the /Library/Ruby/Gems/2.0.0 directory.
I think I just solve it.
The entire information the terminal returns when asking me to input password was:
Your user account isn't allowed to install to the system Rubygems.
You can cancel this installation and run:
bundle install --path vendor/bundle
to install the gems into ./vendor/bundle/, or you can enter your password
and install the bundled gems to Rubygems using sudo.
I is the password method that doesn't work but things got fixed after typing bundle install --path vendor/bundle.
Related
nokogiri install failure
What I want
Install ruby on rails
error
Gemfile is done, and I want to install rails.
Obaying the document, bundle install --path=vendor/bundle
but
An error occurred while installing nokogiri (1.10.3),
and Bundler cannot continue. The error is here.
Make sure that `gem install nokogiri -v '1.10.3'
--source 'https://rubygems.org/'` succeeds before bundling.
answer
I searched google for the error message, then find
[incompatible-library-version]
(Incompatible library version: nokogiri.bundle requires version 11.0.0 or later, but libxml2.2.dylib)
sudo gem uninstall nokogiri
gem uninstall nokogiri
sudo gem uninstall nokogiri
I obaied the command but it cause new error:
Permission denied # rb_sysopen - /usr/local/lib/ruby/gems/2.6.0/gems/nokogiri-1.10.3/LICENSE-DEPENDENCIES.md
There 1614 lines dependencies document,
but I cannot find out what to do next.
Please help me (><)
Try
sudo chown -R $USER /usr/local/lib/ruby
And bundle install again or gem install again and netter not use sudo on gem install
I am new to Rails , I ran bundler as root by mistake & now it is not working correctly. I tried to use gem uninstall bundler then gem install bundler but still it is not fixed.
How to make bundler work again for non root users (after mistakenly using it with root)?
Note:
I have installed and use rbenv, but after installing some gems on the system directly
The error that happens is that bundle doctor shows correct missing gems but sudo bundle doctor doesn't as shown below
~/my_ruby_projects/myblog3$ bundle doctor
The latest bundler is 1.16.0.pre.1, but you are currently running 1.15.4.
To update, run `gem install bundler --pre`
The following gems are missing
* execjs (2.7.0)
* coffee-script (2.4.1)
* coffee-rails (4.2.2)
* font-awesome-rails (4.7.0.2)
* temple (0.8.0)
using sudo
~/my_ruby_projects/myblog3$ sudo bundle doctor
The latest bundler is 1.16.0.pre.1, but you are currently running 1.15.4.
To update, run gem install bundler --pre
The Gemfile's dependencies are satisfied
No issues found with the installed bundle
Thanks for your help
update:
I knew that bundle with sudo is correct since it gave the real gems that rails tells me they are missing , if I use bundle install without sudo it gives error as below (even if change it to chmod 777)
~/my_ruby_projects/myblog3$ bundle install
The latest bundler is 1.16.0.pre.1, but you are currently running 1.15.4.
To update, run `gem install bundler --pre`
There was an error while trying to write to `/home/usrname/.bundle/cache/compact_index/rubygems.org.443.29b0360b937aa4d161703e6160654e47/versions`. It is likely that you
need to grant write permissions for that path.
for sudo bundle install it says all is installed but then rails throws error that I need to install gems (which bundle doctor gave without sudo)
/my_ruby_projects/myblog3$ sudo bundle install
The latest bundler is 1.16.0.pre.1, but you are currently running 1.15.4.
To update, run `gem install bundler --pre`
Don't run Bundler as root. Bundler can ask for sudo if it is needed, and installing your bundle as root will break this application for all non-root users on this machine.
Using rake 12.0.0
Using concurrent-ruby 1.0.5
# many other gems
Using redis-rails 5.0.2
Using rails_admin 1.2.0
Bundle complete! 30 Gemfile dependencies, 98 gems now installed.
Use `bundle info [gemname]` to see where a bundled gem is installed.
Update 2:
rails s was giving error that gem files are missing
but **sudo** rails s worked without errors
You should try changing the owner and setting the correct permissions for your ~/.bundle.
Try:
sudo chown -R <youruser> ~/.bundle
Followed by:
sudo chmod -R 655 ~/.bundle
I am trying to install a ruby project, which has a dependency like in Gemfile
nokogiri (1.6.1)
bundlr fails
An error occurred while installing nokogiri (1.6.1), and Bundler cannot continue.
Make sure that `gem install nokogiri -v '1.6.1'` succeeds before bundling.
I followed the instructions to install nokogiri manually and succeeded (OSX 10.9.2)
which nokogiri
/usr/bin/nokogiri
nokogiri
Nokogiri: an HTML, XML, SAX, and Reader parser
Usage: nokogiri <uri|path> [options] ...
but, how can I install nokogiri to the expected path by the app (vendor/bundle , like the other dependencies, not in system folder). I tried an option --path vendor/bundle with gem install, but it is not recognized
ERROR: While executing gem ... (Gem::FilePermissionError)
You don't have write permissions for the /Library/Ruby/Gems/2.0.0 directory.
I am running gem install as another user, that is why no permission to write to system folder. still, it is not trying to install at vendor/bundle.
It is also ok if I can find a way to use bundle (instead of gem) to install nokogiri. But, I am not sure how to specify the dependencies like the installation command below.
gem install nokogiri -- --with-xml2-include=/usr/local/Cellar/libxml2/2.7.8/include/libxml2
--with-xml2-lib=/usr/local/Cellar/libxml2/2.7.8/lib
--with-xslt-dir=/usr/local/Cellar/libxslt/1.1.26
--with-iconv-include=/usr/local/Cellar/libiconv/1.13.1/include
--with-iconv-lib=/usr/local/Cellar/libiconv/1.13.1/lib
Try to create config for bundler in ~/.bundle/config:
BUNDLE_PATH: ./vendor/bundle
BUNDLE_BUILD__NOKOGIRI: --with-xml2-include=/usr/local/Cellar/libxml2/2.7.8/include/libxml2
--with-xml2-lib=/usr/local/Cellar/libxml2/2.7.8/lib
--with-xslt-dir=/usr/local/Cellar/libxslt/1.1.26
--with-iconv-include=/usr/local/Cellar/libiconv/1.13.1/include
--with-iconv-lib=/usr/local/Cellar/libiconv/1.13.1/lib
and after bundle install --path vendor/bundle.
On Mac I have tried the following and it worked.
bundle config build.nokogiri --use-system-libraries
bundle install --path vendor/bundle
I am attempting to deploy a site on a commercial hosting service. (JustHost.com)
I am having the following issue running bundle
# bundle
Fetching gem metadata from https://rubygems.org/........
Fetching gem metadata from https://rubygems.org/..
sudo: unable to stat /etc/sudoers: No such file or directory
sudo: no valid sudoers sources found, quitting
sudo: unable to initialize policy plugin
Gem::Exception: Cannot load gem at [/usr/lib64/ruby/gems/1.9.3/cache/rake-10.3.0.gem] in /home5/<username>/<sitename>
An error occurred while installing rake (10.3.0), and Bundler cannot continue.
Make sure that `gem install rake -v '10.3.0'` succeeds before bundling.
I am able to successfully run the gem install command:
# gem install rake -v '10.3.0'
Successfully installed rake-10.3.0
1 gem installed
Installing ri documentation for rake-10.3.0...
Installing RDoc documentation for rake-10.3.0...
But I get the same error re-running bundle. Furthermore, I don't think I was actually able to install rake - its location is not writable by me and the version is unchanged:
# which rake
/usr/bin/rake
# rake --version
rake, version 0.9.2.2
I also tried updating my Gemfile to use rake 0.9.2.2. but ran into the same issue:
# bundle
Fetching gem metadata from https://rubygems.org/........
Fetching gem metadata from https://rubygems.org/..
sudo: unable to stat /etc/sudoers: No such file or directory
sudo: no valid sudoers sources found, quitting
sudo: unable to initialize policy plugin
Gem::Exception: Cannot load gem at [/usr/lib64/ruby/gems/1.9.3/cache/rake-0.9.2.2.gem] in /home5/<username>/<sitename>
An error occurred while installing rake (0.9.2.2), and Bundler cannot continue.
Make sure that `gem install rake -v '0.9.2.2'` succeeds before bundling.
Any help appreciated!
What I did to get around this was update the .bashrc file per the instructions here. I also had to setup a javascript runtime so I used gems rubyracer with execjs.
I am getting the following error when I try to run bundle install
Bundler::GemspecError: Could not read gem at /usr/local/rvm/gems/ruby-1.9.3-p484#rails3tutorial/cache/turbolinks-2.1.0.gem. It may be corrupted.
An error occurred while installing turbolinks (2.1.0), and Bundler cannot continue.
Make sure that `gem install turbolinks -v '2.1.0'` succeeds before bundling.
Even if in install the above said gem and rub bundle install it throws a similar error and asks me to make sure an another gem is installed and this goes on and on.
I am using Rails 4.0.2 and ruby 1.9.3p484.
Maybe the file cache got corrupted. Try:
bundle install --no-cache
If this does not work, delete the cache directory and try again:
rm -rf /usr/local/rvm/gems/ruby-1.9.3-p484#rails3tutorial/cache
bundle install
I just had this problem with the bcrypt gem
Fetching gem metadata from https://rubygems.org/...........
Resolving dependencies...
Bundler::GemspecError: Could not read gem at /data/code/mdweb/vendor/bundle/ruby/2.1.0/cache/bcrypt-3.1.7.gem. It may be
corrupted.
An error occurred while installing bcrypt (3.1.7), and Bundler cannot continue.
Make sure that `gem install bcrypt -v '3.1.7'` succeeds before bundling.
The /data/code/mdweb/vendor/bundle/ruby/2.1.0/cache/bcrypt-3.1.7.gem file was 0 bytes; removing this file or using the --no-cache option didn't help.
Using gem install bcrypt -v '3.1.7' did work, so I copied ~/.gem/ruby/2.1.0/cache/bcrypt-3.1.7.gem to /data/code/mdweb/vendor/bundle/ruby/2.1.0/cache/bcrypt-3.1.7.gem and that allowed me to continue. You could also fetch the .gem file from http://rubygems.org if you can't find it on your system.
I suspect there's some sort of connection issue with bundler (but not with gem for some reason); I suspect DNS since there's an unusual long wait before I get an error, but didn't investigate further.