Question

I have been repeating this tutorial for weeks now: https://www.digitalocean.com/community/articles/how-to-1-click-install-ruby-on-rails-on-ubuntu-12-10-with-digitalocean

Here are the specifics of my project: I am using Mongoid with database.yml production set to my tested and working Droplet (DigitalOcean VPS) running MongoDB.

My gem file is here, I am new to Rails and am not quite sure if it's set up right, so I just moved them all to assets hoping Unicorn might serve these gems for me?

source 'https://rubygems.org'

gem 'rails', '3.2.14'


# Gems used only for assets and not required
# in production environments by default.
group :assets do
  gem 'sass-rails',   '~> 3.2.3'
  gem 'coffee-rails', '~> 3.2.1'

  gem "therubyracer"
  gem "less-rails" #Sprockets (what Rails 3.1 uses for its asset pipeline) supports LESS
  gem "twitter-bootstrap-rails"
  gem 'redcarpet', '1.17.2'
  gem 'uglifier', '>= 1.0.3'


        gem "will_paginate_mongoid"
        gem 'will_paginate', '~> 3.0.5'
        gem 'will_paginate-bootstrap'

        gem 'devise'

        gem 'jquery-rails'



        gem "mongoid", "~> 3.0.0"
end

Here's what I did: I used DigitalOcean's 1 click installer. Then I used FileZilla to SFTP into the credentials they provided me with. I deleted all the files in /home/rails and put my new files in from my project. Then I executed bundle install, and restarted the unicorn service. In the tutorial I had seen I can track the log of unicorn, so I executed this: tail -f /home/unicorn/log/unicorn.log

Here is the output which concerns me:

/usr/local/rvm/gems/ruby-2.0.0-p353/gems/bundler-1.3.5/lib/bundler/runtime.rb:33:in `block in setup': You have already activated rack 1.5.2, but your Gemfile requires rack 1.4.5. Using bundle exec may solve this. (Gem::LoadError)

I saw some other solutions to this, all failed. Here are the solutions I tried: Deleting my Gemfile.lock, and re bundle installing it. Going into the file and removing where it said rack. Running bundle install --binstubs. Restarting the unicorn service with bundle exec before it. The error remains the same.

I've had many different errors before, but I feel this is the closest I have gotten. If someone could explain this to me (I'm new to Rails and would like a thorough explanation) and possibly help me fix the error that would be fantastic and end this frustration.

Was it helpful?

Solution

Just a wild guess

gem "rack", "~> 1.4.5" 

May work for you, then of course bundle install afterwards.

OTHER TIPS

This solves the problem:

gem uninstall rack -v 1.5.2

Possibly reload your Ubuntu installation from the DigitalOcean control panel, then try and install Ruby on Rails with Apache and Passenger?

Install RoR

Install Passenger (skip to passenger installation)

You will have errors when first creating your site with rails new as it will try and use SQL when it won't be installed, if you wish to use MongoDB

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top