开发者

Heroku deployment using Mongo

开发者 https://www.devze.com 2023-02-03 17:02 出处:网络
Can someone tell me what I am doing wrong? I am trying to push a simple rails app to Heroku that uses MongoDB. My Gemfile contains the following line:

Can someone tell me what I am doing wrong? I am trying to push a simple rails app to Heroku that uses MongoDB. My Gemfile contains the following line:

gem "mongo"

When pushing the app to Heroku it error's out with: no such file to load -- mongo

-----> Heroku receiving push
-----> Rails app detected
-----> Detected Rails is not set to serve static_assets
       Installing rails3_serve_static_assets... done
-----> Gemfile detected, running Bundler version 1.0.3
       Unresolved dependencies detected; Installing...
       /usr/ruby1.8.7/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require': no such file to load -- mongo (LoadError)

Here is my whole gemfile:

require 'rubygems'
require 'mongo'
source开发者_JAVA技巧 'http://gemcutter.org'

gem "rails", "3.0.0"
#gem 'rails', :git => 'http://github.com/rails/rails.git'

gem "mongo_mapper"
gem 'mongoid', '2.0.0.beta.20'
gem 'devise', :git => 'git://github.com/plataformatec/devise.git'
gem 'heroku', '1.13.7'


# Bundle edge Rails instead:
# gem 'rails', :git => 'git://github.com/rails/rails.git'


You dont need either of these lines in your Gemfile:

require 'rubygems'
require 'mongo'

Neither of those are required for bundler to update or install your gems.

Also, is there a reason why you're installing both mongoid and mongo_mapper?


Perhaps another approach that you can use, is to use something like https://mongolab.com, connect you application with the database on the cloud, and then make the deployment (only the rails application).I've been using MongoLabs for a while, and works pretty good, you can check your collections directly from there (you don't need to use the JS shell). This is just a suggestion, to make the deployment easier :)

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号