Devise gives error while running devise:install in rails application - ruby-on-rails

i am using ruby 2.2.3, and rails 4.2.5. I am not being able to run rails generate devise:install on my project. Bundler is throwing an error. the error are like following
rails g devise:install
/home/suyesh/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/bundler-1.11.1/lib/bundler/runtime.rb:80:in `rescue in block (2 levels) in require': There was an error while trying to load the gem 'uglifier'. (Bundler::GemRequireError)
from /home/suyesh/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/bundler-1.11.1/lib/bundler/runtime.rb:76:in `block (2 levels) in require'
from /home/suyesh/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/bundler-1.11.1/lib/bundler/runtime.rb:72:in `each'
from /home/suyesh/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/bundler-1.11.1/lib/bundler/runtime.rb:72:in `block in require'
from /home/suyesh/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/bundler-1.11.1/lib/bundler/runtime.rb:61:in `each'
from /home/suyesh/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/bundler-1.11.1/lib/bundler/runtime.rb:61:in `require'
from /home/suyesh/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/bundler-1.11.1/lib/bundler.rb:99:in `require'
from /home/suyesh/Desktop/petrohub/config/application.rb:7:in `<top (required)>'
from /home/suyesh/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/spring-1.6.0/lib/spring/application.rb:82:in `require'
from /home/suyesh/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/spring-1.6.0/lib/spring/application.rb:82:in `preload'
from /home/suyesh/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/spring-1.6.0/lib/spring/application.rb:143:in `serve'
from /home/suyesh/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/spring-1.6.0/lib/spring/application.rb:131:in `block in run'
from /home/suyesh/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/spring-1.6.0/lib/spring/application.rb:125:in `loop'
from /home/suyesh/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/spring-1.6.0/lib/spring/application.rb:125:in `run'
from /home/suyesh/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/spring-1.6.0/lib/spring/application/boot.rb:18:in `<top (required)>'
from /home/suyesh/.rbenv/versions/2.2.3/lib/ruby/site_ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:in `require'
from /home/suyesh/.rbenv/versions/2.2.3/lib/ruby/site_ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:in `require'
from -e:1:in `<main>'
and here are my gem list
actionmailer (4.2.5)
actionpack (4.2.5)
actionview (4.2.5)
activejob (4.2.5)
activemodel (4.2.5)
activerecord (4.2.5)
activesupport (4.2.5)
arel (6.0.3)
autoprefixer-rails (6.1.2)
bcrypt (3.1.10)
bigdecimal (1.2.7, 1.2.6)
binding_of_caller (0.7.2)
bootstrap-sass (3.3.6)
builder (3.2.2)
bundler (1.11.1, 1.11.0)
byebug (8.2.1)
coffee-rails (4.1.0)
coffee-script (2.4.1)
coffee-script-source (1.10.0)
concurrent-ruby (1.0.0)
debug_inspector (0.0.2)
devise (3.5.3)
diff-lcs (1.2.5)
domain_name (0.5.25)
erubis (2.7.0)
execjs (2.6.0)
globalid (0.3.6)
http-cookie (1.0.2)
i18n (0.7.0)
io-console (0.4.3)
jbuilder (2.3.2)
jquery-rails (4.0.5)
json (1.8.3, 1.8.1)
loofah (2.0.3)
mail (2.6.3)
mechanize (2.7.3)
mime-types (3.0, 2.99)
mime-types-data (3.2015.1120)
mini_portile2 (2.0.0)
minitest (5.8.3, 5.4.3)
multi_json (1.11.2)
net-http-digest_auth (1.4)
net-http-persistent (2.9.4)
nokogiri (1.6.7)
ntlm-http (0.1.1)
orm_adapter (0.5.0)
power_assert (0.2.6, 0.2.2)
psych (2.0.16, 2.0.8)
rack (1.6.4)
rack-protection (1.5.3)
rack-test (0.6.3)
rails (4.2.5)
rails-deprecated_sanitizer (1.0.3)
rails-dom-testing (1.0.7)
rails-html-sanitizer (1.0.2)
railties (4.2.5)
rake (10.4.2)
rdoc (4.2.0)
responders (2.1.0)
rspec-core (3.4.1)
rspec-expectations (3.4.0)
rspec-mocks (3.4.0)
rspec-rails (3.4.0)
rspec-support (3.4.1)
rubygems-update (2.5.1)
sass (3.4.20)
sass-rails (5.0.4)
sdoc (0.4.1)
sinatra (1.4.6)
spring (1.6.0)
sprockets (3.5.2)
sprockets-rails (2.3.3)
sqlite3 (1.3.11)
test-unit (3.1.5, 3.0.8)
thor (0.19.1)
thread_safe (0.3.5)
tilt (2.0.1)
turbolinks (2.5.3)
tzinfo (1.2.2)
uglifier (2.7.2)
unf (0.1.4)
unf_ext (0.0.7.1)
warden (1.2.4)
web-console (3.0.0, 2.2.1)
webrobots (0.1.1)
I keep getting the error when i do rails generate devise:install. I tried uninstalling devise and reinstalling it. I even tried uninstalling uglifier and reinstalling. I am not being able to understand what is causing the issue? is it the bundler?

It has been resolved. The problem was nodejs. I was using nvm to manage my nodejs, i switched to system wide sudo apt-get install nodejs and switched nvm to use the system version and devise started working.

I had the same problem, for me worked this:
bin/spring stop
bin/spring binstub --remove --all
bundle isntall && update

When I received that error I found that these three steps corrected the issue, albeit I am not sure how or why:
Uninstall the gem.
Install the gem, without a specific version to install the latest version.
Update my gem file to include this new version.
I am learning Ruby on Rails through a text, and it has me working with a specific version, but the entire thing did not work as it was supposed to, and I found that the above worked for me. I had to do it for four gems before things finally worked alright.

The main reason of your error may be that you forgot including your gem in your Gemfile. So ,
First of all check whether , the uglifier gem is present in your Gemfile.
After that , run bundle install again.
And then install devise .
I hope this helps.

I'm not sure if this is the problem, but a dependency of Devise 3.5.3 is: railties < 5, >= 3.2.6
It looks like you need to update this gem

I had the same problem.. Fixed by installing nodejs and it's working now :)

Related

Bundler command not working, it says "undefined method []= for nil:NilClass"

I recently installed ruby 2.4.0 using rbenv. Then I installed bundler but every time I try to run bundle ("bundle install", "bundle help", basically any bundle command) I get the following error:
/Users/cone/.rbenv/versions/2.4.0/lib/ruby/gems/2.4.0/gems/bundler-
1.15.3/lib/bundler/yaml_serializer.rb:67:in `block in load': undefined
method `[]=' for nil:NilClass (NoMethodError)
from
/Users/cone/.rbenv/versions/2.4.0/lib/ruby/gems/2.4.0/gems/bundler-
1.15.3/lib/bundler/yaml_serializer.rb:55:in `each'
from
/Users/cone/.rbenv/versions/2.4.0/lib/ruby/gems/2.4.0/gems/bundler-
1.15.3/lib/bundler/yaml_serializer.rb:55:in `load'
from
/Users/cone/.rbenv/versions/2.4.0/lib/ruby/gems/2.4.0/gems/bundler-
1.15.3/lib/bundler/settings.rb:324:in `block in load_config'
from
/Users/cone/.rbenv/versions/2.4.0/lib/ruby/gems/2.4.0/gems/bundler-
1.15.3/lib/bundler/shared_helpers.rb:108:in `filesystem_access'
from
/Users/cone/.rbenv/versions/2.4.0/lib/ruby/gems/2.4.0/gems/bundler-
1.15.3/lib/bundler/settings.rb:320:in `load_config'
from
/Users/cone/.rbenv/versions/2.4.0/lib/ruby/gems/2.4.0/gems/bundler-
1.15.3/lib/bundler/settings.rb:49:in `initialize'
from
/Users/cone/.rbenv/versions/2.4.0/lib/ruby/gems/2.4.0/gems/bundler-
1.15.3/lib/bundler.rb:249:in `new'
from
/Users/cone/.rbenv/versions/2.4.0/lib/ruby/gems/2.4.0/gems/bundler-
1.15.3/lib/bundler.rb:249:in `rescue in settings'
from
/Users/cone/.rbenv/versions/2.4.0/lib/ruby/gems/2.4.0/gems/bundler-
1.15.3/lib/bundler.rb:247:in `settings'
from
/Users/cone/.rbenv/versions/2.4.0/lib/ruby/gems/2.4.0/gems/bundler-
1.15.3/lib/bundler/env.rb:32:in `report'
from
/Users/cone/.rbenv/versions/2.4.0/lib/ruby/gems/2.4.0/gems/bundler-
1.15.3/lib/bundler/friendly_errors.rb:95:in `request_issue_report_for'
from
/Users/cone/.rbenv/versions/2.4.0/lib/ruby/gems/2.4.0/gems/bundler-
1.15.3/lib/bundler/friendly_errors.rb:45:in `log_error'
from
/Users/cone/.rbenv/versions/2.4.0/lib/ruby/gems/2.4.0/gems/bundler-
1.15.3/lib/bundler/friendly_errors.rb:123:in `rescue in
with_friendly_errors'
from
/Users/cone/.rbenv/versions/2.4.0/lib/ruby/gems/2.4.0/gems/bundler-
1.15.3/lib/bundler/friendly_errors.rb:121:in `with_friendly_errors'
from
/Users/cone/.rbenv/versions/2.4.0/lib/ruby/gems/2.4.0/gems/bundler-
1.15.3/exe/bundle:22:in `<top (required)>'
from /Users/cone/.rbenv/versions/2.4.0/bin/bundle:23:in `load'
from /Users/cone/.rbenv/versions/2.4.0/bin/bundle:23:in `<main>'
I'm using:
gem 2.6.12
rbenv 1.1.1
bundler 1.15.3
ruby 2.4.0p0 (2016-12-24 revision 57164) [x86_64-darwin15]
xcode 8.2.1
my computer OS is: OSX El Capitan 10.11.6
I have tried removing rbenv completely and installing it again, then installing ruby 2.4.0, and finally bundler, but I get the same error again.
this is the result of 'gem list':
actioncable (5.1.2)
actionmailer (5.1.2)
actionpack (5.1.2)
actionview (5.1.2)
activejob (5.1.2)
activemodel (5.1.2)
activerecord (5.1.2)
activesupport (5.1.2)
arel (8.0.0)
bigdecimal (default: 1.3.0)
builder (3.2.3)
bundler (1.15.3)
concurrent-ruby (1.0.5)
did_you_mean (1.1.0)
erubi (1.6.1)
globalid (0.4.0)
i18n (0.8.6)
io-console (default: 0.4.6)
json (default: 2.0.2)
loofah (2.0.3)
mail (2.6.6)
method_source (0.8.2)
mime-types (3.1)
mime-types-data (3.2016.0521)
mini_portile2 (2.2.0)
minitest (5.10.1)
net-telnet (0.1.1)
nio4r (2.1.0)
nokogiri (1.8.0)
openssl (default: 2.0.2)
power_assert (0.4.1)
psych (default: 2.2.2)
rack (2.0.3)
rack-test (0.6.3)
rails (5.1.2)
rails-dom-testing (2.0.3)
rails-html-sanitizer (1.0.3)
railties (5.1.2)
rake (12.0.0)
rdoc (default: 5.0.0)
rubygems-update (2.6.12)
sprockets (3.7.1)
sprockets-rails (3.2.0)
test-unit (3.2.3)
thor (0.19.4)
thread_safe (0.3.6)
tzinfo (1.2.3)
websocket-driver (0.6.5)
websocket-extensions (0.1.2)
xmlrpc (0.2.1)
This is what I have in my $PATH:
/Users/cone/.rbenv/shims:/Users/cone/.nvm/versions/node/v6.9.1/bin:/Users/cone/bin:/usr/local/bin:/usr/local/vlt/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/git/bin:/usr/local/share/npm/bin:/usr/local/axis2/bin
Some of my co-workers have ruby 2.4.0 and bundler 1.15.3 and it's working fine for them, unfortunately they haven't been able to help me with this. So I hope someone here can give me a hint.
Ok, I just got help by a co-worker who is a top Ruby developer. It seems that bundler was trying to read from the file ~/.bundle/config which apparently was corrupted or something like that. So after deleting that file, bundler started working! I hope this helps someone in the same situation in the future :)

Error "'Validate_default_type!': An option's default must match its type (ArgumentError)" when running Ruby on Rails generate on Windows

I am following this tutorial and have just started. I have installed Ruby on Rails with gem install rails and have created a blog with rails new blog.
The tutorial now says that I need to run rails generate controller Welcome index, however when I do, I get this error:
C:/Ruby22/lib/ruby/gems/2.2.0/gems/thor-0.19.2/lib/thor/parser/option.rb:130:in `validate_default_type!': An option's default must match its type. (ArgumentError)
from C:/Ruby22/lib/ruby/gems/2.2.0/gems/thor-0.19.2/lib/thor/parser/option.rb:113:in `validate!'
from C:/Ruby22/lib/ruby/gems/2.2.0/gems/thor-0.19.2/lib/thor/parser/argument.rb:24:in `initialize'
from C:/Ruby22/lib/ruby/gems/2.2.0/gems/thor-0.19.2/lib/thor/parser/option.rb:9:in `initialize'
from C:/Ruby22/lib/ruby/gems/2.2.0/gems/thor-0.19.2/lib/thor/base.rb:544:in `new'
from C:/Ruby22/lib/ruby/gems/2.2.0/gems/thor-0.19.2/lib/thor/base.rb:544:in `build_option'
from C:/Ruby22/lib/ruby/gems/2.2.0/gems/thor-0.19.2/lib/thor/base.rb:278:in `class_option'
from C:/Ruby22/lib/ruby/gems/2.2.0/gems/railties-5.0.0.1/lib/rails/generators/base.rb:202:in `class_option'
from C:/Ruby22/lib/ruby/gems/2.2.0/gems/railties-5.0.0.1/lib/rails/generators/base.rb:178:in `block in hook_for'
from C:/Ruby22/lib/ruby/gems/2.2.0/gems/railties-5.0.0.1/lib/rails/generators/base.rb:168:in `each'
from C:/Ruby22/lib/ruby/gems/2.2.0/gems/railties-5.0.0.1/lib/rails/generators/base.rb:168:in `hook_for'
from C:/Ruby22/lib/ruby/gems/2.2.0/gems/jbuilder-2.6.0/lib/generators/rails/scaffold_controller_generator.rb:9:in `<class:ScaffoldControllerGenerator>'
from C:/Ruby22/lib/ruby/gems/2.2.0/gems/jbuilder-2.6.0/lib/generators/rails/scaffold_controller_generator.rb:6:in `<module:Generators>'
from C:/Ruby22/lib/ruby/gems/2.2.0/gems/jbuilder-2.6.0/lib/generators/rails/scaffold_controller_generator.rb:5:in `<module:Rails>'
from C:/Ruby22/lib/ruby/gems/2.2.0/gems/jbuilder-2.6.0/lib/generators/rails/scaffold_controller_generator.rb:4:in `<top (required)>'
from C:/Ruby22/lib/ruby/gems/2.2.0/gems/activesupport-5.0.0.1/lib/active_support/dependencies.rb:293:in `require'
from C:/Ruby22/lib/ruby/gems/2.2.0/gems/activesupport-5.0.0.1/lib/active_support/dependencies.rb:293:in `block in require'
from C:/Ruby22/lib/ruby/gems/2.2.0/gems/activesupport-5.0.0.1/lib/active_support/dependencies.rb:259:in `load_dependency'
from C:/Ruby22/lib/ruby/gems/2.2.0/gems/activesupport-5.0.0.1/lib/active_support/dependencies.rb:293:in `require'
from C:/Ruby22/lib/ruby/gems/2.2.0/gems/jbuilder-2.6.0/lib/jbuilder/railtie.rb:32:in `block in <class:Railtie>'
from C:/Ruby22/lib/ruby/gems/2.2.0/gems/railties-5.0.0.1/lib/rails/railtie.rb:230:in `call'
from C:/Ruby22/lib/ruby/gems/2.2.0/gems/railties-5.0.0.1/lib/rails/railtie.rb:230:in `block in run_generators_blocks'
from C:/Ruby22/lib/ruby/gems/2.2.0/gems/railties-5.0.0.1/lib/rails/railtie.rb:247:in `each'
from C:/Ruby22/lib/ruby/gems/2.2.0/gems/railties-5.0.0.1/lib/rails/railtie.rb:247:in `each_registered_block'
from C:/Ruby22/lib/ruby/gems/2.2.0/gems/railties-5.0.0.1/lib/rails/railtie.rb:230:in `run_generators_blocks'
from C:/Ruby22/lib/ruby/gems/2.2.0/gems/railties-5.0.0.1/lib/rails/application.rb:453:in `block in run_generators_blocks'
from C:/Ruby22/lib/ruby/gems/2.2.0/gems/railties-5.0.0.1/lib/rails/engine/railties.rb:13:in `each'
from C:/Ruby22/lib/ruby/gems/2.2.0/gems/railties-5.0.0.1/lib/rails/engine/railties.rb:13:in `each'
from C:/Ruby22/lib/ruby/gems/2.2.0/gems/railties-5.0.0.1/lib/rails/application.rb:453:in `run_generators_blocks'
from C:/Ruby22/lib/ruby/gems/2.2.0/gems/railties-5.0.0.1/lib/rails/engine.rb:465:in `load_generators'
from C:/Ruby22/lib/ruby/gems/2.2.0/gems/railties-5.0.0.1/lib/rails/commands/commands_tasks.rb:144:in `generate_or_destroy'
from C:/Ruby22/lib/ruby/gems/2.2.0/gems/railties-5.0.0.1/lib/rails/commands/commands_tasks.rb:60:in `generate'
from C:/Ruby22/lib/ruby/gems/2.2.0/gems/railties-5.0.0.1/lib/rails/commands/commands_tasks.rb:49:in `run_command!'
from C:/Ruby22/lib/ruby/gems/2.2.0/gems/railties-5.0.0.1/lib/rails/commands.rb:18:in `<top (required)>'
from bin/rails:4:in `require'
from bin/rails:4:in `<main>'
I have found a similar question on Stack Overflow asking the same question here, but the poster never responded when asked to show his gem list. So here's mine:
actioncable (5.0.0.1)
actionmailer (5.0.0.1)
actionpack (5.0.0.1)
actionview (5.0.0.1)
activejob (5.0.0.1)
activemodel (5.0.0.1)
activerecord (5.0.0.1)
activesupport (5.0.0.1)
arel (7.1.4)
bigdecimal (1.2.7, default: 1.2.6)
builder (3.2.2)
bundler (1.13.6)
coffee-rails (4.2.1)
coffee-script (2.4.1)
coffee-script-source (1.11.1)
concurrent-ruby (1.0.2)
debug_inspector (0.0.2)
erubis (2.7.0)
execjs (2.7.0)
globalid (0.3.7)
i18n (0.7.0)
io-console (0.4.6, default: 0.4.3)
jbuilder (2.6.0)
jquery-rails (4.2.1)
json (2.0.2, default: 1.8.1)
loofah (2.0.3)
mail (2.6.4)
method_source (0.8.2)
mime-types (3.1)
mime-types-data (3.2016.0521)
mini_portile2 (2.1.0)
minitest (5.9.1, 5.4.3)
multi_json (1.12.1)
nio4r (1.2.1)
nokogiri (1.6.8.1 x86-mingw32)
power_assert (0.3.1, 0.2.2)
psych (2.2.0, default: 2.0.8)
puma (3.6.2)
rack (2.0.1, 1.6.4)
rack-protection (1.5.3)
rack-test (0.6.3)
rails (5.0.0.1)
rails-dom-testing (2.0.1)
rails-html-sanitizer (1.0.3)
railties (5.0.0.1)
rake (11.3.0, default: 10.4.2)
rdoc (5.0.0, default: 4.2.0)
sass (3.4.22)
sass-rails (5.0.6)
sinatra (1.4.7)
sprockets (3.7.0)
sprockets-rails (3.2.0)
sqlite3 (1.3.12 x86-mingw32)
test-unit (3.2.3, 3.0.8)
thor (0.19.2, 0.19.1)
thread_safe (0.3.5)
tilt (2.0.5)
turbolinks (5.0.1)
turbolinks-source (5.0.0)
tzinfo (1.2.2)
tzinfo-data (1.2016.10)
uglifier (3.0.3)
web-console (3.4.0)
websocket-driver (0.6.4)
websocket-extensions (0.1.2)
Has anybody encountered this error before? If so, how did you resolve it?
A temporary fix is to set the version of Thor in your gemfile to the last release.
gem 'thor', '0.19.1'
It seems the latest gem release broke it. Once that gets fixed, then this error should go away.
For anyone having trouble creating a new Ruby on Rails application or anything else like middleman, you can uninstall Thor and install the older version specifically:
gem uninstall thor
gem install thor -v 0.19.1
I have had a similar issue tonight with Thor 0.19.2.
Here is what worked for me. Please ensure that you backup all data. I am very new to Rails, so I don't know what the consequences of this will be.
First, you need to remove Thor 0.19.2.
gem uninstall thor
Type 'Y' when it asks you confirm removal. Then, install the previous version of Thor.
gem install thor -v 0.19.1
You might get an error about being locked to 0.19.2 - go into your project's gemfile.lock, and find the line containing Thor. Change 0.19.2 to 0.19.1.
You might need to restart any terminal windows you have open. Good luck!
I just ran into this myself. I've been working with Rails for almost a year so I was like "Uhhhhh so do I not know what I'm doing? Orrrr?" xD.
I'm on an Ubuntu-based Linux distro.
I added this line to my Gemfile:
gem 'thor', '0.19.1'
I then ran the command "bundle update thor" to make it grab the exact version I needed. Now my generators work again.
You can also try:
bundle update thor
It worked for me.

New to rails stuck with rails server command

i am new to ruby on rails, when i enter rails server command i get a strange message which i don't know how to deal with.
Using tzinfo-data 1.2015.7
Using uglifier 2.7.2
Using web-console 2.2.1
Bundle complete! 12 Gemfile dependencies, 53 gems now installed.
Use `bundle show [gemname]` to see where a bundled gem is installed.
C:\Users\dell notebook>cd Mybook
C:\Users\dell notebook\MyBook>rails server
E:/2.2.3exe/Ruby22/lib/ruby/gems/2.2.0/gems/nokogiri-1.6.6.2-x86-mingw32/lib/nok
ogiri.rb:29:in `require': cannot load such file -- nokogiri/nokogiri (LoadError)
from E:/2.2.3exe/Ruby22/lib/ruby/gems/2.2.0/gems/nokogiri-1.6.6.2-x86-mi
ngw32/lib/nokogiri.rb:29:in `rescue in <top (required)>'
from E:/2.2.3exe/Ruby22/lib/ruby/gems/2.2.0/gems/nokogiri-1.6.6.2-x86-mi
ngw32/lib/nokogiri.rb:25:in `<top (required)>'
from E:/2.2.3exe/Ruby22/lib/ruby/gems/2.2.0/gems/loofah-2.0.3/lib/loofah
.rb:3:in `require'
from E:/2.2.3exe/Ruby22/lib/ruby/gems/2.2.0/gems/loofah-2.0.3/lib/loofah
.rb:3:in `<top (required)>'
from E:/2.2.3exe/Ruby22/lib/ruby/gems/2.2.0/gems/rails-html-sanitizer-1.
0.2/lib/rails-html-sanitizer.rb:2:in `require'
from E:/2.2.3exe/Ruby22/lib/ruby/gems/2.2.0/gems/rails-html-sanitizer-1.
i think i have all the gems installed
*** LOCAL GEMS ***
actionmailer (4.2.4)
actionpack (4.2.4)
actionview (4.2.4)
activejob (4.2.4)
activemodel (4.2.4)
activerecord (4.2.4)
activesupport (4.2.4)
arel (6.0.3)
bigdecimal (1.2.6)
binding_of_caller (0.7.2)
builder (3.2.2)
bundler (1.10.6)
byebug (6.0.2)
coffee-rails (4.1.0)
coffee-script (2.4.1)
coffee-script-source (1.9.1.1)
debug_inspector (0.0.2)
erubis (2.7.0)
execjs (2.6.0)
globalid (0.3.6)
i18n (0.7.0)
io-console (0.4.3)
jbuilder (2.3.2)
jquery-rails (4.0.5)
json (1.8.3, 1.8.1)
loofah (2.0.3)
mail (2.6.3)
mime-types (2.6.2)
mini_portile (0.6.2)
minitest (5.8.1, 5.4.3)
multi_json (1.11.2)
nokogiri (1.6.6.2 x86-mingw32)
power_assert (0.2.2)
psych (2.0.8)
rack (1.6.4)
rack-test (0.6.3)
rails (4.2.4)
rails-deprecated_sanitizer (1.0.3)
rails-dom-testing (1.0.7)
rails-html-sanitizer (1.0.2)
railties (4.2.4)
rake (10.4.2)
rdoc (4.2.0)
sass (3.4.19)
sass-rails (5.0.4)
sdoc (0.4.1)
sprockets (3.4.0)
sprockets-rails (2.3.3)
sqlite3 (1.3.11 x86-mingw32)
test-unit (3.0.8)
thor (0.19.1)
thread_safe (0.3.5)
tilt (2.0.1)
turbolinks (2.5.3)
tzinfo (1.2.2)
tzinfo-data (1.2015.7)
uglifier (2.7.2)
web-console (2.2.1)
My rails and ruby versions are:
C:\Users\dell notebook\MyBook>rails -v
Rails 4.2.4
C:\Users\dell notebook\MyBook>ruby -v
ruby 2.2.3p173 (2015-08-18 revision 51636) [i386-mingw32]
If someone with more experience could just point me in the right direction, I would greatly appreciate it. I have been working on this install for days!
Thanks
It looks like you have nokogiri installed but for the wrong version of ruby. It's installed for ruby 2.2.0 but you're using ruby 2.2.3.
add these two files:
.ruby-gemset
rails4.2.4
.ruby-version
ruby-2.2.3
Then run:
bundle install

installing jekyll-coffeescript on Fedora 19

I'm trying to use jekyll-coffeescript on Fedora 19 to get my octopress working. 'rake generate' keeps failing, I'm not sure why, I think all the dependencies are installed ok. I have tried installing loads of different modules but none of them solve the problem. I have nodejs installed and rubyracer.
If you need anymore info from me to help, let me know and I'll post it.
this is for an octopress install.
#( 09/04/14# 9:07am )( tim#localhost ):~/Workspace/Development/octopress#source✔
rake generate
## Generating Site with Jekyll
identical source/stylesheets/screen.css
Dependency Error: Yikes! It looks like you don't have jekyll-coffeescript or one of its dependencies installed. In order to use Jekyll as currently configured, you'll need to install this gem. The full error message from Ruby is: 'cannot load such file -- json' If you run into trouble, you can find helpful resources at http://jekyllrb.com/help/!
/home/tim/.gem/ruby/gems/jekyll-2.3.0/lib/jekyll/deprecator.rb:56:in `rescue in block in gracefully_require': jekyll-coffeescript (Jekyll::Errors::MissingDependencyException)
from /home/tim/.gem/ruby/gems/jekyll-2.3.0/lib/jekyll/deprecator.rb:45:in `block in gracefully_require'
from /home/tim/.gem/ruby/gems/jekyll-2.3.0/lib/jekyll/deprecator.rb:44:in `each'
from /home/tim/.gem/ruby/gems/jekyll-2.3.0/lib/jekyll/deprecator.rb:44:in `gracefully_require'
from /home/tim/.gem/ruby/gems/jekyll-2.3.0/lib/jekyll.rb:141:in `<top (required)>'
from /home/tim/.gem/ruby/gems/jekyll-2.3.0/bin/jekyll:6:in `require'
from /home/tim/.gem/ruby/gems/jekyll-2.3.0/bin/jekyll:6:in `<top (required)>'
from /home/tim/bin/jekyll:23:in `load'
from /home/tim/bin/jekyll:23:in `<main>'
#( 09/04/14# 9:09am )( tim#localhost ):~/Workspace/Development/octopress#source✔
gem list
*** LOCAL GEMS ***
bigdecimal (1.2.0)
blankslate (2.1.2.4)
bundler (1.7.2)
celluloid (0.15.2)
chunky_png (1.3.1, 1.2.7)
classifier-reborn (2.0.1)
coffee-script (2.3.0, 2.2.0)
coffee-script-source (1.7.1, 1.6.1)
colorator (0.1)
commonjs (0.2.6)
compass (0.12.7, 0.12.6)
erubis (2.7.0)
execjs (2.2.1, 1.4.0)
fast-stemmer (1.0.2)
ffi (1.9.3)
fssm (0.2.10, 0.2.7)
haml (4.0.5)
hpricot (0.8.6)
io-console (0.4.2)
jekyll (2.3.0)
jekyll-coffeescript (1.0.1, 1.0.0)
jekyll-gist (1.1.0)
jekyll-paginate (1.0.0)
jekyll-sass-converter (1.2.0)
jekyll-sitemap (0.5.1)
jekyll-watch (1.1.0)
json (1.7.7)
kramdown (1.4.1)
libv8 (3.16.14.3 x86_64-linux, 3.11.8.13 x86_64-linux)
liquid (2.6.1)
listen (2.7.9, 0.4.7)
mercenary (0.3.4)
multi_json (1.7.1)
octopress-date-format (2.0.1)
octopress-hooks (2.2.1)
parslet (1.5.0)
posix-spawn (0.3.9)
psych (2.0.0)
pygments.rb (0.6.0)
rack (1.5.2)
rack-protection (1.5.3)
rake (10.3.2)
rb-fsevent (0.9.4)
rb-inotify (0.9.5)
rdiscount (2.1.7.1)
rdoc (4.0.1)
redcarpet (3.1.2)
RedCloth (4.2.9)
ref (1.0.2)
ruby_parser (3.1.1)
rubypants (0.2.0)
safe_yaml (1.0.3)
sass (3.3.8, 3.2.19)
sass-globbing (1.0.0)
sassy-maps (0.4.0)
sexp_processor (4.1.5)
sinatra (1.4.5)
stringex (1.4.0)
therubyracer (0.12.1, 0.11.3)
tilt (1.4.1)
timers (1.1.0)
toml (0.1.1)
yajl-ruby (1.1.0)
I found this very helpful blogpost, basically you need to install RVM and setup ruby correctly, the steps are listed in the following post:
https://gist.github.com/lowstz/1739538

