I am fairly new to Ruby and the conditions for deploying the application through remote tools. I tried to deploy my application on a free openshift account. And I run the application.
When I run the application, I get this error:
You have already activated rack 1.5.2, but your Gemfile requires rack 1.6.0. Using bundle exec may solve this. (Gem::LoadError)
So, I'm trying to run bundle exec , but I got another error:
Gemfile syntax error: /var/lib/openshift/xxxxxxxxxxxxxxxxxxxxxxxxxx/app-root/runtime/repo/Gemfile:24: syntax error, unexpected ':', expecting $end gem 'sdoc', '~> 0.4.0', group: :doc
I think it could be because I used Ruby 2.1.5 locally and Open shift runs Ruby 2.0 by default.
I came across this topic. How to get the package installed in OpenShift Online when my RAILS_ENV is configured for development? but I don’t know if I am doing it right. I don’t even know where to place this pre_build file. I tried putting it under /var/lib/openshift/xxxxxxxxxxxxxxxxxxxxxxxxxx/app-root/runtime/repo/.openshift/action_hooks/ . But I'm not sure if runtime is the right repo.
EDIT 1:
This is my Gemfile:
source 'https://rubygems.org'
DECISION:
As @Rajarshi Das said, I had to change
gem 'sdoc', '~> 0.4.0', group: :doc
in
group: :doc do gem 'sdoc', '~> 0.4.0' end
I don’t know exactly why. There may be some syntax issues since I used Ruby 2.1.5 on the local computer and I had to use 2.0.0 for production. And after that I had to run gem install rails , although I quickly used rails. Finally, I had to manually add the gemfile gem 'nokogiri' . Finally, I could run bundle install and the application started to work.