gem globalize3 on rails 4 - ruby-on-rails-4

Someon are using globalize3 with rails4.
How you configure it?
i tryed to install, on my Gemfile:
gem 'globalize3', github: 'svenfuchs/globalize3', branch: 'rails4'
but i have these errors:
Bundler could not find compatible versions for gem "railties":
In Gemfile:
globalize3 (>= 0) ruby depends on
railties (~> 3.0) ruby
coffee-rails (~> 4.0.0) ruby depends on
railties (4.0.0)
Bundler could not find compatible versions for gem "rails":
In Gemfile:
globalize3 (>= 0) ruby depends on
rails (~> 3) ruby
rails (4.0.0)
Bundler could not find compatible versions for gem "actionpack":
In Gemfile:
rails (= 4.0.0) ruby depends on
actionpack (= 4.0.0) ruby
simple_form (~> 3.0.0.rc) ruby depends on
actionpack (4.0.0.rc1)

The globalize3 gem has been renamed globalize and major version numbers now correspond to the corresponding version of ActiveRecord (3.x for AR3 and 4.x for AR4).
So all you need to do is put this in your Gemfile, and you should not get any conflict:
gem 'globalize', '~> 4.0.0.alpha.2'
See also the github repository for more details.

Try this use these 2 lines at your Gemfile:
gem 'paper_trail', github: 'airblade/paper_trail', branch: 'rails4'
gem 'globalize3', github: 'svenfuchs/globalize3', branch: 'rails4', ref: 'ffb5c771b9'

Use this. Paper_trail merged rails4 into master branch.
gem 'globalize3', github: 'svenfuchs/globalize3', branch: 'rails4'
gem 'paper_trail', github: 'airblade/paper_trail', branch: 'master'

This worked for me:
gem 'globalize', '~> 4.0.2'
Please check on the latest instructions here:
https://github.com/globalize/globalize#installation

Related

Suddenly can't bundle install

I haven't changed the versions numbers on any of these since it was working, but suddenly when I run bundle update or bundle install I get:
Resolving dependencies...
Bundler could not find compatible versions for gem "railties":
In Gemfile:
rails (= 4.0.1) ruby depends on
railties (= 4.0.1) ruby
sass-rails (~> 4.0.0) ruby depends on
railties (4.1.1)
What changed and what gives?
Turns out that sass-rails is will accept railties 4.0.1, rails will not accept railties 4.1.1. The solution was to call out sass-rails with an explicit version number at the beggining of the Gemfile.
Before:
source 'https://rubygems.org'
# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '4.0.1'
# Use sqlite3 as the database for Active Record
#gem 'sqlite3'
# Use SCSS for stylesheets
gem 'sass-rails', '~> 4.0.0'
After:
source 'https://rubygems.org'
gem 'railties', '4.0.1'
# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '4.0.1'
# Use sqlite3 as the database for Active Record
#gem 'sqlite3'
# Use SCSS for stylesheets
gem 'sass-rails', '~> 4.0.0'

Activeadmin bundle error

I am having this error when trying to bundle install. From what I understand it says activeadmin gem depends on metasearch 0.9.2 and metasearch gem depends on activerecord 3.1.0 but rails 4.1.0 depends on activercod 4.1.0. so what is my course of action for this?
Bundler could not find compatible versions for gem "activerecord":
In Gemfile:
activeadmin (>= 0) ruby depends on
meta_search (>= 0.9.2) ruby depends on
activerecord (~> 3.0.0.rc2) ruby
rails (= 4.1.0) ruby depends on
activerecord (4.1.0)
We're currently working on 1.0.0, which as far as dependencies, moves
us from meta_search to Ransack and adds Rails 4 support. You can get
Rails 4 and 4.1 support by tracking master:
gem 'activeadmin', github: 'activeadmin'
https://github.com/activeadmin/activeadmin

Bundler could not find compatible versions for jquery-ui-rails

I've created a new gemset, then, when I try to bundle install, I get this error:
Bundler could not find compatible versions for gem "jquery-ui-rails":
In Gemfile:
activeadmin (>= 0) ruby depends on
jquery-ui-rails (~> 5.0) ruby
alchemy_cms (~> 3.0.0.rc5) ruby depends on
jquery-ui-rails (4.1.1)
Although, I've apt-get update, any help?
remove the version constrain from alchemy_cms in Gemfile and run:
bundle update

How to install activerecord-sqlserver-adapter (~> 4.0.0)?

I have a Rails 4 project and use activerecord-sqlserver-adapter. The readme installation suggests:
gem 'tiny_tds'
gem 'activerecord-sqlserver-adapter', '~> 4.0.0'
However, bundle install returns:
Resolving dependencies...
Could not find gem 'activerecord-sqlserver-adapter (~> 4.0.0) ruby' in the gems available on this machine.
rubygems.org show the latest version as 3.2.12. How can I bundle install version ~> 4.0.0 as 3.2.12 only supports ActiveRecord 3.x?
Why not just Source version 4.0.0 of activerecord-sqlserver-adapter directly from Github.
In Gemfile
Replace
gem 'activerecord-sqlserver-adapter', '~> 4.0.0'
With
gem 'activerecord-sqlserver-adapter', '~> 4.0.0', :git => "git://github.com/rails-sqlserver/activerecord-sqlserver-adapter.git"
They have not provided support for Rails 4 yet, you can try below gem to obtain same thing.
sudo gem install sic-activerecord-sqlserver-adapter
This will work with Rails 4 definitely, i have tried this. thanks.
It says that the adapter is missing.
You should install ruby-odbc and it should work.
gem 'ruby-odbc', '0.99995'

can't activate bcrypt-ruby (~> 3.0.0), already activated bcrypt-ruby-3.1.1. Make sure all dependencies are added to Gemfile

