bundle install problem - ruby-on-rails

ok whenever I run "bundle install" I get this
Bundler could not find compatible versions for gem "railties":
In Gemfile:
sass-rails (~> 3.1.0.rc8) depends on
railties (~> 3.1.0)
railties (3.1.0.rc8)
now in my gem file i have this:
source 'http://rubygems.org'
gem 'rails', '3.1.0.rc8'
# Bundle edge Rails instead:
# gem 'rails', :git => 'git://github.com/rails/rails.git'
gem 'sqlite3'
gem 'json'
# Gems used only for assets and not required
# in production environments by default.
group :assets do
gem 'sass-rails', " ~> 3.1.0.rc8"
#added by me
gem 'railties', " ~> 3.1.0.rc8"
#end
gem 'coffee-rails', "~> 3.1.0.rc"
gem 'uglifier'
end
gem 'jquery-rails'
# Use unicorn as the web server
# gem 'unicorn'
# Deploy with Capistrano
# gem 'capistrano'
# To use debugger
# gem 'ruby-debug'
I am using ubuntu and I am new to ruby, I am trying to run a simple application.
Any help ? thx!

Since Rails 3.1 has been released today, you have to update your Gemfile as:
source 'http://rubygems.org'
gem 'rails', '3.1.0'
# Bundle edge Rails instead:
# gem 'rails', :git => 'git://github.com/rails/rails.git'
gem 'sqlite3'
gem 'json'
# Gems used only for assets and not required
# in production environments by default.
group :assets do
gem 'sass-rails', " ~> 3.1.0"
gem 'coffee-rails', "~> 3.1.0"
gem 'uglifier'
end
gem 'jquery-rails'
# Use unicorn as the web server
# gem 'unicorn'
# Deploy with Capistrano
# gem 'capistrano'
# To use debugger
# gem 'ruby-debug'
You do not need the railties line neither since this gem is included in rails.
Then, run bundle install. That should do the trick.

Related

openshift deployment failing rails

my openshift deployment of rails 3.2 app fails , just after it tries to precompile assets
remote: Deployment id is 7aea3738
remote: Activating deployment
remote: Precompiling with 'bundle exec rake assets:precompile'
remote: /opt/rh/ruby193/root/usr/bin/ruby /var/lib/openshift/52e891c24382ec693c000092/app- root/runtime/repo/vendor/bundle/ruby/1.9.1/
bin/rake assets:precompile:all RAILS_ENV=production RAILS_GROUPS=assets
remote: rake aborted!
remote: Please install the sqlite3 adapter: `gem install activerecord-sqlite3-adapter` (sqlite3 is not part of the bundle. Add it to
Gemfile.)
this is my gemfile
source 'http://mirror1.prod.rhcloud.com/mirror/ruby/'
source 'http://rubygems.org'
gem 'rails', '3.2.14'
gem 'bootstrap-sass', '2.1'
gem 'bcrypt-ruby', '3.0.1'
gem 'will_paginate', '3.0.3'
gem 'bootstrap-will_paginate', '0.0.6'
gem 'formtastic'
gem 'rack-cache', :require => 'rack/cache'
gem 'dragonfly', '~>0.9.15'
gem 'minitest'
gem 'thor', '= 0.14.6'
gem 'sqlite3','1.3.5'
# Bundle edge Rails instead:
# gem 'rails', :git => 'git://github.com/rails/rails.git'
group :development,:test do
gem 'sqlite3','1.3.5'
gem 'rspec-rails','2.11.0'
end
group :development do
gem 'annotate','2.5.0'
end
# Gems used only for assets and not required
# in production environments by default.
group :assets do
gem 'sass-rails', '3.2.5'
gem 'coffee-rails', '3.2.2'
gem 'uglifier','1.2.3'
# See https://github.com/sstephenson/execjs#readme for more supported runtimes
# gem 'therubyracer', :platforms => :ruby
end
gem 'jquery-rails','2.0.2'
group :test do
gem 'capybara', '1.1.2'
end
group :production do
gem 'sqlite3','1.3.5'
end
# To use ActiveModel has_secure_password
# gem 'bcrypt-ruby', '~> 3.0.0'
# To use Jbuilder templates for JSON
# gem 'jbuilder'
# Use unicorn as the app server
# gem 'unicorn'
# Deploy with Capistrano
# gem 'capistrano'
# To use debugger
# gem 'debugger'
the code works perefectly on my windows 8 development environment, i want to use persistent storage and sqlite ( i got a similar error when trying mysql also , which is why i shifted to sqlite)

