Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Jekyll files and setup basic layouts #1

Merged
merged 3 commits into from
Mar 21, 2017

Conversation

erikjung
Copy link
Contributor

@erikjung erikjung commented Mar 20, 2017

This adds the files generated by jekyll new with modifications to include the CSS from our pattern library (and some config tweaks).

Assuming you have bundle already available, running this should be as simple as:

  • cloning the repo, checking out this branch
  • bundle install
  • jekyll serve

Jekyll requirements: https://jekyllrb.com/docs/installation/#requirements
Ruby installation steps: https://www.ruby-lang.org/en/documentation/installation/#homebrew

Copy link
Member

@gerardo-rodriguez gerardo-rodriguez left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Works great! 👍

@tylersticka
Copy link
Member

tylersticka commented Mar 21, 2017

A couple of notes...

When I run bundle install, I'm told I have to run it with sudo. Not a big deal, just FYI.

Then when I run jekyll serve...

⚡ ~/Repos/pwastats on init-baseline_jekyll_files ✱
→ jekyll serve
Configuration file: /Users/tylersticka/Repos/pwastats/_config.yml
  Dependency Error: Yikes! It looks like you don't have jekyll-feed or one of its dependencies installed. In order to use Jekyll as currently configured, you'll need to install this gem. The full error message from Ruby is: 'cannot load such file -- jekyll-feed' If you run into trouble, you can find helpful resources at http://jekyllrb.com/help/! 
jekyll 3.1.6 | Error:  jekyll-feed

Also, after running bundle install I have an untracked file:

⚡ ~/Repos/pwastats on init-baseline_jekyll_files ✱
→ git status
On branch init-baseline_jekyll_files
Your branch is up-to-date with 'origin/init-baseline_jekyll_files'.
Changes not staged for commit:
  (use "git add <file>..." to update what will be committed)
  (use "git checkout -- <file>..." to discard changes in working directory)

        modified:   Gemfile.lock

no changes added to commit (use "git add" and/or "git commit -a")

@gerardo-rodriguez
Copy link
Member

@tylersticka

When I run bundle install, I'm told I have to run it with sudo. Not a big deal, just FYI.

Meaning, you had to run sudo bundle install? If so...and I'm not 100% positive here...but I recall doing so might cause some sort of gem issues and how they are installed.

I'm still trying to do more research on Google, cause Ruby/gems/stuff, but I found this:

You should never use sudo bundle install. This is because several other steps in bundle install must be performed as the current user:

• Updating your Gemfile.lock
• Updating your vendor/cache, if necessary
• Checking out private git repositories using your user's SSH keys

http://bundler.io/v1.1/man/bundle-install.1.html#SUDO-USAGE

BTW, I'm not trying to pretend like I know what I'm doing FWIW. ¯\_(ツ)_/¯

@tylersticka
Copy link
Member

tylersticka commented Mar 21, 2017

Sorry, @gerardo-rodriguez, I think I misspoke. From the link you included above:

In some cases, that location may not be writable by your Unix user. In that case, bundler will stage everything in a temporary directory, then ask you for your sudo password in order to copy the gems into their system location.

☝️ This is actually what happened. I never ran sudo bundle install.

@gerardo-rodriguez
Copy link
Member

Also, after running bundle install I have an untracked file:

Me too, running git status:

 Gemfile.lock | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Gemfile.lock b/Gemfile.lock
index db1dd9f..d284c0e 100644
--- a/Gemfile.lock
+++ b/Gemfile.lock
@@ -51,7 +51,7 @@ DEPENDENCIES
   tzinfo-data
 
 RUBY VERSION
-   ruby 2.3.2p217
+   ruby 2.3.0p0
 
 BUNDLED WITH
    1.14.6

@gerardo-rodriguez
Copy link
Member

gerardo-rodriguez commented Mar 21, 2017

@tylersticka Out of curiousity, what do you get when you run gem list --local?

My list includes:

