Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rackup config.ru fails #11

Open
aless80 opened this issue Jan 14, 2019 · 2 comments
Open

rackup config.ru fails #11

aless80 opened this issue Jan 14, 2019 · 2 comments

Comments

@aless80
Copy link

aless80 commented Jan 14, 2019

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>'
@aless80
Copy link
Author

aless80 commented Jan 14, 2019

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'

@whitmer
Copy link
Owner

whitmer commented Jan 25, 2019

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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants