Not sure what's going on, but I can't get autotest to work with rails 3. I'm using ruby 1.9.2-head and Rails 3.0.0 and I have all of the relevant gems installed. I'm declaring them in my gemfile like this:
group :development do
gem 'rspec-rails', '2.0.0.beta.18'
gem 'annotate-models', '1.0.4'
gem 'autotest'
gem 'autotest-rails'
gem 'autotest-growl'
gem 'autotest-fsevent'
end
When I try to run the autotest command I'm getting the following error:
enter code hereError loading Autotest style autotest/rails_rspec2 (no such file to load -- autotest/rails_rspec2). Aborting.
I just figured out that I can run "bundle exec autotest" instead of just "autotest" and it works, but I have no idea why this is.
The gem rspec-rails is now at least at beta22, and while it had problems with autotest it should now be fixed. I can run autotest without having to do bundle exec. So you should adapt your gemfile to allow using the latest version.
So write something like
group :development, :test do
gem "rspec-rails", ">= 2.0.0.beta.18"
gem "autotest"
end
The autotest-rails is no longer needed.
Related
After adding these 3 gems:
gem 'carrierwave', '0.10.0'
gem 'mini_magick', '3.8.0'
gem 'fog', '1.26.0'
And then I did bundle exec rake db:migrate, I got:
Add this to your Gemfile: gem 'net-ssh' and run bundle install after that. Looks like the particular version of fog you are using is missing the dependency. This is a known bug that has already been fixed in successive versions of the gem.
I'm a beginner programmer and I'm trying to run the Rails Server through my command line. I type in "rails server" in my command line, and receive this error:
Could not find gem 'sqlite3-ruby (= 1.2.5, runtime)' in any of the gem sources listed in your Gemfile.
Run `bundle install` to install missing gems.
After receiving this error, I run 'bundle install'. Once I run 'bundle install', I type in "rails server" in my command line and receive the same error:
Could not find gem 'sqlite3-ruby (= 1.2.5, runtime)' in any of the gem sources listed in your Gemfile.
Run `bundle install` to install missing gems.
Here's a copy of my GemFile:
source 'http://rubygems.org'
gem 'rails', '3.0.9'
# Bundle edge Rails instead:
# gem 'rails', :git => 'git://github.com/rails/rails.git'
gem 'sqlite3-ruby', '1.2.5', :require => 'sqlite3'
# Use unicorn as the web server
# gem 'unicorn'
# Deploy with Capistrano
# gem 'capistrano'
# To use debugger (ruby-debug for Ruby 1.8.7+, ruby-debug19 for Ruby 1.9.2+)
# gem 'ruby-debug'
# gem 'ruby-debug19', :require => 'ruby-debug'
# Bundle the extra gems:
# gem 'bj'
# gem 'nokogiri'
# gem 'sqlite3'
# gem 'aws-s3', :require => 'aws/s3'
# Bundle gems for the local environment. Make sure to
# put test-only gems in this group so their generators
# and rake tasks are available in development mode:
# group :development, :test do
# gem 'webrat'
# end
Can someone help me get my rails server up and running? Thanks!
try deleting the "1.2.5" in your gemfile so the line looks like:
gem 'sqlite3-ruby', :require => 'sqlite3'
then run
bundle install
again
I think I once got this error a long time ago - it had something to do with having sqlite.dll in my bin or lib folder in my computer's ruby dir or something like that. I think Michael Hartl's tutorial mentions something about it.
Have you tried just
gem 'sqlite3'
You might also want to confirm that your gem is properly installed in your environment:
gem list
You can also get more information about a specific gem:
gem specification sqlite3-ruby
I am assuming that you have no issues with installing other gems - that is, you don't need to set up a http_proxy environment variable for bundle install.
I ran a bundle install on my Gemfile recently, and tried to rake:db:migrate. This migration didn't work, and outputs:
WARNING: Global access to Rake DSL methods is deprecated. Please include
... Rake::DSL into classes and modules which use the Rake DSL methods.
WARNING: DSL method SampleApp::Application#task called at /Users/joshuaballoch/.rvm/gems/ruby-1.9.2-p180#rails3tutorial3/gems/railties-3.0.3/lib/rails/application.rb:214:in `initialize_tasks'
I read on another post that I should uninstall 0.9.1, but for some reason some gem I have requires 0.9.1 after the uninstall, so I don't know how to fix this. Any suggestions?
FYI my gemfile is:
source 'http://rubygems.org'
gem 'rails', '3.0.3'
gem 'sqlite3-ruby', '1.3.2', :require => 'sqlite3'
gem 'gravatar_image_tag', '1.0.0.pre2'
gem 'will_paginate', '3.0.pre2'
group :development do
gem 'rspec-rails', '2.3.0'
gem 'annotate-models', '1.0.4'
gem 'faker', '0.3.1'
end
group :test do
gem 'rspec', '2.3.0'
gem 'webrat', '0.7.1'
gem 'factory_girl_rails', '1.0'
end
Have you tried running it like so: bundle exec rake db:migrate
the bundle exec command runs your request in the environment defined by the bundle, so if your global gems differ this may help.
If not, you can add gem "rake", "0.8.7" to your gemfile, bundle install then try again. Your other dependency should still be met as you aren't removing 0.9.1, just asking bundle exec to use a different version.
Rails 3.0.8 was released yesterday, and includes "Fixing Rake 0.9.x integration". Worth a try.
I am trying to learn rails from http://ruby.railstutorial.org/
Exercise 3 explains to install rspec, rspec-rails, and webrat using this gemfile
source 'http://rubygems.org'
gem 'rails', '3.0.6'
gem 'sqlite3', '1.3.3', :require => 'sqlite3'
group :development do
gem "rspec-rails", ">= 2.0.1"
end
group :test do
gem "rspec-rails", ">= 2.0.1"
gem 'rpsec'
gem 'webrat'
end
i have tried to install rspec-rails and webrat and they seem to have installed correctly.
C:\RubyProject\sample_app>gem install rspec-rails -v=2.0.1
**************************************************
Thank you for installing rspec-rails-2.0.1!
This version of rspec-rails only works with versions of rails >= 3.0.0
To configure your app to use rspec-rails, add a declaration to your Gemfile.
If you are using Bundler's grouping feature in your Gemfile, be sure to include
rspec-rails in the :development group as well as the :test group so that you
can access its generators and rake tasks.
group :development, :test do
gem "rspec-rails", ">= 2.0.1"
end
Be sure to run the following command in each of your Rails apps if you're
upgrading:
script/rails generate rspec:install
Even if you've run it before, this ensures that you have the latest updates
to spec/spec_helper.rb and any other support files.
Beta versions of rspec-rails-2 installed files that are no longer being used,
so please remove these files if you have them:
lib/tasks/rspec.rake
config/initializers/rspec_generator.rb
Lastly, be sure to look at Upgrade.markdown to see what might have changed
since the last release.
**************************************************
Successfully installed rspec-rails-2.0.1
1 gem installed
Installing ri documentation for rspec-rails-2.0.1...
Installing RDoc documentation for rspec-rails-2.0.1...
But when i run bundle install
I get the following error message
Could not find gem 'rpec-rails (= 2.0.1)' in any of the gem sources listed in your Gemfile.
So me being a total newbie to RoR has no idea why this is occurring. I have tried following this link
http://railsforum.com/viewtopic.php?id=41464
which seems to be a dead end. I'm hoping that someone here can point me in the right direction. Any help would be appreciated.
If your output is correct:
Could not find gem 'rpec-rails (= 2.0.1)' in any of the gem sources listed in your Gemfile.
Then it looks like you've got a typo in your gem file. You've installed the gem, but it won't bundle with the app since you didn't spell rspec-rails correctly. Check your declarations in the gem file.
It is an annoying word to spell.
I noticed your :test group contains a typo: rpsec instead of rspec.
I can't get rSpec installed for Rails 3.
I'm running Ruby -v=1.8.7, Rails -v=3.0.0.beta4
So far I have..
git clone git://github.com/indirect/rails3-generators.git lib/generators
My GemFile :
group :test do
gem 'rspec'
gem 'rspec-rails'
gem "factory_girl"
gem 'cucumber-rails'
end
I ran :
bundle install
Then :
rails g rspec:install
I get :
Could not find generator rspec:install.
You might need to list rspec-rails as part of the development group as well:
group :test, :development do
gem 'rspec-rails'
end
I just solved this same issue using Ruby 1.8.7 and Rails 3.0.3
I had to run sudo gem update, which updated bundler and then rails generate rspec:install worked for me.
Hmm..I'm under the impression people might have solved this in other ways, but I just chose Rspec 2 for Rails 3 and it seems to have installed right.
My Gemfile:
gem 'rspec-rails', '2.0.0.beta.7'