jekyll (3.4.2)
jekyll-feed (0.9.1)
jekyll-sass-converter (1.5.0)
jekyll-watch (1.5.0)

@tylersticka
Copy link
Member

@gerardo-rodriguez Mine's way longer...

⚡ ~/Repos/pwastats on init-baseline_jekyll_files ✱
→ gem list --local

*** LOCAL GEMS ***

bigdecimal (1.2.8)
colorator (0.1)
did_you_mean (1.0.0)
ffi (1.9.14)
io-console (0.4.5)
jekyll (3.1.6)
jekyll-sass-converter (1.4.0)
jekyll-watch (1.4.0)
json (1.8.3)
kramdown (1.11.1)
liquid (3.0.6)
listen (3.0.8)
mercenary (0.3.6)
minitest (5.8.3)
net-telnet (0.1.1)
power_assert (0.2.6)
psych (2.0.17)
rake (10.4.2)
rb-fsevent (0.9.7)
rb-inotify (0.9.7)
rdoc (4.2.1)
rouge (1.11.1)
safe_yaml (1.0.4)
sass (3.4.22)
test-unit (3.1.5)

@erikjung
Copy link
Contributor Author

@gerardo-rodriguez @tylersticka The changes to Gemfile.lock make sense: we have different Ruby versions running. Let me see about changing the ruby RUBY_VERSION line in the Gemfile to something explicit.

@erikjung
Copy link
Contributor Author

@gerardo-rodriguez When running gem list --local, is that your whole list?

@erikjung
Copy link
Contributor Author

@tylersticka @gerardo-rodriguez Can you both discard your local changes, pull, then run bundle update --ruby

@gerardo-rodriguez
Copy link
Member

gerardo-rodriguez commented Mar 21, 2017

When running gem list --local, is that your whole list?

@erikjung Nope, it included those new jekyll-* gems, which is the only part I was sharing. Would you like the full list? It's pretty long.

@erikjung
Copy link
Contributor Author

Would you like the full list? It's pretty long.

No, just wanted to verify that you didn't have a mysteriously small list.

@tylersticka
Copy link
Member

@erikjung I discarded local changes, ran git pull, but here's what I get with bundle update --ruby:

⚡ ~/Repos/pwastats on init-baseline_jekyll_files
→ bundle update --ruby
Unknown switches '--ruby'

@erikjung
Copy link
Contributor Author

erikjung commented Mar 21, 2017

@tylersticka bundle -v?

Bundler version 1.14.6

@tylersticka
Copy link
Member

⚡ ~/Repos/pwastats on init-baseline_jekyll_files
→ bundle -v
Bundler version 1.5.3

@erikjung
Copy link
Contributor Author

@tylersticka Perhaps that switch was added in a newer version. I would run gem update bundler and try once more.

@gerardo-rodriguez out of curiosity, which bundler version to you have?

@gerardo-rodriguez
Copy link
Member

@erikjung

out of curiosity, which bundler version to you have?

$ bundler -v
Bundler version 1.14.6

@gerardo-rodriguez
Copy link
Member

@erikjung

Can you both discard your local changes, pull, then run bundle update --ruby

$ bundle update --ruby
The dependency tzinfo-data (>= 0) will be unused by any of the platforms Bundler is installing for. Bundler is installing for ruby but the dependency is only for x86-mingw32, x86-mswin32, x64-mingw32, java. To add those platforms to the bundle, run `bundle lock --add-platform x86-mingw32 x86-mswin32 x64-mingw32 java`.
Fetching gem metadata from https://rubygems.org/...........
Fetching version metadata from https://rubygems.org/..
Fetching dependency metadata from https://rubygems.org/.
Resolving dependencies...
Using public_suffix 2.0.5
Using colorator 1.1.0
Using ffi 1.9.18
Using forwardable-extended 2.6.0
Using sass 3.4.23
Using rb-fsevent 0.9.8
Using kramdown 1.13.2
Using liquid 3.0.6
Using mercenary 0.3.6
Using rouge 1.11.1
Using safe_yaml 1.0.4
Using bundler 1.14.6
Using addressable 2.5.0
Using rb-inotify 0.9.8
Using pathutil 0.14.0
Using jekyll-sass-converter 1.5.0
Using listen 3.0.8
Using jekyll-watch 1.5.0
Using jekyll 3.4.2
Using jekyll-feed 0.9.1
Using minima 2.1.0
Bundle updated!

