How do you install Jekyll on OSX? - macos

I was following the instructions here, so I ran gem install jekyll on my osx machine, and got the following:
WARNING: Installing to ~/.gem since /Library/Ruby/Gems/1.8 and
/usr/bin aren't both writable.
WARNING: You don't have /Users/erikvold/.gem/ruby/1.8/bin in your PATH,
gem executables will not run.
ERROR: Error installing jekyll:
liquid requires RubyGems version >= 1.3.7
But I don't see instructions on how to deal with this in the instructions above.

Try to update gem first:
$ gem update --system
In case you get permission errors, you must resort to sudo for this and all other gem commands:
$ sudo gem update --system

Related

Howe to install a Plugin for Jekyll with a homebrew install of ruby running on local Mac?

I am running latest MAC OSX with brew. I have installed Ruby with brew install ruby and have successfully installed Jekyll as per instructions. sudo gem install jekyll.
I am unable to get _plugins working and get errors when i try to do install the seo plugin. gem 'jekyll-seo-tag'
I get Unknown command jekyll-seo-tag
How do I get this to work?
Where are you adding gem 'jekyll-seo-tag' to? Based on the error, I guess you're trying to run it as a command:
$ gem 'jekyll-seo-tag'
ERROR: While executing gem ... (Gem::CommandLineError)
Unknown command jekyll-seo-tag
You should add gem 'jekyll-seo-tag to your Gemfile instead:
$ cat Gemfile
source 'https://rubygems.org/'
...
gem 'jekyll-seo-tag'
...
And then to your _config.yml file:
$ cat _config.yml
...
gems:
- jekyll-seo-tag
...
For more information, take a look at the installation instructions:
https://github.com/jekyll/jekyll-seo-tag#installation

Ruby 2.3.0 gem pg version 0.18.4 install error El Capitan

After "bundle install", I keep getting this error for many times.
Errno::EACCES: Permission denied # rb_sysopen - /Users/daisukeishii/tasca- io/vendor/bundle/ruby/2.3.0/gems/pg-0.18.4/.gemtest
An error occurred while installing pg (0.18.4), and Bundler cannot continue.
Make sure that `gem install pg -v '0.18.4'` succeeds before bundling.
gem install pg keeps giving the same error
-ruby 2.3.0p0 (2015-12-25 revision 53290) [x86_64-darwin15]
-psql (PostgreSQL) 9.5.0
-Mac El Capitan
-I checked all related posts in stackoverflow but could not solve this.
Tried to uninstall/install PostgreSQL through brew.
Tried to uninstall/install Ruby
Do you have any idea to solve this?
I had problems installing the pg gem and for me this did the trick:
ARCHFLAGS="-arch x86_64" gem install pg
However, looking at your error message it actually seems to be about not having write permissions to the gem directory. Maybe you have tried to install the gem as root with sudo gem install pg and it left behind a directory under your home directory having root as owner instead of your regular user.
Remove the directory using:
sudo rm -rf /Users/daisukeishii/tascaio/vendor/bundle/ruby/2.3.0/gems/pg-0.18.4
And then try installing again using the ARCHFLAGS above.
Note that your post has some sort of copy paste problem in the path so the path in this example might not be correct.
In my case, the pg gem was looking for a PostgreSQL installation in the wrong place, so I runned
bundle config build.pg --with-pg-config=/usr/local/Cellar/postgresql/9.4.5/bin/pg_config
which was where my PostgreSQL installation actually was, and then
bundle install

ERROR: Error installing jekyll: ERROR: Failed to build gem native extension

My system has:
ruby 2.0.0p451 (2014-02-24) [x64-mingw32]
gem -version 2.2.2
devKit : DevKit-mingw64-64-4.7.2-20130224-1432-sfx.exe
When I try to run gem install jekyll, I get this error:
D:\devKit>gem install jekyll
Temporarily enhancing PATH to include DevKit...
Building native extensions. This could take a while...
ERROR: Error installing jekyll:
ERROR: Failed to build gem native extension.
"D:/Program Files (x86)/Ruby200-x64/bin/ruby.exe" extconf.rb
D:/Program Files (x86)/Ruby200-x64/bin/ruby.exe: invalid switch in RUBYOPT: -F (
RuntimeError)
extconf failed, exit code 1
Gem files will remain installed in D:/Program Files (x86)/Ruby200-x64/lib/ruby/g
ems/2.0.0/gems/fast-stemmer-1.0.2 for inspection.
Results logged to D:/Program Files (x86)/Ruby200-x64/lib/ruby/gems/2.0.0/extensi
ons/x64-mingw32/2.0.0/fast-stemmer-1.0.2/gem_make.out
I got this error while installing Jekyll on Linux (Mint 17, which is based on Ubuntu 14.04).
I eventually found the solution here. I needed both the ruby-dev package and nodejs (the latter due to a bug in Jekyll).
sudo apt-get install ruby ruby-dev make
sudo gem install jekyll --no-rdoc --no-ri
sudo apt-get install nodejs
I ran into this problem too. Running the following installed Jekyll for me:
$ \curl -L https://get.rvm.io | bash -s stable --rails --autolibs=enabled
$ sudo gem install jekyll
This installs RVM, updates Rails and installs Jekyll.
BTW - Most of the posts I've found indicate it's a problem with Xcode not having the developer tools installed. I have a newer MacBook Pro on which this stuff was installed by default, so attempting to install the Xcode dev tools did nothing for me (unlike the above, which did everything I needed).
try
gem update
then
gem install jekyll
And you may want to try with Ruby 1.9.3 and compatible DevKit.

how to update gem command in ubuntu?

my gem version is 1.3.5 and I can't install certain gems because of that.I tried to update the gem on my computer by
sudo update --system
and it gives me an error
ERROR: While executing gem ... (RuntimeError)
gem update --system is disabled on Debian.
RubyGems can be updated using the official
Debian repositories by aptitude or apt-get.
so according to some people, the source need to be downloads and it needs to executed by ruby. i downloaded the file, did
sudo ruby setup.rb
and it gave me
RubyGems 1.8.24 installed
== 1.8.24 / 2012-04-27
1 bug fix:
Install the .pem files properly. Fixes #320
Remove OpenSSL dependency from the http code path
RubyGems installed the following executables:
/usr/bin/gem1.8
but when I hit ruby gem -v it still gives me 1.3.5 rather than the one I installed which is 1.8.
Do I need to uninstall the older version manually? or some other thing I need to do first?
RubyGems installed the following executables: /usr/bin/gem1.8
As the line says, the name of the program is gem1.8, not gem. Ergo, you need to call
gem1.8 -v
not
gem -v
Please try make a symbolic link.
sudo ln -s /usr/bin/gem1.8 /usr/bin/gem

json_pure/rubygems cyclic dependencies

I have an issue when trying to set up rvm, where gems weren't installing due to them being dependent on json_pure. I tried to install json_pure, but rubygems itself seems to depend on json_pure. I have tried removing all versions of json_pure, but rubygems still complains.
$ sudo gem install json_pure
/Library/Ruby/Site/1.8/rubygems.rb:777:in `report_activate_error': Could not find RubyGem json_pure (>= 0) (Gem::LoadError)
I have tried downloading the gem and installing it locally, but rubygems still complains about the dependency.
I had this exact problem, and the above solutions didn't work for me. (I don't use rvm, and re-installing RubyGems didn't resolve the issue.)
This is what I did to fix my setup on my Mac. (Ruby 1.8.6, Mac OS X 10.5.8)
1) Go to http://rubygems.org/gems/json_pure
2) Download the json_pure gem to ~/Downloads
3) cd ~/Downloads/
4) sudo gem install json_pure-1.4.6.gem
(You'll still see the "Could not find RubyGem json_pure" error, but the install does work. To double-check you can redo 'sudo gem install json_pure-1.4.6.gem' and you shouldn't see the error the second time.)
5) Verify that json_pure is now installed:
gem list
I fixed this issue by copying the json and json_pure gems and their specs from a working ruby directory into the .rvm gem directory of the broken ruby. Not sure why rubygems itself ever relies on another gem.
cp -r ~/.rvm/gems/ruby-1.8.7-p249/gems/json* ~/.rvm/gems/ruby-1.8.6-p399/gems/
cp -r ~/.rvm/gems/ruby-1.8.7-p249/specifications/json* ~/.rvm/gems/ruby-1.8.6-p399/specifications/
I can't understand if you are having an issue installing RVM or using RVM.
If you need to install RVM, don't use sudo.
Just type
$ gem install rvm
RubyGems will install it in your home directory.
Then, proceed with rvm-install and follow the instructions.
When using RVM, never use sudo.
This issue came about when I removed all the json-pure versions in my main $PATH. To resolve the issue I reloaded RubyGems 1.3.7 from source and was able to reinstall the json-pure gem. Note: I was not using RVM.
Steps:
1) Download RubyGem 1.3.7.tgz
2) Use these commands at the command prompt
tar xzvf rubygems-1.3.7.tgz
cd rubygems-1.3.7
sudo /opt/local/bin/ruby setup.rb
3) Try a gem command
gem list
4) If it works, install the json-pure gem // might need to install the json gem also.
sudo gem install json
sudo gem install json-pure

Resources