I'm trying to install Jekyll via RubyGems on macOS 10.11.6 (15G1611), but getting a permission error. Unable to sudo chmod to change it (SIP locked directory...)
$ install jekyll
ERROR: While executing gem ... (Gem::FilePermissionError)
You don't have write permissions for the /usr/bin directory.
Install jekyll system wide with sudo.
sudo gem install jekyll
Or create a sandboxed instance with bundler:
bundle init
edit Gemfile with this:
source "https://rubygems.org"
gem "jekyll"
and install it:
bundle install --path vendor/bundle
Related
Everything was working fine before I updated to High Sierra, now jekyll won't run. I uninstalled jekyll, made sure ruby was updated using brew (says ruby 2.4.2_1 is already installed) and and then tried to reinstall jekyll. this is the error I get from the command line.
Last login: Sat Dec 9 20:15:25 on ttys000
Wills-MBP:~ Will$ sudo gem uninstall jekyll
Password:
Gem 'jekyll' is not installed
Wills-MBP:~ Will$ gem install bundle
Fetching: bundle-0.0.1.gem (100%)
Successfully installed bundle-0.0.1
Parsing documentation for bundle-0.0.1
Installing ri documentation for bundle-0.0.1
Done installing documentation for bundle after 0 seconds
1 gem installed
Wills-MBP:~ Will$ gem install jekyll
ERROR: While executing gem ... (Errno::EACCES)
Permission denied # rb_sysopen -
/Library/Ruby/Gems/2.3.0/gems/jekyll-3.6.2/.rubocop.yml
Wills-MBP:~ Will$ sudo gem install jekyll
ERROR: While executing gem ... (Gem::FilePermissionError)
You don't have write permissions for the /usr/bin directory.
Wills-MBP:~ Will$ sudo gem install jekyll bundler
ERROR: While executing gem ... (Gem::FilePermissionError)
You don't have write permissions for the /usr/bin directory.
Wills-MBP:~ Will$ gem update --system
Updating rubygems-update
ERROR: While executing gem ... (Gem::FilePermissionError)
You don't have write permissions for the /usr/bin directory.
Wills-MBP:~ Will$
I have located the files in question but I cannot give myself write permission with the security features of the OS.
So as of right now, jekyll is not installed, I just want to re-install it and get everything up and running again.
Does anyone know how to fix this?
**Quick note, here is what I get when I run these commands...
Wills-MBP:~ Will$ which ruby
/usr/bin/ruby
Wills-MBP:~ Will$ which gem
/usr/bin/gem
So I guess this means its getting pointed to my system, instead of /usr/local. How do I change this?
I figured it out! I found my answer here. https://www.moncefbelyamani.com/how-to-install-xcode-homebrew-git-rvm-ruby-on-mac/#laptop-script
While following the steps listed I ran the command
brew doctor
this gave me the error "Warning: /usr/bin occurs before /usr/local/bin"
so I ran the command provided by the troubleshooting guide https://www.moncefbelyamani.com/how-to-install-xcode-homebrew-git-rvm-ruby-on-mac/#troubleshoot-brew
echo 'export PATH="/usr/local/bin:$PATH"' >> ~/.bash_profile
make sure you quit terminal and restart it.
After that I did not follow any more steps in the guide, simply ran
gem install jekyll bundler
everything installed correctly and it's good to go!
I had the same system error after updating to Mac OSX High Sierra (10.13.4; though I don't know that the update is related)
Permission denied # rb_sysopen
and found that running:
sudo gem install jekyll
then entering your password, would finish the Jekyll install.
Credit to this solution goes to Alexander Davison at TeamTreeHouse.com
I have a problems to run the bundle install on my PC. The return is:
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.
current directory: /tmp/bundler20170309-28068-jc2jotsqlite3-1.3.13/gems/sqlite3-1.3.13/ext/sqlite3
/usr/bin/ruby2.3 -r ./siteconf20170309-28068-19m0tjz.rb extconf.rb
mkmf.rb can't find header files for ruby at /usr/lib/ruby/include/ruby.h
extconf failed, exit code 1
Gem files will remain installed in /tmp/bundler20170309-28068-jc2jotsqlite3-1.3.13/gems/sqlite3-1.3.13 for inspection.
Results logged to /tmp/bundler20170309-28068-jc2jotsqlite3-1.3.13/extensions/x86_64-linux/2.3.0/sqlite3-1.3.13/gem_make.out
Using turbolinks-source 5.0.0
An error occurred while installing json (1.8.6), and Bundler cannot continue.
Make sure that gem install json -v '1.8.6' succeeds before bundling.
I try run gem install json -v '1.8.6' but it did not work.
Can someone help me?
Sorry my english.
On RedHat 7 (ec2 image provided by AWS), I'm unable to install the json gem:
Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.
/usr/bin/ruby extconf.rb
mkmf.rb can't find header files for ruby at /usr/share/include/ruby.h
I've tried all manner of packages libyaml-devel etc and nothing seems to work.
I've already run through:
Error while installing json gem 'mkmf.rb can't find header files for ruby'
sudo rpm -Uvh ftp://195.220.108.108/linux/centos/7.0.1406/os/x86_64/Packages/ruby-devel-2.0.0.353-20.el7.x86_64.rpm
This seemed to fix it since sudo yum ruby-devel doesn't work.
rhel tucks things like this away in the 'optional' repo... you can enable this for aws/ec2 supplied images in:
/etc/yum.repos.d/redhat-rhui.repo
[rhui-REGION-rhel-server-optional]
name=Red Hat Enterprise Linux Server 7 Optional (RPMs)
mirrorlist=https://rhui2-cds01.REGION.aws.ce.redhat.com/pulp/mirror/content/dist/rhel/rhui/server/7/$relea$
**enabled=1**
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release
sslverify=1
sslclientkey=/etc/pki/rhui/content-rhel7.key
sslclientcert=/etc/pki/rhui/product/content-rhel7.crt
sslcacert=/etc/pki/rhui/cdn.redhat.com-chain.crt
Or just do a one-time install:
yum install ruby-devel --enablerepo=rhui-REGION-rhel-server-optional
And if you are using subscription-manager:
subscription-manager repos --enable=rhel-7-server-optional-rpms
Then: sudo yum install -y ruby-devel
I am attempting to install radiant cms, when I try and run bundle exec rake db:bootstrap I get the following output. Now I chose mysql as my database but Im not sure if it is setup properly or not to connect. Sorry If it sounds like I dont know what Im talking about this is still somewhat new to me.
Gem.source_index called from /Users/anderskitson/.rbenv/versions/1.9.3-p374/lib/ruby/gems/1.9.1/gems/rails-2.3.18/lib/rails/gem_dependency.rb:21.
rake aborted!
uninitialized constant MysqlCompat::MysqlRes
/Users/anderskitson/Sites/Bray Jorstad/config/environment.rb:14:in `<top (required)>'
Tasks: TOP => db:bootstrap => db:initialize => environment
(See full trace by running task with --trace)
install rvm bash -s stable < <(curl -s
https://raw.github.com/wayneeseguin/rvm/master/binscripts/rvm-installer)
setup rvm echo '[[ -s "$HOME/.rvm/scripts/rvm" ]] && source
"$HOME/.rvm/scripts/rvm"' >> ~/.bash_profile source ~/.bash_profile
download & install Xcode open
https://developer.apple.com/downloads/download.action?path=Developer_Tools/xcode_4.1_for_lion/xcode_4.1_for_lion.dmg
open ~/Downloads/xcode_4.1_for_lion.dmg open "/Volumes/Install
Xcode/InstallXcodeLion.pkg"
install ruby & rubygems rvm install 1.9.3 # or 1.9.2 or 1.8.7
setup an isolated environment for your project rvm use --create
1.9.3#project-name
install radiant gem install radiant --pre --no-ri --no-rdoc #
installs Radiant 1.0 RC4
create a new radiant project radiant ~/project-name cd
~/project-name bundle install bundle exec rake db:bootstrap
install optional clipped dependencies brew install ghostscript
imagemagick # or port install ... brew install --use-gcc ffmpeg #
or port install ffmpeg
start your new radiant app bundle exec script/server
Courtesy of:
https://github.com/radiant/radiant/wiki/Installing-on-Mac-OS-X
I did this today (22/05/13) in OSX (10.7.5) and everything worked fine. Just don't fiddle with your gem file. Keep your database as sqlite3 when developing, or at least until you get everything working.
Good luck!
how to make the ruby on rails with mysql environment in ubuntu 11.04.
I use the
sudo apt-get install ruby
sudo apt-get install mysql-server
Then I try
gem install rails
But I do not know to to install the mysql adapter?
Is there a document which I can follow?
Update:
Now,I install the gems use
gem install rails.
There are no errors.
However when I run
rails -v
I got 'rails' is not installed,you can typing sudo apt-get install rails
However when I change to the rails bin directory,and use the ruby to run the rails script,I can get the version:
xx#mac:/$ rails -v
The program 'rails' is currently not installed. You can install it by typing:
sudo apt-get install rails
xx#mac:/$ cd /var/lib/gems/1.8/bin/
xx#mac:/var/lib/gems/1.8/bin$ ruby rails -v
Rails 3.2.1
xx#mac:/var/lib/gems/1.8/bin$
So,it seems that this is caused that the 'rails' can not be run directly,how to fix it?
You'd better use RVM to manage your Rubies and Gems instead of the distro's Ruby.
See RVM documentation : http://www.beginrescueend.com/rvm/basics/
As soon as you have RVM and a Ruby interpreter installed, install the rails gem (with MRI 1.9.2 and a gemset called "your_gemset") :
rvm use 1.9.2
rvm gemset use your_gemset
gem install rails
Generate your Rails project, then update the Gemfile (in your project directory) : remove the sqlite3 adapter entry and replace it with the mysql2 adapter :
# Gemfile
# gem 'sqlite3'
gem 'mysql2'
Finally, edit your database.yml file with your MySQL configuration.
You may need to include dependencies:
gem install rails --include-dependencies
The following link is a good resource.
http://www.tutorialspoint.com/ruby-on-rails/rails-database-setup.htm