I have Rails 4.0.0 app. When I run bundle install command there is no problem. This is my GemFile.
source 'https://rubygems.org'
# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '4.0.0'
gem 'mysql2'
# Use SCSS for stylesheets
gem 'sass-rails', '~> 4.0.0.rc2'
# Use Uglifier as compressor for JavaScript assets
gem 'uglifier', '>= 1.3.0'
# Use CoffeeScript for .js.coffee assets and views
gem 'coffee-rails', '~> 4.0.0'
# See https://github.com/sstephenson/execjs#readme for more supported runtimes
# gem 'therubyracer', platforms: :ruby
# Use jquery as the JavaScript library
gem 'jquery-rails'
# Turbolinks makes following links in your web application faster. Read more: https://github.com/rails/turbolinks
gem 'turbolinks'
# Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder
gem 'jbuilder', '~> 1.2'
group :doc do
# bundle exec rake doc:rails generates the API under doc/api.
gem 'sdoc', require: false
end
# Use ActiveModel has_secure_password
# gem 'bcrypt-ruby', '~> 3.0.0'
# Use unicorn as the app server
# gem 'unicorn'
# Use Capistrano for deployment
# gem 'capistrano', group: :development
# Use debugger
# gem 'debugger', group: [:development, :test]
gem 'pry'
gem 'devise', git: "https://github.com/plataformatec/devise.git", branch: 'rails4'
gem 'bcrypt-ruby'
gem 'simple_form'
gem "therubyracer"
gem "less-rails" #Sprockets (what Rails 3.1 uses for its asset pipeline) supports LESS
gem "twitter-bootstrap-rails"
gem 'simple_form'
gem 'jquery-ui-rails'
group :development, :test do
gem 'rspec-rails', '~> 2.0'
gem 'cucumber-rails', :git => "https://github.com/cucumber/cucumber-rails.git", :branch => "master_rails4_test", :require => false
gem 'database_cleaner'
gem 'factory_girl'
gem "factory_girl_rails", "~> 4.0"
gem "database_cleaner"
gem "awesome_print"
end
And this is my Gemfile.lock
GIT
remote: https://github.com/cucumber/cucumber-rails.git
revision: 5fa9da37ab05213d2f46029ea476e09104ffe281
branch: master_rails4_test
specs:
cucumber-rails (1.3.1)
capybara (>= 1.1.2)
cucumber (>= 1.2.0)
nokogiri (>= 1.5.0)
rails (>= 3.0.0)
GIT
remote: https://github.com/plataformatec/devise.git
revision: 6b5988d756d780903bf8c9ccb3e2b3b724ccebe8
branch: rails4
specs:
devise (2.2.4)
bcrypt-ruby (~> 3.0)
orm_adapter (~> 0.1)
railties (>= 3.2.6, < 5)
warden (~> 1.2.1)
GEM
remote: https://rubygems.org/
specs:
actionmailer (4.0.0)
actionpack (= 4.0.0)
mail (~> 2.5.3)
actionpack (4.0.0)
activesupport (= 4.0.0)
builder (~> 3.1.0)
erubis (~> 2.7.0)
rack (~> 1.5.2)
rack-test (~> 0.6.2)
activemodel (4.0.0)
activesupport (= 4.0.0)
builder (~> 3.1.0)
activerecord (4.0.0)
activemodel (= 4.0.0)
activerecord-deprecated_finders (~> 1.0.2)
activesupport (= 4.0.0)
arel (~> 4.0.0)
activerecord-deprecated_finders (1.0.3)
activesupport (4.0.0)
i18n (~> 0.6, >= 0.6.4)
minitest (~> 4.2)
multi_json (~> 1.3)
thread_safe (~> 0.1)
tzinfo (~> 0.3.37)
arel (4.0.0)
atomic (1.1.10)
awesome_print (1.1.0)
bcrypt-ruby (3.1.1)
builder (3.1.4)
capybara (2.1.0)
mime-types (>= 1.16)
nokogiri (>= 1.3.3)
rack (>= 1.0.0)
rack-test (>= 0.5.4)
xpath (~> 2.0)
coderay (1.0.9)
coffee-rails (4.0.0)
coffee-script (>= 2.2.0)
railties (>= 4.0.0.beta, < 5.0)
coffee-script (2.2.0)
coffee-script-source
execjs
coffee-script-source (1.6.3)
commonjs (0.2.6)
cucumber (1.3.4)
builder (>= 2.1.2)
diff-lcs (>= 1.1.3)
gherkin (~> 2.12.0)
multi_json (~> 1.7.5)
multi_test (~> 0.0.1)
database_cleaner (1.0.1)
diff-lcs (1.2.4)
erubis (2.7.0)
execjs (1.4.0)
multi_json (~> 1.0)
factory_girl (4.2.0)
activesupport (>= 3.0.0)
factory_girl_rails (4.2.1)
factory_girl (~> 4.2.0)
railties (>= 3.0.0)
gherkin (2.12.0)
multi_json (~> 1.3)
hike (1.2.3)
i18n (0.6.4)
jbuilder (1.4.2)
activesupport (>= 3.0.0)
multi_json (>= 1.2.0)
jquery-rails (3.0.4)
railties (>= 3.0, < 5.0)
thor (>= 0.14, < 2.0)
jquery-ui-rails (4.0.3)
jquery-rails
railties (>= 3.1.0)
json (1.8.0)
less (2.3.2)
commonjs (~> 0.2.6)
less-rails (2.3.3)
actionpack (>= 3.1)
less (~> 2.3.1)
libv8 (3.11.8.17)
mail (2.5.4)
mime-types (~> 1.16)
treetop (~> 1.4.8)
method_source (0.8.1)
mime-types (1.23)
mini_portile (0.5.1)
minitest (4.7.5)
multi_json (1.7.7)
multi_test (0.0.1)
mysql2 (0.3.13)
nokogiri (1.6.0)
mini_portile (~> 0.5.0)
orm_adapter (0.4.0)
polyglot (0.3.3)
pry (0.9.12.2)
coderay (~> 1.0.5)
method_source (~> 0.8)
slop (~> 3.4)
rack (1.5.2)
rack-test (0.6.2)
rack (>= 1.0)
rails (4.0.0)
actionmailer (= 4.0.0)
actionpack (= 4.0.0)
activerecord (= 4.0.0)
activesupport (= 4.0.0)
bundler (>= 1.3.0, < 2.0)
railties (= 4.0.0)
sprockets-rails (~> 2.0.0)
railties (4.0.0)
actionpack (= 4.0.0)
activesupport (= 4.0.0)
rake (>= 0.8.7)
thor (>= 0.18.1, < 2.0)
rake (10.1.0)
rdoc (3.12.2)
json (~> 1.4)
ref (1.0.5)
rspec-core (2.14.3)
rspec-expectations (2.14.0)
diff-lcs (>= 1.1.3, < 2.0)
rspec-mocks (2.14.1)
rspec-rails (2.14.0)
actionpack (>= 3.0)
activesupport (>= 3.0)
railties (>= 3.0)
rspec-core (~> 2.14.0)
rspec-expectations (~> 2.14.0)
rspec-mocks (~> 2.14.0)
sass (3.2.9)
sass-rails (4.0.0)
railties (>= 4.0.0.beta, < 5.0)
sass (>= 3.1.10)
sprockets-rails (~> 2.0.0)
sdoc (0.3.20)
json (>= 1.1.3)
rdoc (~> 3.10)
simple_form (1.4.1)
slop (3.4.5)
sprockets (2.10.0)
hike (~> 1.2)
multi_json (~> 1.0)
rack (~> 1.0)
tilt (~> 1.1, != 1.3.0)
sprockets-rails (2.0.0)
actionpack (>= 3.0)
activesupport (>= 3.0)
sprockets (~> 2.8)
therubyracer (0.11.4)
libv8 (~> 3.11.8.12)
ref
thor (0.18.1)
thread_safe (0.1.0)
atomic
tilt (1.4.1)
treetop (1.4.14)
polyglot
polyglot (>= 0.3.1)
turbolinks (1.3.0)
coffee-rails
twitter-bootstrap-rails (2.2.7)
actionpack (>= 3.1)
execjs
rails (>= 3.1)
railties (>= 3.1)
tzinfo (0.3.37)
uglifier (2.1.2)
execjs (>= 0.3.0)
multi_json (~> 1.0, >= 1.0.2)
warden (1.2.3)
rack (>= 1.0)
xpath (2.0.0)
nokogiri (~> 1.3)
PLATFORMS
ruby
DEPENDENCIES
awesome_print
bcrypt-ruby
coffee-rails (~> 4.0.0)
cucumber-rails!
database_cleaner
devise!
factory_girl
factory_girl_rails (~> 4.0)
jbuilder (~> 1.2)
jquery-rails
jquery-ui-rails
less-rails
mysql2
pry
rails (= 4.0.0)
rspec-rails (~> 2.0)
sass-rails (~> 4.0.0.rc2)
sdoc
simple_form
therubyracer
turbolinks
twitter-bootstrap-rails
uglifier (>= 1.3.0)
When I run rake sometask , I faced with this problem,
You don't have bcrypt-ruby installed in your application. Please add it to your Gemfile and run bundle install
rake aborted!
can't activate bcrypt-ruby (~> 3.0.0), already activated bcrypt-ruby-3.1.1. Make sure all dependencies are added to Gemfile.
/Users/apple/.rvm/gems/ruby-2.0.0-p0#rails4/gems/bundler-1.3.5/lib/bundler/rubygems_integration.rb:224:in `block in replace_gem'
/Users/apple/.rvm/gems/ruby-2.0.0-p0#rails4/gems/activemodel-4.0.0/lib/active_model/secure_password.rb:47:in `has_secure_password'
/Users/apple/Projects/YH/multi-domains/app/models/super_admin_user.rb:2:in `<class:SuperAdminUser>'
/Users/apple/Projects/YH/multi-domains/app/models/super_admin_user.rb:1:in `<top (required)>'
/Users/apple/.rvm/gems/ruby-2.0.0-p0#rails4/gems/activesupport-4.0.0/lib/active_support/dependencies.rb:423:in `load'
/Users/apple/.rvm/gems/ruby-2.0.0-p0#rails4/gems/activesupport-4.0.0/lib/active_support/dependencies.rb:423:in `block in load_file'
/Users/apple/.rvm/gems/ruby-2.0.0-p0#rails4/gems/activesupport-4.0.0/lib/active_support/dependencies.rb:615:in `new_constants_in'
/Users/apple/.rvm/gems/ruby-2.0.0-p0#rails4/gems/activesupport-4.0.0/lib/active_support/dependencies.rb:422:in `load_file'
/Users/apple/.rvm/gems/ruby-2.0.0-p0#rails4/gems/activesupport-4.0.0/lib/active_support/dependencies.rb:323:in `require_or_load'
/Users/apple/.rvm/gems/ruby-2.0.0-p0#rails4/gems/activesupport-4.0.0/lib/active_support/dependencies.rb:462:in `load_missing_constant'
/Users/apple/.rvm/gems/ruby-2.0.0-p0#rails4/gems/activesupport-4.0.0/lib/active_support/dependencies.rb:183:in `const_missing'
/Users/apple/Projects/YH/multi-domains/lib/tasks/generate_new_data.rake:3:in `block in <top (required)>'
How should I fix this?
In your gemfile, you aren't specifying the version, so you're installing the latest version of bcrypt-ruby which is 3.1.1, but what you need is any version from 3.0.0 to 3.0.9. You can get this by adding a version constraint like so:
gem 'bcrypt-ruby', '~> 3.0.0'
The version requirement comes from ActiveModel's SecurePassword which currently has an explicit dependency on bcrypt-ruby (~> 3.0.0). You can see the dependency on github. When this code is executed, it looks for a version 3.0.0 through 3.0.9 which is not installed and so it throws an error.
This dependency was just updated to '~> 3.1.0' a couple of days ago, but has not made its way into the rails activemodel gem yet. When it does, you'll have to update your version accordingly. Here's the commit if you're curious.
Install both 3.0.1 and 3.1.2 bcrypt version
go to "\Ruby200\lib\ruby\gems\2.0.0\gems\bcrypt-ruby-3.1.2-x86-mingw32\lib"
copy the '2.0' folder
paste into "Ruby200\lib\ruby\gems\2.0.0\gems\bcrypt-ruby-3.0.1-x86-mingw32\lib"
include gem 'bcrypt-ruby' in your Gemfile
bundle install
I had the same problem. Add
gem 'bcrypt-ruby', '~> 3.0.0'
then run
bundle install and the restart the server. Worked for me
Remove Gemfile.lock and specify the gem 'bcrypt-ruby', '3.0.0'. Run bundle install. Actually, in local gem file bcrypt-ruby should be uninstalled.
I had the same issue, but the current approach provided gem 'bcrypt-ruby', '~> 3.0.0' didn't work so I actually installed version 3.0.0
adding the line gem 'bcrypt-ruby', '3.0.0' to Gemfile and installing specific version 3.0.0 (although it should work up to version 3.0.9)
gem install --version='3.0.0' bcrypt-ruby After this, just verify your bundle install, you can run bundle show bcrypt-ruby and then you should have the path where this gem was installed, something like %RUBY_PATH%/lib/ruby/gems/2.0.0/gems/bcrypt-ruby-3.0.0
after these steps I was able to use the bcrypt without problems... just posting this in the event someone still encounters this issue.
Use ActiveModel has_secure_password
gem 'bcrypt-ruby', '~> 3.0.0'
Had the same issue. Removing the comment # from above line resolved my issue, as jconley mentioned.
For me it worked by just deleting the dependency for version of bycript in the /active_model/secure_password.rb for development test environment.
I always made sure to add it in production just to 100% safe
In console:
$ gem install bundler
$ gem install bcrypt
$ bundle update bcrypt
Add; gem 'bcrypt-ruby', '~> 3.1.1' to your gemfile
Or if you specifically want 3.0.0, follow Maximus's advice and add: gem 'bcrypt-ruby', '3.0.0'
Then bundle update bcrypt-ruby.
You might also want to try deleting your gemfile.lock and re-running bundle install.