What version of Ruby do you recommend? #7

Closed
Splendorr opened this Issue May 9, 2015 · 13 comments

Comments

Projects
None yet
2 participants

I see that you've listed interblah.net as using REE, but is that still true? When I try to install a new Vanilla.rb site and run rackup on REE, I encounter various errors.

I understand this may not be actively-maintained, but I'd like to try it for a project. I poked at Vanilla a long time ago, but didn't need to follow through on that project at the time. Now might be the time, because there doesn't seem to be anything like Vanilla out there!

Thanks in advance, and I'll try not to bug you about this!

I might as well inquire about Gem versions, too. I had to manually roll back to Haml 3.1 for REE compatibility, as well as "libxml-ruby", "~>2.8".

With a clean Vanilla 1.17 install, and adding those stipulations to the Gemfile, I'm still getting a Parslet error I can't figure out:

rackup
/Users/simolinic/.rvm/gems/ree-1.8.7-2012.02/gems/parslet-1.7.0/lib/parslet/atoms.rb:33:in `require': /Users/simolinic/.rvm/gems/ree-1.8.7-2012.02/gems/parslet-1.7.0/lib/parslet/atoms/infix.rb:34: odd number list for Hash (SyntaxError)
        left = {l: left, o: op, r: produce_tree(right)}

I've also tried clean installs on REE and 1.9.3. I get Rackup errors in every case. I'm afraid the Vanilla gem doesn't specify the versions of its dependencies, and more recent gems are breaking compatibility. Maybe?

By digging through my old project from 2011(!) I was able to get a version running on REE. I don't know if it's stable, but it's working. I'd still like to know your recommendations.

Owner

lazyatom commented May 9, 2015

Looks like interblah.net is running with Parslet 1.5, but there are later versions available since the last time interblah.net was built. I've just pushed a new version that locks Parslet at 1.5.x, which seems to build OK on REE and Ruby 2.2.x, and that should hopefully let you make progress. Meanwhile, I'll look into updating to newer versions of dependencies now.

Thanks for looking into it. I've got a functioning version of the site up at www.awngo.in with the repo at https://github.com/Splendorr/awngoing-1.17

I plucked various pieces out of your current interblah.net repo to get it working last night. This is more or less the project I created in 2011, with various new pieces grafted in. It's running on REE/1.8.7, on Heroku. However, Heroku has said they're ending support for Ruby versions prior to 2.0 in the coming months.

When I've tried to switch to loading the site in 2.0+, I get various errors, especially Rack errors. But I'll try setting the parslet version and see where that gets me.

In any case, it works now (mostly), but I'm hoping to set up a place where I can gather a bunch of writing over the coming years. You have no obligation to help, of course; but I think I'm going to be able to do some interesting things with the snip system! Either way, I appreciate it. :)

Owner

lazyatom commented May 9, 2015

Vanilla 0.17.13 should work with later versions of ruby (1.9 to 2.2) very well and without dependency issues, so hopefully seamlessly on Heroku :-)

On 9 May 2015, at 18:36, Nick Splendorr notifications@github.com wrote:

Thanks for looking into it. I've got a functioning version of the site up at www.awngo.in with the repo at https://github.com/Splendorr/awngoing-1.17

I plucked various pieces out of your current interblah.net repo to get it working last night. This is more or less the project I created in 2011, with various new pieces grafted in. It's running on REE/1.8.7, on Heroku. However, Heroku has said they're ending support for Ruby versions prior to 2.0 in the coming months.

When I've tried to switch to loading the site in 2.0+, I get various errors, especially Rack errors. But I'll try setting the parslet version and see where that gets me.

In any case, it works now (mostly), but I'm hoping to set up a place where I can gather a bunch of writing over the coming years. You have no obligation to help, of course; but I think I'm going to be able to do some interesting things with the snip system! Either way, I appreciate it. :)


Reply to this email directly or view it on GitHub.

Thanks, @lazyatom!

tl;dr: I'm getting Rack errors in a new app installation, with both rack 1.6.1 and 1.4.1, which is what interblah.net uses.

Long version:

Just to test, I've installed Vanilla 1.17.13 running Ruby 2.2.1. I run the vanilla command to create a new app directory. I cd into the directory, and run rackup, and I get this error:

/Users/simolinic/Dropbox/Programming/vanilla1_17_13/config.ru:1:in `require': cannot load such file -- application (LoadError)
    from /Users/simolinic/Dropbox/Programming/vanilla1_17_13/config.ru:1:in `block in <main>'
    from /Users/simolinic/.rvm/gems/ruby-2.2.1/gems/rack-1.6.1/lib/rack/builder.rb:55:in `instance_eval'
    from /Users/simolinic/.rvm/gems/ruby-2.2.1/gems/rack-1.6.1/lib/rack/builder.rb:55:in `initialize'
    from /Users/simolinic/Dropbox/Programming/vanilla1_17_13/config.ru:in `new'
    from /Users/simolinic/Dropbox/Programming/vanilla1_17_13/config.ru:in `<main>'
    from /Users/simolinic/.rvm/gems/ruby-2.2.1/gems/rack-1.6.1/lib/rack/builder.rb:49:in `eval'
    from /Users/simolinic/.rvm/gems/ruby-2.2.1/gems/rack-1.6.1/lib/rack/builder.rb:49:in `new_from_string'
    from /Users/simolinic/.rvm/gems/ruby-2.2.1/gems/rack-1.6.1/lib/rack/builder.rb:40:in `parse_file'
    from /Users/simolinic/.rvm/gems/ruby-2.2.1/gems/rack-1.6.1/lib/rack/server.rb:299:in `build_app_and_options_from_config'
    from /Users/simolinic/.rvm/gems/ruby-2.2.1/gems/rack-1.6.1/lib/rack/server.rb:208:in `app'
    from /Users/simolinic/.rvm/gems/ruby-2.2.1/gems/rack-1.6.1/lib/rack/server.rb:336:in `wrapped_app'
    from /Users/simolinic/.rvm/gems/ruby-2.2.1/gems/rack-1.6.1/lib/rack/server.rb:272:in `start'
    from /Users/simolinic/.rvm/gems/ruby-2.2.1/gems/rack-1.6.1/lib/rack/server.rb:147:in `start'
    from /Users/simolinic/.rvm/gems/ruby-2.2.1/gems/rack-1.6.1/bin/rackup:4:in `<top (required)>'
    from /Users/simolinic/.rvm/gems/ruby-2.2.1/bin/rackup:23:in `load'
    from /Users/simolinic/.rvm/gems/ruby-2.2.1/bin/rackup:23:in `<main>'
    from /Users/simolinic/.rvm/gems/ruby-2.2.1/bin/ruby_executable_hooks:15:in `eval'
    from /Users/simolinic/.rvm/gems/ruby-2.2.1/bin/ruby_executable_hooks:15:in `<main>'

I'm sure I must have done something to goof up my installation somehow, because this is the error I've seen every time I try to run in any version of ruby other than REE/1.8.7.

I did bundle install and got the folllowing:

bundle install
The source :rubygems is deprecated because HTTP requests are insecure.
Please change your source to 'https://rubygems.org' if possible, or 'http://rubygems.org' if not.
Using BlueCloth 1.0.1
Using RedCloth 4.2.9
Using blankslate 2.1.2.4
Using tilt 2.0.1
Using haml 4.0.6
Using libxml-ruby 2.8.0
Using parslet 1.5.0
Using rack 1.6.1
Using rack-test 0.6.3
Using ratom 0.9.0
Using soup 1.0.11
Using vanilla 1.17.13
Using bundler 1.9.6
Bundle complete! 1 Gemfile dependency, 13 gems now installed.
Use `bundle show [gemname]` to see where a bundled gem is installed.

But rackup still gives me the same error.

I repeated this by specifying Rack 1.4.1 since that's what interblah.net's gemfile.lock says, but get the same error. Any idea what I'm doing wrong?

In project, after switch from REE to 2.2.1, install Vanilla 1.17.13, and running bundle update, I get the following:

Fetching gem metadata from https://rubygems.org/............
Fetching version metadata from https://rubygems.org/...
Fetching dependency metadata from https://rubygems.org/..
Resolving dependencies...
Using rake 10.4.2
Using BlueCloth 1.0.1
Using RedCloth 4.2.9 (was 4.2.7)
Using blankslate 2.1.2.4
Using haml 3.1.8 (was 3.1.1)
Using kramdown 1.7.0
Using libxml-ruby 2.8.0
Using parslet 1.5.0 (was 1.2.0)
Using rack 1.6.1 (was 1.2.2)
Installing passenger 5.0.7
Using posix-spawn 0.3.11
Using yajl-ruby 1.2.1
Using pygments.rb 0.6.3
Using rack-test 0.6.3 (was 0.6.0)
Using ratom 0.9.0 (was 0.6.8)
Installing redcarpet 2.3.0
Using sass 3.4.13
Using soup 1.0.11 (was 1.0.7)
Using susy 2.2.3
Using vanilla 1.17.13 (was 1.17)
Using bundler 1.9.6
Bundle updated!

Then when I run rackup, I get another rack error:

/Users/simolinic/Dropbox/Programming/awngoing-1-17-reboot/config.ru:20:in `require': cannot load such file -- application (LoadError)
    from /Users/simolinic/Dropbox/Programming/awngoing-1-17-reboot/config.ru:20:in `block in <main>'
    from /Users/simolinic/.rvm/gems/ruby-2.2.1/gems/rack-1.6.1/lib/rack/builder.rb:55:in `instance_eval'
    from /Users/simolinic/.rvm/gems/ruby-2.2.1/gems/rack-1.6.1/lib/rack/builder.rb:55:in `initialize'
    from /Users/simolinic/Dropbox/Programming/awngoing-1-17-reboot/config.ru:in `new'
    from /Users/simolinic/Dropbox/Programming/awngoing-1-17-reboot/config.ru:in `<main>'
    from /Users/simolinic/.rvm/gems/ruby-2.2.1/gems/rack-1.6.1/lib/rack/builder.rb:49:in `eval'
    from /Users/simolinic/.rvm/gems/ruby-2.2.1/gems/rack-1.6.1/lib/rack/builder.rb:49:in `new_from_string'
    from /Users/simolinic/.rvm/gems/ruby-2.2.1/gems/rack-1.6.1/lib/rack/builder.rb:40:in `parse_file'
    from /Users/simolinic/.rvm/gems/ruby-2.2.1/gems/rack-1.6.1/lib/rack/server.rb:299:in `build_app_and_options_from_config'
    from /Users/simolinic/.rvm/gems/ruby-2.2.1/gems/rack-1.6.1/lib/rack/server.rb:208:in `app'
    from /Users/simolinic/.rvm/gems/ruby-2.2.1/gems/rack-1.6.1/lib/rack/server.rb:336:in `wrapped_app'
    from /Users/simolinic/.rvm/gems/ruby-2.2.1/gems/rack-1.6.1/lib/rack/server.rb:272:in `start'
    from /Users/simolinic/.rvm/gems/ruby-2.2.1/gems/rack-1.6.1/lib/rack/server.rb:147:in `start'
    from /Users/simolinic/.rvm/gems/ruby-2.2.1/gems/rack-1.6.1/bin/rackup:4:in `<top (required)>'
    from /Users/simolinic/.rvm/gems/ruby-2.2.1/bin/rackup:23:in `load'
    from /Users/simolinic/.rvm/gems/ruby-2.2.1/bin/rackup:23:in `<main>'
    from /Users/simolinic/.rvm/gems/ruby-2.2.1/bin/ruby_executable_hooks:15:in `eval'
    from /Users/simolinic/.rvm/gems/ruby-2.2.1/bin/ruby_executable_hooks:15:in `<main>'

I still have this in my gemfile:

source 'https://rubygems.org'
# ruby "1.8.7"

# Vanilla itself.
gem "vanilla"
gem "pygments.rb"
gem "redcarpet", "2.3.0"
gem "haml", "~>3.1"
gem "susy"
gem "kramdown"
gem "libxml-ruby", "~>2.8"
gem "rake"

gem "passenger"

And this is my config.ru:

# If you're running your site under a proper webserver, you probably don't need this.
# require 'vanilla/static'
# use Vanilla::Static, File.join(File.dirname(__FILE__), 'public')

#require 'rack/rewrite'

# use Rack::Rewrite do
#  rewrite %r{^/([^g/]*)$}, 'g/$1'  
# end
# 

# loop through each folder in 'public' and mount it at '/subfolder-name', e.g. '/css' etc.
Dir.chdir('public') do
    public_dirs = (Dir.glob("*").find_all{|entry| File::directory?(entry)}).collect{|dir| '/' + dir}
    use Rack::Static, :urls => public_dirs, :root => 'public'
    use Rack::ContentType, "text/html"
    use Rack::ContentLength
end

require "application"
run Application.new

Where the error line 20 is the require "application" line. Most of these rack-related issues seeeeem to point in the vicinity of this same "application" reference, wherever it appears. I don't know why that would be.

Whether a brand new app, or an upgrade from way back at 1.17.0, very similar errors.

For my "vanilla1_17_13" brand new test project, here's the generated, untouched-by-me config.ru:

require "application"

# If you're running your site under a proper webserver, you probably don't need this.
require 'vanilla/static'
use Vanilla::Static, File.join(File.dirname(__FILE__), 'public')

run Application.new

and the rackup error begins with:

/Users/simolinic/Dropbox/Programming/vanilla1_17_13/config.ru:1:in `require': cannot load such file -- application (LoadError)
    from /Users/simolinic/Dropbox/Programming/vanilla1_17_13/config.ru:1:in `block in <main>'
Owner

lazyatom commented May 9, 2015

Hmm. Looks like 'application.rb' isn't in the load path. Is there anything in interblah.net's config.ru that I added to fix that?

On 9 May 2015, at 22:18, Nick Splendorr notifications@github.com wrote:

For my "vanilla1_17_13" brand new test project, here's the generated, untouched-by-me config.ru:

require "application"

If you're running your site under a proper webserver, you probably don't need this.

require 'vanilla/static'
use Vanilla::Static, File.join(File.dirname(FILE), 'public')

run Application.new
and the rackup error begins with:

/Users/simolinic/Dropbox/Programming/vanilla1_17_13/config.ru:1:in require': cannot load such file -- application (LoadError) from /Users/simolinic/Dropbox/Programming/vanilla1_17_13/config.ru:1:inblock in

'

Reply to this email directly or view it on GitHub.

Bingo! These two lines from the top of Interblah's config.ru solved that error and allowed the 1.17.13 template project to load via rackup:

$:.unshift File.join(File.dirname(__FILE__), "lib")
$:.unshift File.join(File.dirname(__FILE__))

Great! In this case, just updating my old project seems to make some other stuff weird, but that's to be expected. I'll start fresh with this project. Could you add those lines to the starter project in the gem?

There are things to fix, but I got my old site to run on ruby 2.2.1 at http://www.awngo.in with a repo at https://github.com/Splendorr/awngoing-1.17.13

I ran the current gem "vanilla" command, added the config.ru lines above, and then copied all my old snips and css over. Seems to work great! Thanks so much, James!!. :)

@Splendorr Splendorr closed this May 10, 2015

Owner

lazyatom commented May 10, 2015

I've added the key line to the generated config.ru - thanks for prompting this fix!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment