Redmine (1.4.7) error in executing server in development mode - ruby-on-rails

While running redmine 1.4.7 in development mode using the command rails s, I have got error like below
/usr/local/lib/ruby/gems/2.0.0/gems/rails-2.3.15/lib/rails_generator/options.rb:32:in
`default_options': undefined method `write_inheritable_attribute' for
Rails::Generator::Base:Class (NoMethodError)
from /usr/local/lib/ruby/gems/2.0.0/gems/rails-2.3.15/lib/rails_generator/base.rb:90:in
`<class:Base>'
from /usr/local/lib/ruby/gems/2.0.0/gems/rails-2.3.15/lib/rails_generator/base.rb:85:in
`<module:Generator>'
from /usr/local/lib/ruby/gems/2.0.0/gems/rails-2.3.15/lib/rails_generator/base.rb:48:in
`<module:Rails>'
from /usr/local/lib/ruby/gems/2.0.0/gems/rails-2.3.15/lib/rails_generator/base.rb:6:in
`<top (required)>'
from /usr/local/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_require.rb:126:in
`require'
from /usr/local/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_require.rb:126:in
`require'
from /usr/local/lib/ruby/gems/2.0.0/gems/rails-2.3.15/lib/rails_generator.rb:37:in
`<top (required)>'
from /usr/local/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_require.rb:126:in
`require'
from /usr/local/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_require.rb:126:in
`require'
from /usr/local/lib/ruby/gems/2.0.0/gems/rails-2.3.15/bin/rails:15:in `<top
(required)>'
from /usr/local/bin/rails:23:in `load'
from /usr/local/bin/rails:23:in `<main>'
I have spent about 2 hours for fixing it and got some references from this link
and now am getting this error. How can I fix this??
/usr/local/lib/ruby/gems/2.0.0/gems/rails-2.3.15/lib/rails_generator/generators/applications/app/app_generator.rb:7:in `<class:AppGenerator>': Use RbConfig instead of obsolete and deprecated Config.
/usr/local/lib/ruby/gems/2.0.0/gems/rails-2.3.15/lib/rails_generator/generators/applications/app/app_generator.rb:7:in `<class:AppGenerator>': Use RbConfig instead of obsolete and deprecated Config.
/usr/local/lib/ruby/gems/2.0.0/gems/rails-2.3.15/lib/rails_generator/generators/applications/app/app_generator.rb:7:in `<class:AppGenerator>': Use RbConfig instead of obsolete and deprecated Config.
undefined method `camelize' for "app":String

I have solved this by using rvm

Try doing the following :
Install "gem uninstall rmagick" and "gem cleanup"
Run the server as bundle exec rails s

Related

search_up: undefined method 'untaint' error after Ruby upgrade