@tylersticka
Copy link
Member

FYI, to update bundler you must run gem install bundler.

@tylersticka
Copy link
Member

After updating bundler it works as intended. 👍

@erikjung
Copy link
Contributor Author

After updating bundler it works as intended.

@tylersticka No more local changes to Gemfile.lock?

@gerardo-rodriguez
Copy link
Member

gerardo-rodriguez commented Mar 21, 2017

@erikjung Gemfile.lock comes up as modified again for me.

No more local changes to Gemfile.lock?

$ g s
 M Gemfile.lock
diff --git a/Gemfile.lock b/Gemfile.lock
index db1dd9f..d284c0e 100644
--- a/Gemfile.lock
+++ b/Gemfile.lock
@@ -51,7 +51,7 @@ DEPENDENCIES
   tzinfo-data
 
 RUBY VERSION
-   ruby 2.3.2p217
+   ruby 2.3.0p0
 
 BUNDLED WITH
    1.14.6

@erikjung
Copy link
Contributor Author

erikjung commented Mar 21, 2017

Gemfile.lock comes up as modified again for me.

@gerardo-rodriguez Looking at this: https://devcenter.heroku.com/articles/ruby-versions#ruby-version-specifiers

It seems like this might be something that is expected as long as we're using different Ruby versions and running bundle commands.

@tylersticka
Copy link
Member

No more local changes to Gemfile.lock?

Oh no, sorry, it's still modified.

@erikjung
Copy link
Contributor Author

Only if I run bundle update --ruby do I get the Gemlock.file in the modified state.

Okay, I don't think this is a hold up. If we are too annoyed by this, we can make everyone use RVM and choose an exact Ruby version. I'm going to add the instructions to the README and have others try on master.

@erikjung erikjung merged commit e21c6d3 into master Mar 21, 2017
@erikjung erikjung deleted the init-baseline_jekyll_files branch March 21, 2017 21:14
@aileenjeffries
Copy link
Member

When I try to run bundle install I get the following:

~/Documents/pwastats master
❯ bundle install
rbenv: bundle: command not found

