Create your application - Part 2 - Walkthrough of GeoConcerns"
Jun 7, 2016
Note: If you have issues with any of these steps, a prebuilt version of this application is available within the provided virtual machine. The application can be accessed by SSHing into the virtual maching and then changing directory to
Create your application
Prerequisite: Make sure your environment is setup.
Generating your Rails application
For more information about generating a Rails application see the Getting Started with Rails guide.
Switch to the root user
$ sudo -i $ cd /home/vagrant
Create a new Rails application
$ rails new your_app_name
Switch to its folder
$ cd your_app_name
Run the rails server.
$ rails s -b 0.0.0.0
We are running the Rails server with the “-b” option which is binding the server to the 0.0.0.0 IP address. This is only necessary if your are running the application on your Vagrant virtual machine.
Now you can visit the Rails application at http://127.0.0.1:3000. You should see Yay! You’re on Rails!” CTRL + c will stop server.
Optional Initialize your git repository and commit your changes
$ git init $ git add . $ git commit -m 'initial commit of Rails application'
Add GeoConcerns to your
Gemfile. Add this line to the end:
# In ./Gemfile gem 'geo_concerns', git: 'https://github.com/projecthydra-labs/geo_concerns.git', branch: 'workshop'
Install required gems and their dependencies
$ bundle install
Run the CurationConcerns generator
$ rails generate curation_concerns:install -f
Run the GeoConcerns generator
$ rails generate geo_concerns:install -f
Run database migrations
$ rake db:migrate
Quick tip: All of these tasks (1 - 5) are included as part of template to generate a new GeoConcerns application. To run that generator just run:
$ rails new app-name -m https://raw.githubusercontent.com/projecthydra-labs/geo_concerns/workshop/template.rb
Change ActiveJob to queue adapter to inline. This is workaround for some issues with running background jobs on the Vagrant image. Add this line to the end of the development environment file:
# In ./config/environments/development.rb Rails.application.config.active_job.queue_adapter = :inline
Now start your Rails application again and navigate to http://127.0.0.1:3000. You should see the GeoConcerns homepage.
$ rails s -b 0.0.0.0
Optional Commit your work
$ git add . $ git commit -m 'installed CurationConcerns and GeoConcerns'
Great job for making it this far. You now have a working GeoConcerns application!
So far you have a working GeoConcerns application with a test framework installed. Now we’ll start the app and walk through some of the features.
- Part 1 - Setting up your environment
- Part 2 - Create your application
- Part 3 - Starting the application
- Part 4 - Create an image work
- Part 5 - Add files to the image work
- Part 6 - Create a raster work
- Part 7 - Create a collection
- Part 8 - Create a vector work
- Part 9 - Viewing derivatives
This work is licensed under a Creative Commons Attribution 4.0 International License.