Trouble upgrading to rails 2.3.15 with rack 1.1.3 - rack

I'm getting the following error when trying to fire up script/console for my rails 2.3.15 app, after upgrading from rails 2.3.5. Does this mean the issue is with bundler 1.2.1 is not compatible with rack 1.1.3? Any help would be appreciated immensely.
usr/lib/ruby/gems/1.8/gems/bundler-1.2.1/lib/bundler/rubygems_integration.rb:157:in gem': can't activate rack (~> 1.0.1), already activated rack-1.1.3. Make sure all dependencies are added to Gemfile. (Gem::LoadError)
from /home/developer/bigpink/vendor/rails/actionpack/lib/action_controller.rb:34
from /home/developer/bigpink/vendor/rails/activesupport/lib/active_support/dependencies.rb:156:inrequire'
from /home/developer/bigpink/vendor/rails/activesupport/lib/active_support/dependencies.rb:156:in require'
from /home/developer/bigpink/vendor/rails/activesupport/lib/active_support/dependencies.rb:521:innew_constants_in'
from /home/developer/bigpink/vendor/rails/activesupport/lib/active_support/dependencies.rb:156:in require'
from /home/developer/bigpink/vendor/rails/railties/lib/commands/server.rb:2
from script/server:3:inrequire'
from script/server:3

In my case, problem solved by the following steps:
Deleted the directory $PROJECT_ROOT/vendor/rails
Modified RAILS_GEM_VERSION in config/environment.rb

we used this process to upgrade Rails to 3.2.11 on our Heroku apps (as reported here)
stop – your Ruby on Rails (RoR) server
edit – appropriate line in gem file to read [one of]:
gem ‘rails’, ’3.2.11′
gem ‘rails’, ’3.1.10′
gem ‘rails’, ’3.0.19′
gem ‘rails’, ’2.3.15′
run – gem update
run – bundle update
run - bundle install
test – rspec # or test-driven dev’t framework of choice
launch – rails s
test – # interact with Rails server & explore if all is well
run – git add .
run – git commit -a -m “upgrade Rails server to ver. [x.y.z]“
run - git push # to github or rcs of choice
run - git push heroku # or to deployment server of choice

Related

Rails v6.0.0 push to Heroku fails - Rake & Bundler error msgs

This is my first attempt to push a Rails v6.0.0 app to Heroku. The error msgs are:
Could not detect rake tasks
ensure you can run `$ bundle exec rake -P` against your app
and using the production group of your Gemfile.
Activating bundler (2.0.1) failed:
Could not find 'bundler' (2.0.1) required by your /tmp/build_94b6a9e04d812c465a5480f59429532e/Gemfile.lock.
To update to the latest version installed on your system, run `bundle update --bundler`.
To install the missing version, run `gem install bundler:2.0.1`
Checked in 'GEM_PATH=vendor/bundle/ruby/2.5.0', execute `gem env` for more information
To install the version of bundler this project requires, run `gem install bundler -v '2.0.1'`
I can run 'bundle exec rake -P', no problem.
I have verified that bundler 2.0.1 is installed, no problem.
Suggestions?
A similar bugreport on the bundler repo mentions that bundler 2.0.1 conflicts with heroku. I've copied the following fix instructions from that comment:
gem install bundler -v 2.0.2
bundle update --bundler
commit & push Gemfile.lock changes in your repo
deploy with git push heroku master

How map mongodb on ruby and rails

I am practice on ruby on rails 4 and using mongodb database,I am trying to work follow this site to connect database : http://mongoid.org/en/mongoid/docs/documents.html
However, when I worked this step this occur error:
rails g mongoid:config
error:
Bundler could not find compatible versions for gem "activemodel":
In snapshot (Gemfile.lock):
activemodel (4.1.1)
In Gemfile:
mongoid (~> 3.1.6) x86-mingw32 depends on
activemodel (~> 3.2) x86-mingw32
Running `bundle update` will rebuild your snapshot from scratch, using only
the gems in your Gemfile, which may resolve the conflict.
I am also try the command bundel update but it has that error:
sorry I am new bie on ruby and rails and mongodb, so I hope there is any easy guide to follow.
thankyou
Try skipping ActiveRecord when creating your app.
rails new my_app -O
I had this problem using the following:
gem 'rails', '4.1.1'
gem 'mongoid', '~> 4.0.0'
Skipping ActiveRecord solved that error.

rvmrc specifies 1.9.3 but bundle install --deployment uses 1.9.1? why so?

My rails app (myapp) has a .rvmrc containing
# cat .rvmrc
rvm --create use ruby-1.9.3-p0#myapp
When I deploy my app using capistrano in production (which works fine)...
#cat deploy.rb
require 'bundler/capistrano'
require 'rvm/capistrano'
...
#cap deploy
I noticed bundle install --deployment installs the gems in the shared/bundle directory which is fine.
* executing "cd /usr/local/mycompany/myapp/releases/20130523003402 &&
bundle install --gemfile /usr/local/mycompany/myapp/releases/20130523003402/Gemfile
--path /usr/local/mycompany/myapp/shared/bundle
--deployment
--quiet
--without development test"
Im just curious why the ruby version that bundle uses is 1.9.1. Shouldn't it pick up 1.9.3 as specified in my .rvmrc?
/usr/local/mycompany/myapp/shared/bundle/ruby/1.9.1
1.9.1 is ruby compatibility level, all 1.9..* rubies are supposed to be compatible so theoretically it should be safe to use gems from ruby 1.9.2 in ruby 1.9.3, in practice there is more factors then just ruby version - but being careful you could share gems between ruby versions.

Installing redmine_contacts plugin for bitnami_redmine

I am trying to install redmine_contacts plugin for my redmine 2.2.3.0 (which is installed using BITNami installer), as in readme.rdoc:
Copy redmine_contacts plugin to {RAILS_APP}/plugins on your redmine path
Run bundle install --without development test RAILS_ENV=production
Run rake redmine:plugins NAME=redmine_contacts RAILS_ENV=production
The first two steps was successful, but last executing last command, following error would occur:
(in /home/.../redmine-2.2.3-0/apps/redmine/htdocs)
Could not find sprockets-2.2.1 in any of the sources
Run bundle install to install missing gems.
To see if the sprockets library is installed by executing command: #bundle show sprockets, it shows a newer version of this library is installed:
/var/lib/gems/1.8/gems/sprockets-2.2.2
I think somehow the BitNami version of gem which is installed is not compatible with the sprockets-2.2.2 on the system and it requires 2.2.1. Maybe you should change to that version.
Try something like:
gem install sprockets -v 2.2.1

Rails 3.1 - Pushing to Heroku - Errors installing postgres adapter?

I just upgraded to Rails 3.1 and the first app i've tried to deploy to Heroku has encountered a problem relating to Postgres adapter. I'm able to push the app to heroku but then when i try to migrate the database i get the following error:
heroku rake db:migrate
rake aborted!
Please install the postgresql adapter: `gem install activerecord-postgresql-adapter`
(pg is not part of the bundle. Add it to Gemfile.)
Tasks: TOP => db:migrate => db:load_config
(See full trace by running task with --trace)
when I try their suggested install i get:
ERROR: Could not find a valid gem 'activerecord-postgresql-adapter' (>= 0) in any repository
ERROR: Possible alternatives: activerecord-postgis-adapter, activerecord-jdbcpostgresql-adapter, activerecord-postgresql-cursors, activerecord-jdbcmysql-adapter, activerecord-jdbcmssql-adapter
which already seems weird... so what exact gem should I install to get this thing working if not what they say I should install??
When I try installing gem pg i get:
Building native extensions. This could take a while...
ERROR: Error installing pg:
ERROR: Failed to build gem native extension.
/Users/jerometufte/.rvm/rubies/ruby-1.9.2-p180/bin/ruby extconf.rb
checking for pg_config... no
No pg_config... trying anyway. If building fails, please try again with
--with-pg-config=/path/to/pg_config
checking for libpq-fe.h... no
Can't find the 'libpq-fe.h header
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of
necessary libraries and/or headers. Check the mkmf.log file for more
details. You may need configuration options.
Provided configuration options:
--with-opt-dir
...
I'm using SQLite3 currently. Any help greatly appreciated, this is baffling me.
Option 1:
Add pg to your Gemfile but skip trying to install it locally.
$ cat Gemfile
...
group :production do
# gems specifically for Heroku go here
gem "pg"
end
# Skip attempting to install the pg gem
$ bundle install --without production
Option 2 (Debian/Ubuntu):
Add pg to your Gemfile but first install the prerequisites.
$ cat Gemfile
...
group :production do
# gems specifically for Heroku go here
gem "pg"
end
# Install the pg gem's dependencies first
$ sudo apt-get install libpq-dev
# Then install the pg gem along with all the other gems
$ bundle install
You definitely need pg in the Gemfile for Heroku.
About the error you're getting locally: make sure you have postgres installed, run gem install pq -- --with-pg-config=[path to wherever your pg-config binary is], then bundle install.
Alternatively, if your local database is working fine (either because you're using sqlite or postgres-pr), you could put the gem 'pg' line in your Gemfile in a group called production, then bundle install --without production locally.
More up-to-date info: It had something to do with a different version of pg gem locally.
I already had pg in a production group (I run sqllite locally), but Heroku was still puking.
The problem went away for my new Rails 3.1 app when I:
rm Gemfile.lock
touch Gemfile
bundle install
git add .
git commit -am "wiped Gemfile.lock re-ran bundle install"
git push heroku master
worked like a charm when I then ran heroku run rake db:migrate