ZenTest 4.9.3 shows as invalid gemspec

I keep getting this error when trying to run ZenTest
Invalid gemspec in [/usr/local/rvm/gems/ruby-1.9.3-p194/specifications/ZenTest-4.9.3.gemspec]: Illformed requirement ["< 2.1, >= 1.8"].
I have tried removing the ZenTest 4.9.3 and gem instal ZenTest 4.8.3 but that version cannot be found in any repositories so it automatically installs ZenTest 4.9.3 which keeps having an error and hence I cant run spork or autotest. Is there any way around this? Thanks!
Here is my gemfile:
source 'https://rubygems.org'
gem 'rails', '3.2.11'
gem 'spork'
gem 'rspec-core'
gem 'autotest', '4.4.6'
gem 'autotest-rails', '4.1.2'
# Bundle edge Rails instead:
# gem 'rails', :git => 'git://github.com/rails/rails.git'
group :development, :test do
gem 'sqlite3'
gem 'rspec-rails'
gem 'webrat'
gem 'capybara'
gem 'Zentest', '4.8.3'
end
group :production do
gem 'pg'
end
# 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'
# See https://github.com/sstephenson/execjs#readme for more supported runtimes
# gem 'therubyracer', :platforms => :ruby
gem 'uglifier', '>= 1.0.3'
end
gem 'jquery-rails'
# To use ActiveModel has_secure_password
# gem 'bcrypt-ruby', '~> 3.0.0'
# To use Jbuilder templates for JSON
# gem 'jbuilder'
# Use unicorn as the app server
# gem 'unicorn'
# Deploy with Capistrano
# gem 'capistrano'
# To use debugger
# gem 'debugger'
I had the same problem. After digging, I found the solution. The problem is most likely to be with the version of RubyGems installed in your system. (It would be <1.8.25)
Till that version, RubyGems didn't roundtrip gemspecs properly and thus couldn't parse "< 2.1, >= 1.8" correctly.
So, go through these steps:
gem uninstall ZenTest
gem update --system
gem install ZenTest
The problem should get solved and you should no longer receive the warnings.

Bundle install and update cannot find and install jQuery-rails 2.0.0

I'm trying to learn Rails from this website.
I'm on Windows so I used the recommended Rails-Installer. I need to have jquery-rails gem version 2.0.0 for the tutorial so in my gem file I have those:
source 'https://rubygems.org'
gem 'rails', '3.2.3'
# Bundle edge Rails instead:
# gem 'rails', :git => 'git://github.com/rails/rails.git'
group :development do
gem 'sqlite3', '1.3.5'
end
# Gems used only for assets and not required
# in production environments by default.
group :assets do
gem 'sass-rails', '~> 3.2.4'
gem 'coffee-rails', '~> 3.2.2'
# See https://github.com/sstephenson/execjs#readme for more supported runtimes
# gem 'therubyracer', :platform => :ruby
gem 'uglifier', '>= 1.2.3'
end
gem 'jquery-rails', '2.0.0'
# To use ActiveModel has_secure_password
# gem 'bcrypt-ruby', '~> 3.0.0'
# To use Jbuilder templates for JSON
# gem 'jbuilder'
# Use unicorn as the app server
# gem 'unicorn'
# Deploy with Capistrano
# gem 'capistrano'
# To use debugger
# gem 'ruby-debug19', :require => 'ruby-debug'
As it can be seen, I have gem 'jquery-rails', '2.0.0' line in Gemfile. However, when I run bundle update or bundle install I get this error:
bbundle install could not find gem ' jquery-rails (= 2.0.0) x96-mingw32' in any of the gem sources listed in your gemfile.
gem jquery-rails version '2.0.0' was yanked from rubygems
http://rubygems.org/gems/jquery-rails/versions/2.0.0
replace with
gem "jquery-rails", "~> 2.0.1"
and be happy

Rails: Sqlite3 related error when running Cucumber

Here is my gemfile:
source 'https://rubygems.org'
gem 'rails', '3.2.2'
# Bundle edge Rails instead:
# gem 'rails', :git => 'git://github.com/rails/rails.git'
group :production do
gem 'pg'
end
group :test, :development do
gem 'mysql2'
gem "cucumber-rails", "~> 1.3.0"
gem "rspec-rails", "~> 2.9.0"
gem "database_cleaner", "~> 0.7.2"
gem "factory_girl", "~> 3.0.0"
end
# 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'
# See https://github.com/sstephenson/execjs#readme for more supported runtimes
# gem 'therubyracer'
gem 'uglifier', '>= 1.0.3'
end
gem 'jquery-rails'
gem "heroku"
# To use ActiveModel has_secure_password
# gem 'bcrypt-ruby', '~> 3.0.0'
# To use Jbuilder templates for JSON
# gem 'jbuilder'
# Use unicorn as the app server
# gem 'unicorn'
# Deploy with Capistrano
# gem 'capistrano'
# To use debugger
# gem 'ruby-debug19', :require => 'ruby-debug'
And I am in Ruby 1.9.3-p125 and Rails 3.2.2.
When I do $ cucumber, I get the following error:
Please install the sqlite3 adapter: `gem install activerecord-sqlite3-adapter` (sqlite3 is not part of the bundle. Add it to Gemfile.) (LoadError)
Why would I be getting this error? I don't want to use the sqlite3 gem, and I don't know why when launching cucumber I am getting it. I can launch the server without any problems...
It might be because in your config/database.yml file the test: environment is given as adapter: sqlite3 change it to adapter: mysql2. Tell me if this is not the issue.

Rails: undefined method 'paginates_per'

I'm installing a gem called Carrier https://github.com/stanislaw/carrier/blob/master/Gemfile into a Rails 3.2.1 app. It uses Kaminari and when I did bundle install after adding gem "carrier" to my Gemfile, it showed that I was using kaminari
Using kaminari (0.13.0)
However, when I tried to rake db:migrate, I got this error
rake aborted
undefined method `paginates_per' for Carrier::Chain(Table doesn't exist):Class
Can anyone suggest a fix for this? I've copied the gemfile from the Carrier gem below and the Gemfile for my own app below that
(Carrier gem Gemfile)
source "http://rubygems.org"
gem 'require_all'
gem 'kaminari'
gem 'unread'
gem 'sugar-high'
gem 'sweetloader'
group :development, :test do
gem 'rails', '~> 3.1.0'
gem 'unicorn'
gem 'mysql2'
gem 'devise'
gem 'rake-kit'
gem 'cutter'
gem "jeweler", ">= 1.6.4"
gem "rspec-rails", '>= 2.5'
end
group :test do
gem 'capybara'
gem 'factory_girl'
gem 'spork'
gem "launchy"
gem 'shoulda'
end
Gemfile for my starter app
source 'https://rubygems.org'
gem 'rails', '3.2.1'
# Bundle edge Rails instead:
# gem 'rails', :git => 'git://github.com/rails/rails.git'
gem 'pg'
gem 'devise'
gem 'carrier'
# 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'
# See https://github.com/sstephenson/execjs#readme for more supported runtimes
# gem 'therubyracer'
gem 'uglifier', '>= 1.0.3'
end
gem 'jquery-rails'
# To use ActiveModel has_secure_password
# gem 'bcrypt-ruby', '~> 3.0.0'
# To use Jbuilder templates for JSON
# gem 'jbuilder'
# Use unicorn as the web server
# gem 'unicorn'
# Deploy with Capistrano
# gem 'capistrano'
# To use debugger
# gem 'ruby-debug19', :require => 'ruby-debug'
Update These are the migrations it installed when I ran install:migrations
rake carrier:install:migrations
Copied migration 20120229055640_create_messages.carrier.rb from carrier
Copied migration 20120229055641_create_chains.carrier.rb from carrier
Update
I tried to reinstall it again on another git branch it this time I got a slightly different error when I ran rake db:migrate
rake aborted!
undefined method `acts_as_readable' for Carrier::Message(Table doesn't exist):Class
Tasks: TOP => db:migrate => environment
(See full trace by running task with --trace)
You appear to be missing some database backing for what Carrier is trying to do. From the Carrier readme, it looks like you need to run rake carrier:install:migrations before running db:migrate. Have you done that?

Resources