Join GitHub today
GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
Already on GitHub? Sign in to your account
Manage gems + Ruby at current stable version(s) #266
Conversation
|
Thanks for submitting patches. While I didn't review / test everything, ruby2.0 isn't available in most distro. ruby2.0 will only be supported in the next ubuntu release. So it needs to be ruby1.9.1-dev for now (which is actually 1.9.3). Bundler seems cool, however it needs to work with previous ruby versions. Also, when tested, it downloaded a lot more gems than required and took more time than what we have now (sudo gem install ffi-icu). Perhaps the Gemfile / Gemfile.lock should be reviewed to include appropriate dependencies? All in all, if the goal of this pull request is to help new contributors, I think it shouldn't increase the time required to install the dependencies. It would also be good to test changes in the README on an old and recent clean install (ex. ubuntu 12.04 and 13.10) to make sure contributors won't hit problems. For example, "sudo" is missing in "gem install bundler" . |
|
Cool! One thing I made sure to write in my PR note above is that any developers who do not want to run modern Ruby can simply ignore the I'll take your specific questions one by one:
Ruby 2.0 works well on Ubuntu 12.04, and on previous versions too. I personally run Ruby 2.0 on both 11.10 and 12.04 with no issues; it just uses less memory. > cat /etc/lsb-release|grep RELEASE
DISTRIB_RELEASE=11.10
> ruby --version
ruby 2.0.0p247 (2013-06-27 revision 41674) [x86_64-linux]While it's possible to install ruby using a system package manager, this is strongly discouraged by the Ruby team because package maintainers rarely incorporate the latest bug + security fixes into their packages. That's why the most popular tool for installing Ruby is not
Luckily, Bundler works great with previous versions, even all the way back to Ruby 1.8.7 and earlier. When Bundler was released, Ruby 2.0 did not even exist :)
It might have seemed that way, but what you saw was the same required gems being downloaded once, the first time, and then isolated from the system gems so that upgrades do not break the project. The only gems in the
Installing the gems takes the same amount of time, and the first time you install, the gems and their dependencies will be downloaded. That happens once and never again unless the gem dependencies change. (If you run
Not missing - no longer necessary!
Again, as per above: you can add an additional Let me know if you'd like me to test on other/older platforms than Ubuntu 11.10, 12.04, and OS X 10.9, which is where I tested — I understand that you want to have full confidence in this and I'm happy to help with that. |
|
@tcatm @schildbach : Any opinion on this? @jm3: Well it seems that sudo is required in "gem install builder" if you install ruby from apt-get. Perhaps current setup is less portable, but using rvm to install ruby requires much more steps I'd prefer not to push on new contributors unless they really have problems with the current setup. Regarding dependencies, I still think some are not needed. therubyracer and aquarium for instance are not required anymore unless I'm mistaken. |
|
Only included them because the docs on here say they're required. :) The other Jekyll projects I work on don't use either of them. |
|
If old Ruby's are not being supported anymore we should probably update to one that is, regardless of what distro's ship. Linux distros are notorious for shipping ancient software that's full of bugs ... |
|
@jm3 +1 for this PR.. |
|
@buren agreed, thank you |
|
@jm3 Could you replace your commit with a new one tested with a fresh distro install and without "aquarium" and "therubyracer" dependencies? "bundle install" fails on Ubuntu 14.04 with current Gemfile.lock, and it fails on all Ubuntu versions when trying to re-generate the file from scratch. So it may be that we should completely stop using apt and switch to using rvm. If you can provide these instructions in the README as well, we could test this and (finally) close this pull request. |
|
@saivann no problem, I've already rebased the patch against current HEAD and it bundles fine on Ubuntu 14.04 with Ruby 2 (and OS X, where I develop). Following the instructions in the README, Please post your instructions to run the app without the gem and I'll happily remove it :) |
|
@jm3 If |
harding
commented on an outdated diff
May 18, 2014
| - sudo apt-get install jekyll node-less ruby1.9.1-dev libicu-dev | ||
| - sudo gem install ffi-icu | ||
| + sudo apt-get update | ||
| + sudo apt-get install jekyll node-less ruby2.0 | ||
| + gem install bundler; bundle install |
harding
Contributor
|
|
@harding that's exactly right, bundler encapsulates the project's gems to keep them safe from conflicting with any other project's gems or installed system gems. In my experience, the default for project READMEs is that all commands are run from within the project unless otherwise specified; this is what I've seen in every other Github project I've experienced. I'm happy to add, "# cd into project directory", but I'm curious, was there a previous step in the instructions that led you outside the project? |
|
@saivann added the conversion to RVM as well; eliminates the need for deb packages |
saivann
commented on an outdated diff
May 18, 2014
| @@ -41,19 +41,24 @@ You simply need to push additionnal commits on the appropriate branch of your Gi | ||
| **Easy preview**: Simple text changes can be previewed live on bitcoin.org. You only need to click anywhere on the page and hold your mouse button for one second. You'll then be able to edit the page just like a document. Changes will be lost as soon as the page is refreshed. | ||
| -**Real preview**: Install [dependencies](#requirements), run jekyll (or "jekyll build" on older setups), and copy the output files from _site/ to the root of your web server. If you have no web server, run jekyll --server (or "jekyll serve" on older setups). This server requires you to add a trailing ".html" by hand in your browser address bar. | ||
| +**Real preview**: Install [dependencies](#requirements), run `bundle exec jekyll build` and copy the output files from _site/ to the root of your web server. If you have no web server, run `bundle exec jekyll serve`. |
saivann
Contributor
|
saivann
and 1 other
commented on an outdated diff
May 18, 2014
| - sudo apt-get install rubygems ruby1.9.1-dev build-essential libicu-dev | ||
| - sudo gem install jekyll json less therubyracer ffi-icu | ||
| + gem install bundler | ||
| + bundle install | ||
| + | ||
| +on older Ubuntu and Debian distributions: |
saivann
Contributor
|
saivann
and 1 other
commented on an outdated diff
May 18, 2014
| - sudo apt-get install jekyll node-less ruby1.9.1-dev libicu-dev | ||
| - sudo gem install ffi-icu | ||
| + \curl -sSL https://get.rvm.io | bash -s stable |
saivann
Contributor
|
|
@jm3 re: changing directory I think the confusion arises from differing context. If I cloned the repository and then read the README.md, it'd be a reasonable assumption that I was in the top-level directory of the repository. But with GitHub displaying the README.md as the project's main info page, and with the file including instructions for people who haven't cloned yet, I think it's reasonably likely that users might try to install the "Requirements" from outside the repository---or even try to install them before creating the cloned repository. |
|
Re: changing directory, FWIW, I would also expect some people to install dependencies from outside the repository unless explicitely specified. |
harding
and 1 other
commented on an outdated diff
May 18, 2014
| @@ -0,0 +1,14 @@ | ||
| +source 'http://rubygems.org' |
harding
Contributor
|
|
@harding i think the perceived risk of confusion about CWD stems from the fact that the README as currently written has two sets of instructions: one for getting the code and one for getting the other dependencies. Currently the instructions for getting the code are mixed up with some tips like "here's how to use git" and so on; I'd prefer to clarify things by moving that meta stuff to the end of the readme (usually under a heading like, "How to Contribute") and moving the In my experience, a great README install section has a block that can be literally pasted into the terminal to get the project set up; if I move those I'll update the PR; please let me know if you have a different idea. |
|
@jm3 the solution you propose for the possible CWD confusion sounds excellent to me. Thanks! |
|
@harding awesome, done! Since it's hard to read markdown in diff format, you can preview the README changes here, if you like: https://github.com/jm3/bitcoin.org#setup |
harding
commented on an outdated diff
May 19, 2014
| -You can report any problem or help to improve bitcoin.org by opening an issue or a [pull request](#working-with-github) on [GitHub](https://github.com/bitcoin/bitcoin.org). You can also help [translating bitcoin.org](#translation) on [Transifex](https://www.transifex.com/projects/p/bitcoinorg/). | ||
| +You can report problems or help improve bitcoin.org by opening an issue or a [pull request](#working-with-github) on [GitHub](https://github.com/bitcoin/bitcoin.org). You can also help by [translating](#translation) bitcoin.org's text on [Transifex](https://www.transifex.com/projects/p/bitcoinorg/). |
|
|
harding
and 1 other
commented on an outdated diff
May 19, 2014
| -In order to use GitHub, you need to [sign up](http://github.com/signup) and [set up git](https://help.github.com/articles/set-up-git). You will also need to click the **Fork** button on the bitcoin.org [GitHub page](https://github.com/bitcoin/bitcoin.org) and clone your GitHub repository into a local directory using the following command lines: | ||
| + # install ruby 2 using rvm | ||
| + \curl -sSL https://get.rvm.io | bash -s stable |
jm3
Contributor
|
|
@jm3 You actually did more change than you described, and I think this creates various problems:
|
saivann
and 1 other
commented on an outdated diff
May 19, 2014
| -GitHub allows you to make changes to a project using git, and later submit them in a "pull request" so they can be reviewed and discussed. Many online how-tos exist so you can learn git, [here's a good one](https://www.atlassian.com/git/tutorial/git-basics). | ||
| +If `ruby -v` reports 2.0.0 or higher on your system, you're all set. |
saivann
Contributor
|
|
@jm3 As an alternative suggestion, if you really think "Setup" should remain merged with "Preview", I suggest you move "Previewing text changes" under "Translation" right before "Importing translations". This easter egg is generally used by translators. |
|
@saivann ah, great compromise, I like it. Done. |
|
@saivann Having used GitHub daily, for years, I think it's pretty safe to say that the prevailing practice is to put "How to Contribute" stuff at the end of the README. I can't recall seeing a lot of popular projects that put this at the front. By putting it at the end, you let developers get right to the content, not wade through a bunch of boilerplate, which helps get them started more quickly and makes them feel like the project is easy to contribute to. If you really feel strongly about it, I think the best solution is to split the README into a few files and link them from the main README: translation stuff can be moved to its own README file (presumably in |
|
@jm3 If you fix other things I've asked in this comment, the first title will be "How to participate" and the short text under it links to "Working with GitHub", so keeping this text at the end of the README would be OK with me in this case. Although my experience with this project tells me that this text is one of the most important part of the README. Remember this is a website (not a software) so many non-developer contributors want to use GitHub in order to make simple pull requests (submit events, fix typos, update translations, submit new texts). Current README has been written for these requirements and has proven useful thus far. |
|
Re: Working With GitHub, I concur with @saivann. When I started contributing, I just wanted to contribute text, and I was quite happy that it was easy to do that without installing Jekyll and its dependencies. In general, I think the README (and almost any document) should proceed from the most generally-useful information to the most specialized information, and that means that using GitHub GUI comes before git command line, which itself comes before compiling stuff with jekyll. |
|
Gentlemen, I don't at all agree, but I'm not here to argue. Reverted README back to the previous state; I kept the spelling + capitalization fixes. |
|
@harding awesome! let me know if i can help with additional testing. |
|
Status update: I started following the instructions on an version of Debian (the current stable) but decided to give up for the day when it wanted root permissions during the ruby2 install. Tomorrow I'll make a chroot and try it in there. I committed and pushed my minor changes to the README during the process over here: harding/bitcoin.org@ce37a54#diff-04c6e90faac2675aa89e2176d2eec7d8 |
|
@harding Cool, I left some comments. |
|
Followed the README instructions using my usual build chroot (Debian Unstable) and it worked fine, although rvm insall ruby-2.0.0 still prompted me for my root password in order to install the following packages using apt-get: libyaml-dev, libsqlite3-dev, sqlite3, libffi-dev (I wish it told me what packages it wanted so I could install them myself, but I don't see an option to do that in the code (and that's certainly not @jm3's fault!).) This is the chroot I currently use the Debian jekyll package to build with, and diff says the _site built by I tested on both current master and the devel-docs branch. I did update the config file to prevent Gemfile and Gemfile.lock from being included in _site. @jm3 I suggest you wait for @saivann's comments and then merge my branch into yours and squash all the commits down into your commit. If @saivann has any more changes he wants to make, he'll probably have a branch for you to sqash merge too. Thanks for all of your work! |
|
@harding sounds great, I'll stand by |
|
Let me known you need more testing |
|
Commit 944e7c3 LGTM! |
|
944e7c3 LGTM. Thanks! |
jm3 commentedNov 13, 2013
The current stable version of Ruby is 2.0. Bitcoin.org's version, 1.9.1, has been end-of-life'd and is not supported.
Most popular ruby projects have also adopted Bundler to simplify managing their gem dependencies. Bundler lets developers have more than one version of a gem (or of Ruby itself) on their machines without conflict.
This pull request updates bitcoin.org to Ruby 2.0.0 and encapsulates all Ruby dependencies in a
Gemfileso that one command (bundle install) now downloads and install all required gems. Other than making it easier for developers to contribute, there are no changes. Any curmudgeonly developers who do not wish to run modern Ruby can simply ignore the Gemfile and everything will work the same (though you really should update :).README has also been updated to reflect the change.