The `bundle' command exists in these Ruby versions:
  2.1.0
  2.1.2

I've already run brew install ruby and it looks like it installed correctly.

@erikjung
Copy link
Contributor Author

@aileenjeffries What do you get for ruby -v?

@aileenjeffries
Copy link
Member

@erikjung ruby 2.2.3p173 (2015-08-18 revision 51636) [x86_64-darwin15]

@gerardo-rodriguez
Copy link
Member

@aileenjeffries Did bundler somehow not get installed?

What about running bundler -v?

@aileenjeffries
Copy link
Member

@gerardo-rodriguez yeah, I don't think bundler got installed. When I try, it says that command is only available in certain versions of ruby. My version of ruby is after them.

@erikjung
Copy link
Contributor Author

@aileenjeffries Can you try running gem install bundler and then post the results for which bundler && bundler -v.

@aileenjeffries
Copy link
Member

@erikjung, it is:

❯ which bundler && bundler -v
/opt/boxen/rbenv/shims/bundler
Bundler version 1.14.6

@erikjung
Copy link
Contributor Author

@aileenjeffries Okay, that is the version we want. Can you now complete the setup process? Does bundle install still fail?

@aileenjeffries
Copy link
Member

@erikjung maybe? :)

~/Documents/pwastats master
❯ bundle install
Your Ruby version is 2.2.3, but your Gemfile specified ~> 2.3.0

~/Documents/pwastats master

@erikjung
Copy link
Contributor Author

@aileenjeffries Ah. Even though you posted your "2.2.3" Ruby version, I read it as "2.3.2".

Let me make a change to our Gemfile so that we're targeting Ruby version 2.2 or higher.

@aileenjeffries
Copy link
Member

@erikjung after pulling master, bundle install worked. However, jekyll serve gives me

~/Documents/pwastats master
❯ jekyll serve
-bash: jekyll: command not found

@erikjung
Copy link
Contributor Author

@aileenjeffries

😐

bundle check && bundle show?

@aileenjeffries
Copy link
Member

~/Documents/pwastats master
❯ bundle check && bundle show
The Gemfile's dependencies are satisfied
Gems included by the bundle:
  * addressable (2.5.0)
  * bundler (1.14.6)
  * colorator (1.1.0)
  * ffi (1.9.18)
  * forwardable-extended (2.6.0)
  * jekyll (3.4.2)
  * jekyll-feed (0.9.1)
  * jekyll-sass-converter (1.5.0)
  * jekyll-watch (1.5.0)
  * kramdown (1.13.2)
  * liquid (3.0.6)
  * listen (3.0.8)
  * mercenary (0.3.6)
  * minima (2.1.0)
  * pathutil (0.14.0)
  * public_suffix (2.0.5)
  * rb-fsevent (0.9.8)
  * rb-inotify (0.9.8)
  * rouge (1.11.1)
  * safe_yaml (1.0.4)
  * sass (3.4.23)

~/Documents/pwastats master
❯ 

@erikjung
Copy link
Contributor Author

@aileenjeffries That looks correct. So perhaps the issue is related to using brew to install Ruby.

How about gem env?

@aileenjeffries
Copy link
Member

❯ gem env
RubyGems Environment:
  - RUBYGEMS VERSION: 2.4.5.1
  - RUBY VERSION: 2.2.3 (2015-08-18 patchlevel 173) [x86_64-darwin15]
  - INSTALLATION DIRECTORY: /opt/rubies/2.2.3/lib/ruby/gems/2.2.0
  - RUBY EXECUTABLE: /opt/rubies/2.2.3/bin/ruby
  - EXECUTABLE DIRECTORY: /opt/rubies/2.2.3/bin
  - SPEC CACHE DIRECTORY: /Users/aileen/.gem/specs
  - SYSTEM CONFIGURATION DIRECTORY: /opt/rubies/2.2.3/etc
  - RUBYGEMS PLATFORMS:
    - ruby
    - x86_64-darwin-15
  - GEM PATHS:
     - /opt/rubies/2.2.3/lib/ruby/gems/2.2.0
     - /Users/aileen/.gem/ruby/2.2.0
  - GEM CONFIGURATION:
     - :update_sources => true
     - :verbose => true
     - :backtrace => false
     - :bulk_threshold => 1000
     - "install" => "--no-rdoc --no-ri"
     - "update" => "--no-rdoc --no-ri"
  - REMOTE SOURCES:
     - https://rubygems.org/
  - SHELL PATH:
     - /opt/boxen/rbenv/versions/2.2.3/bin
     - /opt/boxen/rbenv/libexec
     - bin
     - /opt/boxen/heroku/bin
     - /opt/boxen/rbenv/shims
     - /opt/boxen/rbenv/bin
     - /opt/boxen/ruby-build/bin
     - ./node_modules/.bin
     - /opt/boxen/nodenv/shims
     - /opt/boxen/nodenv/bin
     - /opt/boxen/node-build/bin
     - /opt/boxen/homebrew/bin
     - /opt/boxen/homebrew/sbin
     - /opt/boxen/bin
     - /Users/aileen/bin
     - /usr/local/bin
     - /usr/bin
     - /bin
     - /usr/sbin
     - /sbin

~/Documents/pwastats master
❯ 

@erikjung
Copy link
Contributor Author

@aileenjeffries Okay, so it looks like (for reasons unknown, but possibly related to how Boxen set things up) your GEM PATHS do not correspond with any location in your SHELL PATH.

I would try this next...which is a bandaid fix until we can properly rid your system of any Boxen remnants (which I believe @gerardo-rodriguez had to do also).

Open your ~/.profile and append this:

PATH=$PATH:/opt/rubies/2.2.3/lib/ruby/gems/2.2.0/bin

Then run source ~/.profile && which jekyll and you should hopefully see a path to jekyll.

@aileenjeffries
Copy link
Member


~
❯ cd ~/

~
❯ vi .profile

~
❯ more .profile
source /opt/boxen/env.sh
PATH=$PATH:/opt/rubies/2.2.3/lib/ruby/gems/2.2.0/bin

~
❯ source ~/.profile && which jekyll
/opt/boxen/rbenv/shims/jekyll

~
❯ 

Does this mean I should go to /opt/boxen/rbenv/shims/jekyll and try running jekyll serve again?

@gerardo-rodriguez
Copy link
Member

gerardo-rodriguez commented Mar 22, 2017

until we can properly rid your system of any Boxen remnants (which I believe @gerardo-rodriguez had to do also).

@erikjung Yep, I no longer have Boxen on my system.

See: https://github.com/boxen/our-boxen/blob/master/docs/faq.md#q-how-do-you-remove-boxen

@gerardo-rodriguez
Copy link
Member

@erikjung Also more here: https://www.mobomo.com/2014/07/maintaining-boxen/

Use the nuke tool

After an initial boxen run, you can restore the machine to pristine status by using the nuke tool that comes with boxen.
/opt/boxen/repo/script/nuke --force --all
The above command will remove boxen entirely from your machine. It isn’t necessary to reinstall OS X.

@erikjung
Copy link
Contributor Author

erikjung commented Mar 22, 2017

@aileenjeffries You should be able to run jekyll anywhere now.

Can you run jekyll serve from the project root?

@aileenjeffries
Copy link
Member

wuh wa waaa:

~/Documents/pwastats master
❯ jekyll serve
/opt/rubies/2.2.3/lib/ruby/gems/2.2.0/gems/bundler-1.14.6/lib/bundler/runtime.rb:40:in `block in setup': You have already activated jekyll 3.4.3, but your Gemfile requires jekyll 3.4.2. Prepending `bundle exec` to your command may solve this. (Gem::LoadError)
	from /opt/rubies/2.2.3/lib/ruby/gems/2.2.0/gems/bundler-1.14.6/lib/bundler/runtime.rb:25:in `map'
	from /opt/rubies/2.2.3/lib/ruby/gems/2.2.0/gems/bundler-1.14.6/lib/bundler/runtime.rb:25:in `setup'
	from /opt/rubies/2.2.3/lib/ruby/gems/2.2.0/gems/bundler-1.14.6/lib/bundler.rb:100:in `setup'
	from /opt/rubies/2.2.3/lib/ruby/gems/2.2.0/gems/jekyll-3.4.3/lib/jekyll/plugin_manager.rb:36:in `require_from_bundler'
	from /opt/rubies/2.2.3/lib/ruby/gems/2.2.0/gems/jekyll-3.4.3/exe/jekyll:9:in `<top (required)>'
	from /opt/boxen/rbenv/versions/2.2.3/bin/jekyll:23:in `load'
	from /opt/boxen/rbenv/versions/2.2.3/bin/jekyll:23:in `<main>'

~/Documents/pwastats master

@erikjung
Copy link
Contributor Author

@aileenjeffries Oh, lucky us. Jekyll released a new version yesterday. Let me change our config again to allow for 3.4.2 or newer.

@aileenjeffries
Copy link
Member

:)

@erikjung
Copy link
Contributor Author

@aileenjeffries Alright, let's try pulling master and running that again.

@aileenjeffries
Copy link
Member

I pulled master, ran it again and got what looks like the same error message.

@erikjung
Copy link
Contributor Author

@aileenjeffries I was able to gem install jekyll to get the latest version and run jekyll serve. Perhaps you need to also run gem install jekyll && bundle install again?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants