edu_apps
edu_apps copied to clipboard
rackup config.ru fails
I am new to Ruby but I managed to install it together with your repository. Now I get this error and when I start the site I do not see much (I am assuming i should some apps).
myuser ruby parse_lti_examples.rb
/home/myuser/edu_apps/edu_apps.rb:8:in `<class:EduApps>': uninitialized constant Sinatra::Main (NameError)
from /home/myuser/edu_apps/edu_apps.rb:3:in `<top (required)>'
from /home/myuser/.rbenv/versions/2.0.0-p247/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:45:in `require'
from /home/myuser/.rbenv/versions/2.0.0-p247/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:45:in `require'
from parse_lti_examples.rb:3:in `<main>'
I am hacking this repo without knowing much what I am doing but I managed to run it! I bet all the errors have some simple explanation but this is what I did:
For the previous error and similar others, I manually required these files (I do not know how to import the whole app/controllers directory):
require './app/controllers/main.rb'
require './app/controllers/external_search.rb'
require './app/controllers/apps.rb'
require './app/controllers/admin.rb'
require './app/controllers/twitter_login.rb'
require './app/controllers/assessment.rb'
require './app/controllers/custom_launches.rb'
require './app/controllers/config_xml.rb'
require './app/controllers/oembed.rb'
require './app/controllers/parsers.rb'
The I got the error:
uninitialized constant AdminPermission (NameError)
which I solved by adding to parse_lti_examples.rb:
require_relative './config/environment.rb'
Then I got some problems with the default versions of json and sinatra such as:
You have already activated json 1.7.7, but your Gemfile requires json 1.5.5.
You have already activated sinatra 1.4.7, but your Gemfile requires sinatra 1.
which i solved by removing these files as suggested in forums
~/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/specifications/default/json-1.7.7.gemspec
~/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/specifications/sinatra-1.4.7.gemspec
The command rackup config.ru worked but showed no apps because some json files were missing. To solve this I added to edu_apps.rb:
set :public_folder, File.dirname(__FILE__) + '/public'
Wow, well done. This hasn't been maintained for a while, so I'm impressed you were able to get it up and running. Feel free to fork if you plan on doing ongoing work!