Having trouble installing Autotest in Rails in Ubuntu 10.10 enviroment - ruby

I'm learning how to program in Rails. I'm a complete newbie, and I'm learning from the screen-cast "Rails Tutorial: Learn by Example" by Michael Hartl.
I've been doing pretty well, until I've come to this obstacle, and I don't know how to figure it out. It's a bit frustrating to be frank, and I'd like to move forward with Rails & start making stuff :)
I installed RubyGems 1.8.5 by hitting:
$ gem update --system
and then installed ZenTest gem by hitting:
$ sudo gem install ZenTest
then I installed auto-test rails gem by hitting:
$ sudo gem install autotest-rails
and so got the message
Successfully installed autotest-rails-4.1.0
1 gem installed
Installing ri documentation for autotest-rails-4.1.0...
Installing RDoc documentation for autotest-rails-4.1.0...
So all was lookin' fine and dandy. I navigated to my app folder, and hit
$ autotest
and then got the message
/usr/local/lib/ruby/1.9.1/rubygems.rb:762:in `report_activate_error': Could not find RubyGem ZenTest (>= 0) (Gem::LoadError)
from /usr/local/lib/ruby/1.9.1/rubygems.rb:219:in `activate'
from /usr/local/lib/ruby/1.9.1/rubygems.rb:1065:in `gem'
from /usr/local/bin/autotest:18:in `<main>'
I've tried searching for an answer to why this is happening, but I can't find any. Please help me solve this problem. I'd like to move forward with learning Rails :)
EDIT Maybe I should also mention that I have RSpec installed already -- I don't know if that's of any significance -- giving you a better understanding as to whats going on with my problem -- but I thought I'd just put it out there.
Cheers.

Are you using Rails 3+? If so look for a file called Gemfile inside the rails app root directory. Open it up, add:
gem 'ZenTest'
gem 'autotest-rails'
Save, exit and then run from command line:
bundle
After this try rerunning autotest

I'm at the same point of learning RoR (in this case RoR 3.0.3, Ruby 1.9.2p180, Ubuntu 11.04). I'm also stymied by the lack of consistency. In my case:
$ "You don't have i18n installed in my application. Please add it to your Gemfile and run bundle install".
Gemfile:
gem 'ZenTest'
gem 'autotest-rails'
gem 'i18n'
$bundle install => OK
$bundle show i18n => <ruby path>/gems/i18n-0.6.0
$autotest => (same result)
Any ideas? This is NOT going to help RoR adoption, if it's so obtuse to load a basic TDD environment. (I'll step off my soapbox now.)

try in command line "bundle install"

Related

`default_gemfile': Could not locate Gemfile (Bundler::GemfileNotFound)

I am new to the ruby on merb, using ruby 1.8.7 version. while run the app it showing like this
`default_gemfile': Could not locate Gemfile (Bundler::GemfileNotFound)
from /home/subrahmanyam/.rvm/gems/ruby-1.8.7-p374#global/gems/bundler-1.5.3/lib/bundler.rb:242:in `default_gemfile'
from /home/subrahmanyam/.rvm/gems/ruby-1.8.7-p374#global/gems/bundler-1.5.3/lib/bundler.rb:188:in `root'
from /home/subrahmanyam/.rvm/gems/ruby-1.8.7-p374#global/gems/bundler-1.5.3/lib/bundler.rb:98:in `bundle_path'
from /home/subrahmanyam/.rvm/gems/ruby-1.8.7-p374#global/gems/bundler-1.5.3/lib/bundler.rb:395:in `configure_gem_home_and_path'
from /home/subrahmanyam/.rvm/gems/ruby-1.8.7-p374#global/gems/bundler-1.5.3/lib/bundler.rb:89:in `configure'
from /home/subrahmanyam/.rvm/gems/ruby-1.8.7-p374#global/gems/bundler-1.5.3/lib/bundler.rb:150:in `definition'
from /home/subrahmanyam/.rvm/gems/ruby-1.8.7-p374#global/gems/bundler-1.5.3/lib/bundler.rb:115:in `setup'
from /usr/bin/merb:10
when i am trying to install ' rvm rubygems 1.4.2 ' it shows followed message like
Installed rubygems 2.0.14 is newer then 1.4.2, skipping installation, use --force to force installation'
This is to request you to provide the solution at the earliest possible. Please help me.
Thanks in advance
If you are new to Ruby you shouldn't use 1.8.7. Its no longer supporter and you will run into problems beyond the one you are having right now. Upgrade to Ruby 2.1.1:
rvm get stable
rvm install 2.1.1
Then locate your project and install your gems by running:
bundle install
I was having this issue trying to get TextMate 2 working with the Cucumber bundle from
https://github.com/cucumber/cucumber-tmbundle
I'm using rvm integration with TM_RUBY set to my .rvm/bin/rvm_auto_ruby, but the cucumber not be resolved. I ended up hard coding BUNDLE_GEMFILE and GEM_HOME into the 'Run Feature' and 'Run Single Scenario' commands:
ENV['BUNDLE_GEMFILE'] = ENV['TM_PROJECT_DIRECTORY'] + '/Gemfile'
ENV['GEM_HOME'] = '/Users/my/.rvm/gems/ruby-1.9.3-p448#monaco-mongoid3'
Anyways, hope that helps someone else.