amateur coder here. In order to upgrade my Heroku stack, I have to move to a later Ruby version. I followed a tutorial to upgrade to Ruby 3.2.
After the upgrade, any time I try to do anything such as 'rails s' or 'bundle update', I get the error below. I've searched a lot online but can't find much of any use.
Any thoughts?
Many thanks for any tips
ec2-user:~/environment/website (master) $ bundle update
/home/ec2-user/.rvm/gems/ruby-3.2.0-preview1/gems/bundler-1.17.3/lib/bundler/shared_helpers.rb:272:in `search_up': undefined method `untaint' for "/home/ec2-user/environment/website":String (NoMethodError)
current = File.expand_path(SharedHelpers.pwd).untaint
^^^^^^^^
from /home/ec2-user/.rvm/gems/ruby-3.2.0-preview1/gems/bundler-1.17.3/lib/bundler/shared_helpers.rb:259:in `find_file'
from /home/ec2-user/.rvm/gems/ruby-3.2.0-preview1/gems/bundler-1.17.3/lib/bundler/shared_helpers.rb:251:in `find_gemfile'
from /home/ec2-user/.rvm/gems/ruby-3.2.0-preview1/gems/bundler-1.17.3/lib/bundler/shared_helpers.rb:27:in `root'
from /home/ec2-user/.rvm/gems/ruby-3.2.0-preview1/gems/bundler-1.17.3/lib/bundler.rb:234:in `root'
from /home/ec2-user/.rvm/gems/ruby-3.2.0-preview1/gems/bundler-1.17.3/lib/bundler.rb:246:in `app_config_path'
from /home/ec2-user/.rvm/gems/ruby-3.2.0-preview1/gems/bundler-1.17.3/lib/bundler.rb:273:in `settings'
from /home/ec2-user/.rvm/gems/ruby-3.2.0-preview1/gems/bundler-1.17.3/lib/bundler/feature_flag.rb:21:in `block in settings_method'
from /home/ec2-user/.rvm/gems/ruby-3.2.0-preview1/gems/bundler-1.17.3/lib/bundler/cli.rb:97:in `<class:CLI>'
from /home/ec2-user/.rvm/gems/ruby-3.2.0-preview1/gems/bundler-1.17.3/lib/bundler/cli.rb:7:in `<module:Bundler>'
from /home/ec2-user/.rvm/gems/ruby-3.2.0-preview1/gems/bundler-1.17.3/lib/bundler/cli.rb:6:in `<top (required)>'
from <internal:/home/ec2-user/.rvm/rubies/ruby-3.2.0-preview1/lib/ruby/3.2.0+1/rubygems/core_ext/kernel_require.rb>:85:in `require'
from <internal:/home/ec2-user/.rvm/rubies/ruby-3.2.0-preview1/lib/ruby/3.2.0+1/rubygems/core_ext/kernel_require.rb>:85:in `require'
from /home/ec2-user/.rvm/gems/ruby-3.2.0-preview1/gems/bundler-1.17.3/exe/bundle:23:in `block in <top (required)>'
from /home/ec2-user/.rvm/gems/ruby-3.2.0-preview1/gems/bundler-1.17.3/lib/bundler/friendly_errors.rb:124:in `with_friendly_errors'
from /home/ec2-user/.rvm/gems/ruby-3.2.0-preview1/gems/bundler-1.17.3/exe/bundle:22:in `<top (required)>'
from /home/ec2-user/.rvm/gems/ruby-3.2.0-preview1/bin/bundle:25:in `load'
from /home/ec2-user/.rvm/gems/ruby-3.2.0-preview1/bin/bundle:25:in `<main>'
from /home/ec2-user/.rvm/gems/ruby-3.2.0-preview1/bin/ruby_executable_hooks:22:in `eval'
from /home/ec2-user/.rvm/gems/ruby-3.2.0-preview1/bin/ruby_executable_hooks:22:in `<main>'
Ruby 3.2.0 has removed some deprecated methods (taint/trust/untaint/untrust) ,ref: https://bugs.ruby-lang.org/issues/16131 . Bundler version 1.17.3 has that method in shared_helpers.rb . Try updating bundler to 2.4.1 .
Please check before installed Gemfile.lock
you should remove Gemfile.lock before. ( cause, lock file is depends on old version ruby )

What does undefined method `configure' for nil:NilClass (NoMethodError) mean?

What does undefined method `configure' for nil:NilClass (NoMethodError) mean?
I tried reinstalling and reinstalling. I'm also have trouble updating the GEMFILE to ruby 2.4.2. Your Ruby version is 2.4.2, but your Gemfile specified 2.2.5. I tried "bundle update" removing 2.2.5 but it gives me a error... I tried everything. and now I get this nil:Nil:Class error... PLease help!
The last known error I did was to remove the .ds-store and i typed something add gitignore or something because I was having trouble with the git pull. I found this while I was troubleshooting and I also hit git commit - m " ".
This was when the nil:Nil:Class error popped up each type i try to run the rails s.
/Users/sandychow/roughhouse-web/config/application.rb:10:in `<top (required)>': undefined method `configure' for nil:NilClass (NoMethodError)
from /Users/sandychow/.rvm/gems/ruby-2.2.5/gems/railties-4.2.0/lib/rails/commands/commands_tasks.rb:78:in `require'
from /Users/sandychow/.rvm/gems/ruby-2.2.5/gems/railties-4.2.0/lib/rails/commands/commands_tasks.rb:78:in `block in server'
from /Users/sandychow/.rvm/gems/ruby-2.2.5/gems/railties-4.2.0/lib/rails/commands/commands_tasks.rb:75:in `tap'
from /Users/sandychow/.rvm/gems/ruby-2.2.5/gems/railties-4.2.0/lib/rails/commands/commands_tasks.rb:75:in `server'
from /Users/sandychow/.rvm/gems/ruby-2.2.5/gems/railties-4.2.0/lib/rails/commands/commands_tasks.rb:39:in `run_command!'
from /Users/sandychow/.rvm/gems/ruby-2.2.5/gems/railties-4.2.0/lib/rails/commands.rb:17:in `<top (required)>'
from /Users/sandychow/roughhouse-web/bin/rails:8:in `require'
from /Users/sandychow/roughhouse-web/bin/rails:8:in `<top (required)>'
from /Users/sandychow/.rvm/gems/ruby-2.2.5/gems/spring-1.1.3/lib/spring/client/rails.rb:27:in `load'
from /Users/sandychow/.rvm/gems/ruby-2.2.5/gems/spring-1.1.3/lib/spring/client/rails.rb:27:in `call'
from /Users/sandychow/.rvm/gems/ruby-2.2.5/gems/spring-1.1.3/lib/spring/client/command.rb:7:in `call'
from /Users/sandychow/.rvm/gems/ruby-2.2.5/gems/spring-1.1.3/lib/spring/client.rb:26:in `run'
from /Users/sandychow/.rvm/gems/ruby-2.2.5/gems/spring-1.1.3/bin/spring:48:in `<top (required)>'
from /Users/sandychow/.rvm/gems/ruby-2.2.5/gems/spring-1.1.3/lib/spring/binstub.rb:11:in `load'
from /Users/sandychow/.rvm/gems/ruby-2.2.5/gems/spring-1.1.3/lib/spring/binstub.rb:11:in `<top (required)>'
from /Users/sandychow/roughhouse-web/bin/spring:16:in `require'
from /Users/sandychow/roughhouse-web/bin/spring:16:in `<top (required)>'
from bin/rails:3:in `load'
from bin/rails:3:in `<main>'
Sandys-MBP:roughhouse-web sandychow$
What Ruby version manager are you using, i would suggest you to use rvm to maintain ruby manager and with rvm use ruby~2.2.5 as it is mentioned in your gem file. first go to project directory and change your ruby version to 2.2.5 and then run bundle update. this may resolve your issue. RVM

rails server bin/rails:6: warning: already initialized constant APP_PATH error

I'm using Ubuntu 14.04 and I'm a beginner using Ruby on Rails
I recently installed rbenv, ruby 2.3.0 and rails 4.2.4 following the tutorial: https://gorails.com/setup/ubuntu/14.04
After installation, I ran ruby -v and rails -v and got the expected versions. So far so good. Then I ran rails s and I got:
rails server bin/rails:6: warning: already initialized constant APP_PATH error
To fix it I ran:
rake rails:update:bin following this StackOverflow question: rails server bin/rails:6: warning: already initialized constant APP_PATH error which resulted to a new error (I also removed Spring gem):
Gem::LoadError: You have already activated rake 10.4.2, but your Gemfile requires rake 10.5.0. Prepending `bundle exec` to your command may solve this.
/my-home-directory/my-ruby-on-rails-project/config/boot.rb:3:in `<top (required)>'
/my-home-directory/my-ruby-on-rails-project/config/application.rb:1:in `<top (required)>'
/my-home-directory/my-ruby-on-rails-project/Rakefile:4:in `<top (required)>'
LoadError: cannot load such file -- bundler/setup
/my-home-directory/my-ruby-on-rails-project/config/boot.rb:3:in `<top (required)>'
/my-home-directory/my-ruby-on-rails-project/config/application.rb:1:in `<top (required)>'
/my-home-directory/my-ruby-on-rails-project/Rakefile:4:in `<top (required)>'
(See full trace by running task with --trace)
I prepend 'bundle exec' and got the following error:
/my-home-directory/my-ruby-on-rails-project/.bundle/gems/nokogiri-1.6.7.2/lib/nokogiri.rb:29:in `require': libruby.so.2.2: cannot open shared object file: No such file or directory - /my-home-directory/my-ruby-on-rails-project/.bundle/gems/nokogiri-1.6.7.2/lib/nokogiri/nokogiri.so (LoadError)
from /my-home-directory/my-ruby-on-rails-project/.bundle/gems/nokogiri-1.6.7.2/lib/nokogiri.rb:29:in `rescue in <top (required)>'
from /my-home-directory/my-ruby-on-rails-project/.bundle/gems/nokogiri-1.6.7.2/lib/nokogiri.rb:25:in `<top (required)>'
from /my-home-directory/my-ruby-on-rails-project/.bundle/gems/fog-1.23.0/lib/fog/xml.rb:1:in `require'
from /my-home-directory/my-ruby-on-rails-project/.bundle/gems/fog-1.23.0/lib/fog/xml.rb:1:in `<top (required)>'
from /my-home-directory/my-ruby-on-rails-project/.bundle/gems/fog-1.23.0/lib/fog.rb:11:in `require'
from /my-home-directory/my-ruby-on-rails-project/.bundle/gems/fog-1.23.0/lib/fog.rb:11:in `<top (required)>'
from /my-home-directory/my-ruby-on-rails-project/.bundle/gems/carrierwave-0.10.0/lib/carrierwave/storage/fog.rb:3:in `require'
from /my-home-directory/my-ruby-on-rails-project/.bundle/gems/carrierwave-0.10.0/lib/carrierwave/storage/fog.rb:3:in `<top (required)>'
from /my-home-directory/my-ruby-on-rails-project/.bundle/gems/carrierwave-0.10.0/lib/carrierwave/storage.rb:9:in `require'
from /my-home-directory/my-ruby-on-rails-project/.bundle/gems/carrierwave-0.10.0/lib/carrierwave/storage.rb:9:in `<top (required)>'
from /my-home-directory/my-ruby-on-rails-project/.bundle/gems/carrierwave-0.10.0/lib/carrierwave.rb:78:in `require'
from /my-home-directory/my-ruby-on-rails-project/.bundle/gems/carrierwave-0.10.0/lib/carrierwave.rb:78:in `<top (required)>'
from /my-home-directory/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/bundler-1.11.2/lib/bundler/runtime.rb:77:in `require'
from /my-home-directory/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/bundler-1.11.2/lib/bundler/runtime.rb:77:in `block (2 levels) in require'
from /my-home-directory/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/bundler-1.11.2/lib/bundler/runtime.rb:72:in `each'
from /my-home-directory/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/bundler-1.11.2/lib/bundler/runtime.rb:72:in `block in require'
from /my-home-directory/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/bundler-1.11.2/lib/bundler/runtime.rb:61:in `each'
from /my-home-directory/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/bundler-1.11.2/lib/bundler/runtime.rb:61:in `require'
from /my-home-directory/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/bundler-1.11.2/lib/bundler.rb:99:in `require'
from /my-home-directory/my-ruby-on-rails-project/config/application.rb:7:in `<top (required)>'
from /my-home-directory/my-ruby-on-rails-project/.bundle/gems/railties-4.2.4/lib/rails/commands/commands_tasks.rb:78:in `require'
from /my-home-directory/my-ruby-on-rails-project/.bundle/gems/railties-4.2.4/lib/rails/commands/commands_tasks.rb:78:in `block in server'
from /my-home-directory/my-ruby-on-rails-project/.bundle/gems/railties-4.2.4/lib/rails/commands/commands_tasks.rb:75:in `tap'
from /my-home-directory/my-ruby-on-rails-project/.bundle/gems/railties-4.2.4/lib/rails/commands/commands_tasks.rb:75:in `server'
from /my-home-directory/my-ruby-on-rails-project/.bundle/gems/railties-4.2.4/lib/rails/commands/commands_tasks.rb:39:in `run_command!'
from /my-home-directory/my-ruby-on-rails-project/.bundle/gems/railties-4.2.4/lib/rails/commands.rb:17:in `<top (required)>'
from bin/rails:8:in `require'
from bin/rails:8:in `<main>'
Before installing rbenv, I was using RVM and I had the same errors popping around. I can't figure out what changes I've done when I started having these issues.
For the sake of my sanity, any help is very appreciated!
Thank you all!
A friend of mine just helped me and fixed this.
What he suggested:
Create a file .ruby-version in my project directory with one line: ruby-2.3.0 - This will make sure that we're not loading another nokogiri version
Remove the bundler by running: rm -rfv .bundle
Then run: bundle
Run: bundle exec rails s
Works like a charm.
I asked him why he thinks I had these issues and said: Hard to say, a messed up .bundle directory can do a lot of funky stuff.

I get error after using rails new command

I get error after I use rails new command-
Pareshs-MacBook-Pro:Desktop psghodge$ rails new lynda_cms
/usr/local/rvm/gems/ruby-2.0.0-p353/gems/rails-2.3.5/lib/rails_generator/options.rb:32:in `default_options': undefined method `write_inheritable_attribute' for Rails::Generator::Base:Class (NoMethodError)
from /usr/local/rvm/gems/ruby-2.0.0-p353/gems/rails-2.3.5/lib/rails_generator/base.rb:90:in `<class:Base>'
from /usr/local/rvm/gems/ruby-2.0.0-p353/gems/rails-2.3.5/lib/rails_generator/base.rb:85:in `<module:Generator>'
from /usr/local/rvm/gems/ruby-2.0.0-p353/gems/rails-2.3.5/lib/rails_generator/base.rb:48:in `<module:Rails>'
from /usr/local/rvm/gems/ruby-2.0.0-p353/gems/rails-2.3.5/lib/rails_generator/base.rb:6:in `<top (required)>'
from /usr/local/rvm/rubies/ruby-2.0.0-p353/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_require.rb:126:in `require'
from /usr/local/rvm/rubies/ruby-2.0.0-p353/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_require.rb:126:in `require'
from /usr/local/rvm/gems/ruby-2.0.0-p353/gems/rails-2.3.5/lib/rails_generator.rb:34:in `<top (required)>'
from /usr/local/rvm/rubies/ruby-2.0.0-p353/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_require.rb:126:in `require'
from /usr/local/rvm/rubies/ruby-2.0.0-p353/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_require.rb:126:in `require'
from /usr/local/rvm/gems/ruby-2.0.0-p353/gems/rails-2.3.5/bin/rails:14:in `<top (required)>'
from /usr/local/rvm/gems/ruby-2.0.0-p353/bin/rails:23:in `load'
from /usr/local/rvm/gems/ruby-2.0.0-p353/bin/rails:23:in `<main>'
from /usr/local/rvm/gems/ruby-2.0.0-p353/bin/ruby_executable_hooks:15:in `eval'
from /usr/local/rvm/gems/ruby-2.0.0-p353/bin/ruby_executable_hooks:15:in `<main>'
Judging by your error, you're trying to use Rails v2.3.5 with ruby 2.0.0. Without doing a lot of googling I can't be certain, but I'm fairly sure that old versions of Rails like that only work with ruby 1.8.7.
Unless you have a really good reason to use a version of Rails that old, you shouldn't do it.
Use a new Rails, or if you have to use that Rails then install ruby 1.8.7

