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
In deployment, isolation is a more important default. In addition, the user deploying the application may not have permission to install gems to the system, or the web server may not have permission to read them. As a result, bundle install --deployment installs gems to the vendor/bundle directory in the application.
Install BundlerSelect Tools | Bundler | Install Bundler from the main menu. Press Ctrl twice and execute the gem install bundler command in the invoked popup. Open the RubyMine terminal emulator and execute the gem install bundler command.
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
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With