What does this Cucumber error message mean? - ruby-on-rails

I run cucumber features and get:
Using the default profile...
can't activate builder (~> 2.1.2, runtime) for
["activemodel-3.0.5", "actionpack-3.0.5", "railties-3.0.5"],
already activated builder-3.0.0 for
["cucumber-0.10.2"] (Gem::LoadError)
What is wrong here and how can I fix it? Thanks.

It means you have builder 3.0.0 installed and loaded while rails needs 2.1.x.
Try
$ gem uninstall builder
followed by
$ bundle
(assuming you're using bundler).
If you're not, do
$ gem install builder --version "<2.2"
HTH.

Related

An error occurred while installing autoprefixer-rails (6.2.2). Additionally it say's "autoprefixer-rails requires ruby version >= 2.0. "

Im facing this problem when i'm installing bunder using command "bunlde install"
Initially i tried solving this issue by using following command
gem install autoprefixer-rails -v '6.2.2'
but again it said "autoprefixer-rails requires ruby version >= 2.0."
when i type
"ruby -v", my ruby version shows 2.3.0.
Next i have tried adding
ruby '2.3.0' to my gem file, then there was a conflict saying your ruby version is 1.9.3 but your gem file has 2.3.0
Need help how to proceed further.
Change your ruby version in the system first. If you using rvm then use following command.
rvm use 2.3.0
If you don't have it then install it by following command
rvm install 2.3.0
Delete the Gemfile.lock file and run
bundle install
Hopefully it will work. Thank you

railis new failing on Ubuntu

When I run rails new [application] on Ubuntu 13.10, I get the following error:
Resolving dependencies...
Could not find gem 'coffee-rails (~> 3.2.1) ruby' in the gems available on this machine.
It looks like I have this gem installed though:
$ gem list | grep coffee-rails
coffee-rails (4.0.1)
Any ideas on what's going on?
According to the Bundler page:
The specifier ~> has a special meaning, best shown by example. ~> 2.0.3 is identical to >= 2.0.3 and < 2.1. ~> 2.1 is identical to >= 2.1 and < 3.0. ~> 2.2.beta will match prerelease versions like 2.2.beta.12.
As such, version 4.0.1 of your gem is still not the specified one, that is between 3.2.1 and <3.3.
Just run
bundle install
Or, if you were unable to get a project directory with a valid Gemfile:
gem install coffee-rails --version 3.2.1
And it should install a compatible version.
I figured it out. After I got that error, I just went ahead and ran bundle install on the newly created app folder. It installed the missing dependencies and rails new is working now.

Using rails-composer, getting error based on builder version

I'm trying to use rails-composer to start a project. Right after composer installs the gems I get an error and the script stops. Here is the error:
Your bundle is complete! Use `bundle show [gemname]` to see where a bundled gem is installed.
composer Running 'after bundler' callbacks.
The template [https://raw.github.com/RailsApps/rails-composer/master/composer.rb] could not be loaded. Error: You have already activated builder 3.0.0, but your Gemfile requires builder 3.0.2. Using bundle exec may solve this.
I'm not sure how to use bundle exec to solve this.
Do this in your commandline
gem install builder --version '3.0.2'
& then try to use rails-composer

Problems on running rails server

I have tried to install gem draper and it asked me to update my activerecord to version 3.2.6. Done it I have installed succesfully draper but now when running my web application with rails server it gives me this error:
/var/lib/gems/1.9.1/gems/bundler-1.0.21/lib/bundler/runtime.rb:31:in `block in setup': You have already activated multi_json 1.3.6
, but your Gemfile requires multi_json 1.3.5. Using bundle exec may solve this.
I use aptana studio 3
How to solve it?
Firstly, make sure you have run bundle update after changing your Gemfile.
Then you need to do what the error message says and use bundle exec, which uses the gems from your Gemfile.lock, rather than the gems installed on your server.
So run this:
bundle exec rails s
please try to run :
bundle install

can't activate multi_json (~> 0.0.5, runtime) for ["instagram-0.8"], already activated multi_json-1.0.3 for []

I am making an instagram application using rails, but I keep getting this error every time I start my application:
can't activate multi_json (~> 0.0.5, runtime) for ["instagram-0.8"],
already activated multi_json-1.0.3 for []
My rails version is 3.0.4 and instagram gem has been installed (gem install instagram). What am i doing wrong?
Thanx in advance!
You should use bundler to manage your dependencies, rather than using rubygems directly.
If you use bundler, then execute your scripts with bundle exec <usual command here>, for example, bundle exec rspec spec/.
Bundler deals with all these issues for you. You may have to uninstall the gems you have installed manually in order to get this error to go away, however.

Resources