binding_of_caller gem not being invoked in Rails 4

I really like the better_errors gem in development and on my os x machine get the REPL to appear. Now I'm learning the vagaries of Windows XP and find that while better_errors works, the REPL does not appear, helpfully suggesting I install the binding_of_caller gem. Starting from a RailsApp starter my gemfile shows the below:
group :development do
gem 'better_errors'
gem 'binding_of_caller', :platforms=>[:mri_19, :mri_20, :rbx]
gem 'quiet_assets'
gem 'rails_layout'
end
I'm running Ruby 2.0.0-p353 using pik 0.3.0 pre. I have run gem install binding_of_caller and I saw no errors installing. Here's my output of bundle show _binding_of_caller_
Could not find gem 'binding_of_caller' Did you mean binding_of_caller?
I've commented out the call to the platforms in the GemfileOK, but the REPL is still not loading.
my Windows fu is not very bright, but I haven't found anything on Google that would suggest a solution. Reading up on the github page suggests I'm not doing anything wrong. What should I try next? thanx, sam
I've just moved my app to a new Win7 machine. Unfortunately, binding_of_caller is still not being raised, though it works fine on my OS X machine. So there's something on Windows I'm not doing right.

Unresolved specs during Gem::Specification.reset:

When launching Guard, I'm getting this output:
$ guard
WARN: Unresolved specs during Gem::Specification.reset:
lumberjack (>= 1.0.2)
ffi (>= 0.5.0)
WARN: Clearing out unresolved specs.
Please report a bug if this causes problems.
What does this mean, and how do I fix it?
Contents of Guardfile:
guard 'livereload' do
watch(%r{.+\.(css|js|html)$})
end
guard 'sass', :input => 'css', :style => :compressed, :extension => '.min.css'
I was seeing this issue by just running RSpec on its own. From what I understand, this means that you have more than one version of the listed gems installed on your system, and RSpec is unsure which one to use. After uninstalling older version of the gems, the warnings went away.
You can try:
gem cleanup lumberjack
Or:
gem list lumberjack
gem uninstall lumberjack
If you're using Bundler, you can try bundle exec guard (or in my case bundle exec rspec).
Using the following command solved it for me:
bundle clean --force
See guard-and-unresolved-specs for more info
Use Bundler. Call bundle exec guard, not guard.
FYI:
gem cleanup
worked for me.
$ gem cleanup
Cleaning up installed gems...
Attempting to uninstall builder-3.2.2
Successfully uninstalled builder-3.2.2
Attempting to uninstall amatch-0.3.0
Successfully uninstalled amatch-0.3.0
Attempting to uninstall tins-1.12.0
Successfully uninstalled tins-1.12.0
Clean Up Complete
This worked for me:
bundle clean --force
then
bundle install
to reinstall gems.
I use gem list gem-name; gem uninstall gem-name to clean the gem one by one because of the dependency. After that, the error does not show again.
add
'bundle exec'
before your command.
I use ruby 2.4 and got the same problem when deploying jekyll on windows, it fixed.
I was getting this message while running Rspec within a Guard plugin gem, using bundle exec rspec. It turned out to be a missing line in the gemspec file:
$:.push File.expand_path("../lib", __FILE__)
This line is normally at the top of the file (in many of the gems I have recently been working in) and I had commented it out to see why.
Remember, if you want to use guard, you have to add gem guard to Gemfile.
group :developement, :test do
gem 'guard'
end
Then, run
bundle install
I hope this can help you.
If anyone has come this far and still hasn't found the answer I leave you with this. gem update --system. I tried all of these other answers to no avail. Hopefully this works for you.
Try gem uninstall <gem>
and it will remove all younger versions of gem.
You will then be asked
"If you remove this gem, these dependencies will not be met. Continue
deleting? [YN]"
Select the answer
"no"
to leave the latest version of gem and all dependencies remain valid.

Running padrinorb after installing says "Could not find padrino-core"

EDIT:
False alarm.
I was able to resolve the issue. Apparently I was to sudo happy and that broke the install of the gem.
I had to gem uninstall padrino, then gem install padrino.
Now it works flawlessly.
BTW, padrinorb is shaping up to be a nice balance between Sinatra and Rails.
// original post below:
Not sure what I did wrong.
I'm trying to test out Padrino, however I'm running into an issue straight away.
I'm following the steps starting with sudo gem install padrino adding sudo for good measure.
Then following along I did padrino g project myapp -d datamapper -b as their site states.
The problem is that it returns an error, so I decided to just run padrino as is with no args.
Error as well (it's long):
$ padrino
/Users/viper1092/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/site_ruby/1.9.1/rubygems/dependency.rb:247:in `to_specs': Could not find padrino-core (>= 0) amongst [RedCloth-4.2.9, RedCloth-4.2.8, actionmailer-3.2.3, actionpack-3.2.3, activemodel-3.2.3, activerecord-3.2.3, activeresource-3.2.3, activesupport-3.2.3, addressable-2.2.7, albino-1.3.3, arel-3.0.2, blankslate-2.1.2.4, builder-3.0.0, bundler-1.1.3, bundler-1.0.22, chunky_png-1.2.5, chunky_png-1.2.1, classifier-1.3.3, coffee-rails-3.2.2, coffee-script-2.2.0, coffee-script-source-1.3.1, compass-0.12.1, compass-0.11.5, crack-0.1.8, daemons-1.1.3, directory_watcher-1.4.1, directory_watcher-1.4.0, erubis-2.7.0, eventmachine-0.12.10, execjs-1.3.0, faraday-0.7.6, fast-stemmer-1.0.1, fast-stemmer-1.0.0, ffi-1.0.11, ffi-1.0.9, fssm-0.2.9, fssm-0.2.7, haml-3.1.4, haml-3.1.2, heroku-2.24.1, heroku-2.20.1, hike-1.2.1, httparty-0.7.8, i18n-0.6.0, jekyll-0.11.2, jekyll-0.11.0, journey-1.0.3, jquery-rails-2.0.2, json-1.6.6, json-1.5.4, koala-1.3.0, kramdown-0.13.5, kramdown-0.13.3, launchy-2.1.0, launchy-2.0.5, liquid-2.3.0, liquid-2.2.2, mail-2.4.4, maruku-0.6.0, mime-types-1.18, mime-types-1.17.2, multi_json-1.2.0, multi_json-1.0.3, multipart-post-1.1.5, netrc-0.7.1, polyglot-0.3.3, posix-spawn-0.3.6, pygments.rb-0.2.11, pygments.rb-0.1.3, rack-1.4.1, rack-1.3.2, rack-cache-1.2, rack-protection-1.2.0, rack-ssl-1.3.2, rack-test-0.6.1, rails-3.2.3, railties-3.2.3, rake-0.9.2.2, rake-0.9.2, rb-fsevent-0.9.1, rb-fsevent-0.4.3.1, rdiscount-1.6.8, rdoc-3.12, rest-client-1.6.7, rubypants-0.2.0, rubypython-0.5.3, rubypython-0.5.1, rubyzip-0.9.7, rubyzip-0.9.6.1, sass-3.1.15, sass-3.1.5, sass-rails-3.2.5, sinatra-1.3.2, sinatra-1.2.6, sprockets-2.1.2, sqlite3-1.3.5, stringex-1.3.2, stringex-1.3.0, syntax-1.0.0, term-ansicolor-1.0.7, thin-1.2.11, thor-0.14.6, tilt-1.3.3, tilt-1.3.2, treetop-1.4.10, tzinfo-0.3.33, uglifier-1.2.4] (Gem::LoadError)
from /Users/viper1092/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/site_ruby/1.9.1/rubygems/dependency.rb:256:in `to_spec'
from /Users/viper1092/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/site_ruby/1.9.1/rubygems.rb:1210:in `gem'
from /Users/viper1092/.rvm/rubies/ruby-1.9.2-p290/bin/padrino:18:in `<main>'
Then if I take a look at gem list:
$ gem list
*** LOCAL GEMS ***
polyglot (0.3.3)
posix-spawn (0.3.6)
pygments.rb (0.2.11, 0.1.3)
Those are the only "p"s I have.
When I ran sudo gem install padrino initially:
Successfully installed padrino-mailer-0.10.6
Successfully installed bundler-1.1.3
Successfully installed padrino-gen-0.10.6
Successfully installed padrino-cache-0.10.6
Successfully installed padrino-admin-0.10.6
Successfully installed padrino-0.10.6
21 gems installed
I'm on Mac OS X 10.7.3 running RVM 1.10.2 with ruby 1.9.2 selected.
I've tried just gemming Padrino 3 times as gem install padrino with no sudo just for fun and it reports that it installs, but padrino (with or without args) fails with same error. Again, running gem list does not mention padrino or padrino-core.
Any advice?
(I have the full verbosity and it's quite lengthy)
I was able to resolve the issue. Apparently I was to sudo happy and that broke the install of the gem.
I had to gem uninstall padrino, then gem install padrino.
Now it works flawlessly.
I suppose sudo installing changes some system-wide /usr deal, idk.
Thanks if you looked over my question.
BTW, padrinorb is shaping up to be a nice balance between Sinatra and Rails.

Why does my Rails app not see installed gems?

Running Ubuntu 10, RVM, Passenger and apache2. Trying to configure and get Redmine running.
First, I set my default Ruby binary to /usr/local/rvm/rubies/ruby-1.9.2-p180/bin/ruby. That's the output of which ruby. Output of which gem is /usr/local/rvm/rubies/ruby-1.9.2-p180/bin/gem. I think that side of things is set up properly.
I know Passenger is running, because I'm getting an error screen, with this error:
Error message:
Missing the i18n 0.4.2 gem. Please gem install -v=0.4.2 i18n
Update The error that passenger is producing is coming from the boot.rb file. I went and made a gist of the application's boot.rb file.
When I do check to see if that gem is installed, here's the output.
# gem list
# ... list truncated ...
# i18n (0.4.2)
(full gist of installed gems here)
Really? Let's first make sure passenger.conf is going to the right Ruby installation...
passenger.conf
PassengerRuby /usr/local/rvm/rubies/ruby-1.9.2-p180/bin/ruby
>:| So now, I go onto SSH into the application directory, and what have you, script/server starts normally. I'm a little more than confused. Clearly the Ruby installation that Passenger is configured to has the Gem it says is missing, installed, and additionally, the application doesn't falter on a start up. Which makes me think it's a Passenger problem.
Using RVM with Passenger is a bit complicated, maybe this link about using Ruby and Passenger will help.

Resources