rails server command WINDOWS

I am completely new to ror and am following Michael Hartl's tutorial but I keep getting an error when I get to section 1.2.5. using the rails server command. When I use this command (whilst I am in my rail app directory 'first_app') I get the following error
c:\Users\rails_projects\first_app>rails server
c:/rails_projects/first_app/config/application.rb:7:in `<top (required)>': undefined method `groups' for Rails:
Module (NoMethodError)
from C:/Ruby193/lib/ruby/gems/1.9.1/gems/railties-3.0.11/lib/rails/comma
nds.rb:28:in `require'
from C:/Ruby193/lib/ruby/gems/1.9.1/gems/railties-3.0.11/lib/rails/comma
nds.rb:28:in `block in <top (required)>'
from C:/Ruby193/lib/ruby/gems/1.9.1/gems/railties-3.0.11/lib/rails/comma
nds.rb:27:in `tap'
from C:/Ruby193/lib/ruby/gems/1.9.1/gems/railties-3.0.11/lib/rails/comma
nds.rb:27:in `<top (required)>'
from script/rails:6:in `require'
from script/rails:6:in `<main>'
I can't figure out what went wrong, my bundle installed fine (section 1.2.4).
If your Gemfile is not set to use rails 3.1 or greater, try updating to 3.1.

Resources