Version management of gems while working with ruby on rails

I have been coding in rails3 and have all the dependencies resolved. Now, I have moved back to rails 2 and there are lots of dependency issues. Is there any sane approach to make sure that all the gems and dependencies are resolved automatically based on the current rails version?
I keep getting this error
`default_options': undefined method `write_inheritable_attribute' for Rails::Generator::Base:Class (NoMethodError)
Error Log
from /home/saiesh/.rvm/gems/ruby-1.9.3-p429/gems/rails-2.3.8/lib/rails_generator/base.rb:90:in `<class:Base>'
from /home/saiesh/.rvm/gems/ruby-1.9.3-p429/gems/rails-2.3.8/lib/rails_generator/base.rb:85:in `<module:Generator>'
from /home/saiesh/.rvm/gems/ruby-1.9.3-p429/gems/rails-2.3.8/lib/rails_generator/base.rb:48:in `<module:Rails>'
from /home/saiesh/.rvm/gems/ruby-1.9.3-p429/gems/rails-2.3.8/lib/rails_generator/base.rb:6:in `<top (required)>'
from /home/saiesh/.rvm/rubies/ruby-1.9.3-p429/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:55:in `require'
from /home/saiesh/.rvm/rubies/ruby-1.9.3-p429/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:55:in `require'
from /home/saiesh/.rvm/gems/ruby-1.9.3-p429/gems/rails-2.3.8/lib/rails_generator.rb:37:in `<top (required)>'
from /home/saiesh/.rvm/rubies/ruby-1.9.3-p429/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:55:in `require'
from /home/saiesh/.rvm/rubies/ruby-1.9.3-p429/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:55:in `require'
from /home/saiesh/.rvm/gems/ruby-1.9.3-p429/gems/rails-2.3.8/bin/rails:15:in `<top (required)>'
from /home/saiesh/.rvm/gems/ruby-1.9.3-p429/bin/rails:19:in `load'
from /home/saiesh/.rvm/gems/ruby-1.9.3-p429/bin/rails:19:in `<main>'
from /home/saiesh/.rvm/gems/ruby-1.9.3-p429/bin/ruby_noexec_wrapper:14:in `eval'
from /home/saiesh/.rvm/gems/ruby-1.9.3-p429/bin/ruby_noexec_wrapper:14:in `<main>'
Gem List
*** LOCAL GEMS ***
actionmailer (3.2.13, 2.3.12, 2.3.8)
actionpack (3.2.13, 2.3.12, 2.3.8)
activemodel (3.2.13)
activerecord (3.2.13, 2.3.12, 2.3.8)
activeresource (3.2.13, 2.3.12, 2.3.8)
activesupport (3.2.13, 2.3.12, 2.3.8)
arel (3.0.2)
bourbon (3.0.1)
builder (3.0.4)
bundler (1.3.5)
bundler-unload (1.0.1)
cancan (1.6.10)
coffee-rails (3.2.2)
coffee-script (2.2.0)
coffee-script-source (1.6.2)
commonjs (0.2.6)
daemons (1.1.9)
delayed_job (3.0.5)
delayed_job_active_record (0.4.4)
erubis (2.7.0)
execjs (1.4.0)
formtastic (2.2.1)
formtastic-bootstrap
(2.1.3)
haml (4.0.3)
hike (1.2.3)
i18n (0.6.1)
journey (1.0.4)
jquery-rails (3.0.1, 2.3.0)
json (1.8.0)
kaminari (0.14.1)
less (2.3.2)
less-rails (2.3.3)
less-rails-fontawesome (0.5.0)
libv8 (3.11.8.17 x86-linux)
mail (2.5.4)
meta_search (1.1.3)
mime-types (1.23)
multi_json (1.7.7)
mysql (2.9.1)
mysql2 (0.3.11)
polyamorous (0.5.0)
polyglot (0.3.3)
rack (1.4.5, 1.1.6)
rack-cache (1.2)
rack-ssl (1.3.3)
rack-test (0.6.2)
rails (3.2.13, 2.3.8)
railties (3.2.13)
rake > (10.1.0, 10.0.4)
rdoc (4.0.1, 3.12.2)
ref (1.0.5)
rubygems-bundler (1.2.0)
rvm (1.11.3.8)
sass (3.2.9)
sass-rails (3.2.6)
sprockets (2.2.2)
therubyracer (0.11.4)
thor (0.18.1)
tilt (1.4.1)
treetop (1.4.14)
twitter-bootstrap-rails (2.2.7)
tzinfo (0.3.37)
uglifier (2.1.1)
why not make use of gemsets for each project?
create a file inside your app called .rvmrc
rvm use --create ruby-x.x.x-version#your_app_name
for exemple:
rvm use --create ruby-1.9.3-head#your_app_name
now when you'll run bundle it will gems to separate folder like in my case:
.rvm/gems/ruby-1.9.3-head#your_app_name
in this case switching from one app to another will load the needed gemset with gems for your app. It's like using RVM to switch between Ruby versions.

Resources