Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save rococodogs/2dcf9fb66906818bda6c816ff2160136 to your computer and use it in GitHub Desktop.

Select an option

Save rococodogs/2dcf9fb66906818bda6c816ff2160136 to your computer and use it in GitHub Desktop.

Revisions

  1. adam malantonio revised this gist May 24, 2017. 1 changed file with 2 additions and 0 deletions.
    2 changes: 2 additions & 0 deletions up-and-running-with-geoblacklight.markdown
    Original file line number Diff line number Diff line change
    @@ -5,6 +5,8 @@ getting up and running w/ geoblacklight

    ```shell
    $ rails new my-app -m https://raw.githubusercontent.com/geoblacklight/geoblacklight/master/template.rb
    // ...
    $ cd my-app
    ```

    ## 1b. install: the hard way
  2. adam malantonio revised this gist May 24, 2017. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion up-and-running-with-geoblacklight.markdown
    Original file line number Diff line number Diff line change
    @@ -64,7 +64,7 @@ $ tools/solr/upload.rb http://127.0.0.1:8983/solr/blacklight-core examples/selec
    you may run into an error:

    ```shell
    uninitialized constant URI (NameError)
    /Users/adam/.rbenv/versions/2.4.0/lib/ruby/gems/2.4.0/gems/rsolr-2.0.2/lib/rsolr/client.rb:24:in `initialize': uninitialized constant URI (NameError)
    from /Users/adam/.rbenv/versions/2.4.0/lib/ruby/gems/2.4.0/gems/rsolr-2.0.2/lib/rsolr.rb:22:in `new'
    from /Users/adam/.rbenv/versions/2.4.0/lib/ruby/gems/2.4.0/gems/rsolr-2.0.2/lib/rsolr.rb:22:in `connect'
    from tools/solr/upload.rb:15:in `<main>'
  3. adam malantonio revised this gist May 24, 2017. 1 changed file with 4 additions and 8 deletions.
    12 changes: 4 additions & 8 deletions up-and-running-with-geoblacklight.markdown
    Original file line number Diff line number Diff line change
    @@ -1,15 +1,13 @@
    getting up and running w/ geoblacklight
    =======================================

    1a. install: the easy way
    -------------------------
    ## 1a. install: the easy way

    ```shell
    $ rails new my-app -m https://raw.githubusercontent.com/geoblacklight/geoblacklight/master/template.rb
    ```

    1b. install: the hard way
    -------------------------
    ## 1b. install: the hard way

    ```shell
    $ rails new my-app && cd my-app
    @@ -37,8 +35,7 @@ $ rails generate geoblacklight:install -f
    $ rake db:migrate
    ```

    2. import sample data
    ---------------------
    ## 2. import sample data

    (in the same terminal window)

    @@ -87,8 +84,7 @@ $ cd ..
    $ rm -rf geoblacklight-schema
    ```
    3. start the geoblacklight server
    ---------------------------------
    ## 3. start the geoblacklight server
    from the original terminal window, run:
  4. adam malantonio created this gist May 24, 2017.
    99 changes: 99 additions & 0 deletions up-and-running-with-geoblacklight.markdown
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,99 @@
    getting up and running w/ geoblacklight
    =======================================

    1a. install: the easy way
    -------------------------

    ```shell
    $ rails new my-app -m https://raw.githubusercontent.com/geoblacklight/geoblacklight/master/template.rb
    ```

    1b. install: the hard way
    -------------------------

    ```shell
    $ rails new my-app && cd my-app
    ```

    add to `Gemfile`:

    ```ruby
    gem 'blacklight', '>=6.3'
    gem 'geoblacklight', '>=1.4'
    ```

    then run

    ```shell
    $ bundle install
    // ...

    $ rails generate blacklight:install --devise
    // ...

    $ rails generate geoblacklight:install -f
    // ...

    $ rake db:migrate
    ```

    2. import sample data
    ---------------------

    (in the same terminal window)

    ```shell
    $ solr_wrapper
    ```

    (in another terminal window)

    ```shell
    $ git clone https://github.com/geoblacklight/geoblacklight-schema
    // ...

    $ cd geoblacklight-schema
    ```

    a helpful tool resides at `tools/solr/upload.rb` to upload geodata
    into the solr instance. to run it, you'll need to pass the url of
    the solr instance and the path to the sample data. so, from the
    root of `geoblacklight-schema`, you would run:

    ```shell
    $ tools/solr/upload.rb http://127.0.0.1:8983/solr/blacklight-core examples/selected.json
    ```

    you may run into an error:

    ```shell
    uninitialized constant URI (NameError)
    from /Users/adam/.rbenv/versions/2.4.0/lib/ruby/gems/2.4.0/gems/rsolr-2.0.2/lib/rsolr.rb:22:in `new'
    from /Users/adam/.rbenv/versions/2.4.0/lib/ruby/gems/2.4.0/gems/rsolr-2.0.2/lib/rsolr.rb:22:in `connect'
    from tools/solr/upload.rb:15:in `<main>'
    ```
    to fix this, edit `tools/solr/upload.rb` by adding
    ```ruby
    require 'uri'
    ```
    to the top of the file. run the command again and you should be okay.
    afterwards, you can remove the `geoblacklight-schema` directory:
    ```shell
    $ cd ..
    $ rm -rf geoblacklight-schema
    ```
    3. start the geoblacklight server
    ---------------------------------
    from the original terminal window, run:
    ```shell
    $ rails server
    ```
    and open `http://localhost:3000` in a browser.