Getting a Rack GemNotFound with Sinatra
This is my first attempt with a ruby stack. I'm stuck with the following error:
Could not find rack-1.6.4 in any of the sources (Bundler::GemNotFound)
I've successfully installed the following components:
* LOCAL GEMS *
* Gemfile *
gem 'sinatra', '1.4.6'
* Gemfile.lock *
GEM
remote: https://rubygems.org/
specs:
rack (1.6.4)
rack-protection (1.5.3)
rack
sinatra (1.4.6)
rack (~> 1.4)
rack-protection (~> 1.4)
tilt (>= 1.3, < 3)
tilt (2.0.1)
PLATFORMS
ruby
DEPENDENCIES
sinatra (= 1.4.6)
BUNDLED WITH
1.10.6
* config.ru *
require './app.rb'
run Sinatra::Application
* app.rb *
require 'bundler/setup'
require 'sinatra'
get '/' do
'hello world'
end
I'm using the default Nginx folder for the app. I was able to execute the following test in config.ru:
app = proc do |env|
[200, { "Content-Type" => "text/html" }, ["hello world"]]
end
But as soon I try to switch to Sinatra I get the error above.
Thanks in advance!
Ok I found the problem.
I followed the installation instruction here: https://www.phusionpassenger.com/library/install/nginx/install/oss/trusty/
But since I'm using rvm I had to change the passenger_ruby directive to point to the rvm wrapper: /usr/local/rvm/wrappers/ruby-2.1.6/ruby
Problem is here:
rack (1.6.4)
...
sinatra (1.4.6)
rack (~> 1.4)
You have a conflict in the rack version. you want both 1.6.4 and 1.4.x
How did rack 1.6.4 end up in the gemfile.lock?