Understand System.Web.Mvc, Version =5.2.3.0 - asp.net-mvc

I've had this error now three times. Working on a web api project over last few days. I'm not sure what or why this is happening and I want to fix the error.
I've looked at a previous post here. I also tried to install in the package manager: Install-Package Microsoft.AspNet.WebApi.Cors.ko -Version 5.0.0
When doing that install an error of: "already referencing a new version of Microsoft.AspNet.WebApi.Cors" is thrown and it rolls back the install.
Any help is greatly appreciated
Thanks

Microsoft.AspNet.WebApi.Cors.ko 5.0.0 requires
Microsoft.AspNet.WebApi.Cors (= 5.0.0)
Microsoft.AspNet.WebApi.Cors 5.0.0 requires
Microsoft.AspNet.WebApi.Core (>= 5.2.3 && < 5.3.0) and Microsoft.AspNet.Cors (>= 5.2.3)
be sure, that all dependencies (versions of packages) are right in your project
https://www.nuget.org/packages/Microsoft.AspNet.WebApi.Cors.ko/5.0.0
Dependencies
Microsoft.AspNet.WebApi.Cors (= 5.0.0)
https://www.nuget.org/packages/Microsoft.AspNet.WebApi.Cors/
Dependencies
Microsoft.AspNet.WebApi.Core (>= 5.2.3 && < 5.3.0)
Microsoft.AspNet.Cors (>= 5.2.3)

Related

Which Rails version is compatible with which Bundle version

I am trying to establish a rails environment. I can't use the latest version (6) because my computer needs admin rights to install NodeJS and Yarn. So I have to use an older version (say rails v4.2.2).
Trouble is, when I install this, the Bundle doesn't allow me to create a demo (using 'rails new demo'). I have tried various options but always get an error that the Bundle in incompatible.
I did manage one successful combination (rails v4.2.2 and Bundle v1.17.3) but when trying to run the server ('rails server') I get a BigDecimal error. So it seems that combo is not great either.
Essentially, could anyone advise of an installation procedure (with versions) that would lead to a successful server being run?
The most important question is not which bundler version to use but which Ruby version.
Ruby 2.4 unified Fixnum and Bignum to Integer and that change is not supported by old Ruby on Rails versions. At the same time, Ruby on Rails usually requires a minimum Ruby version – for Ruby on Rails 4.2 that was >= 1.9.3.
Therefore I would try Ruby 2.3.8 when I had to run an old Ruby on Rails 4.2 application.
Keep in mind that Rails 4.2 is unmaintained and doesn't get any security updates anymore. I cannot recommend using it anymore. When you only plan to use it as a learning exercises and do not plan to release your application on a public server, it might feel like an old version would still be safe to use. But Rails moves fast, you would learn things that might be done differently on newer version. And upgrading your application later on might be painful too. Therefore I recommend always use the latest available version for Rails when starting a new project.
Looking at my Gemfile.lock, we can safely assume rails (4.2.8) insists on bundler version to be less than 2.x:
rails (4.2.8)
actionmailer (= 4.2.8)
actionpack (= 4.2.8)
actionview (= 4.2.8)
activejob (= 4.2.8)
activemodel (= 4.2.8)
activerecord (= 4.2.8)
activesupport (= 4.2.8)
bundler (>= 1.3.0, < 2.0)

Rails keeps on asking me to "Please run `bundle install` before trying to start your application"

Everything was working fine, then all of a sudden I was not able to run "rails s" or "rails c" anymore.
I keep getting the following error msg:
The git source https://github.com/plataformatec/devise.git is not yet checked out.
Please run `bundle install` before trying to start your application
I have searched online and they said to run: spring binstubs --all, but this does not work and gives me the same error message as above.
Please help. Last thing I did was push a code to heroku and github. Rails server, console was working fine then this happens.
I have tried running bundle install, it outputs this error
...
Resolving dependencies...............
Bundler could not find compatible versions for gem "railties":
In snapshot (Gemfile.lock):
railties (= 5.0.4)
In Gemfile:
inherited_resources was resolved to 1.11.0, which depends on
railties (< 6.1, >= 5.2)
rails (~> 5.0.0) was resolved to 5.0.4, which depends on
railties (= 5.0.4)
Running `bundle update` will rebuild your snapshot from scratch, using only
the gems in your Gemfile, which may resolve the conflict.
Take note that I did not do any changes to anything, that's why its so weird. It was working 5minutes earlier then all of a sudden this occurs.
I have restarted my Mac already and issue still persists
From the stacktrace, I see the issue to be with the inherited_resources gem. If you look at the gemspec of this gem for v1.11.0 which you are currently using, you can see where it explicitly states >= 5.2 for railties. However, it appears you running rails 5.0.0 which is tied into 5.0.4 of railties.
To fix this, I suggest fixing the inherited_resources gem to v1.9.0 which can use railties 5.0.4 and then re-run bundle install
gem inherited_resources, "1.9.0"
I was able to fix just by simply uninstall and reinstalling my ruby and running bundle install
rbenv uninstall
rbenv install
gem install bundler
bundle install
rails s

Gem dependency hell installing redmine with CRM plugins

I was installing a clean Redmine 3.0 with CRM plugin on a fresh install of Ubuntu Server 14.04LTS. I succeeded with redmine and a minor plugin, but the CRM one has hit me with this:
# bundle install --without development test RAILS_ENV=production
Don't run Bundler as root. Bundler can ask for sudo if it is needed, and
installing your bundle as root will break this application for all non-root
users on this machine.
Warning: this Gemfile contains multiple primary sources. Using `source` more
than once without a block is a security risk, and may result in installing
unexpected gems. To resolve this warning, use a block to indicate which gems
should come from the secondary source. To upgrade this warning to an error, run
`bundle config disable_multisource true`.
Fetching gem metadata from https://rubygems.org/.........
Fetching version metadata from https://rubygems.org/..
Resolving dependencies...
Bundler could not find compatible versions for gem "i18n":
In Gemfile:
rails (= 4.2.0) ruby depends on
actionpack (= 4.2.0) ruby depends on
activesupport (= 4.2.0) ruby depends on
i18n (~> 0.7) ruby
money (~> 5.1.0) ruby depends on
i18n (~> 0.6.0) ruby
I installed i18n 0.6.0 and 0.7.0, didn't fix:
# gem list --local | grep i18n
i18n (0.7.0, 0.6.0)
I tried removing the Gemfile.lock and using bundler (bundle update && bundle install) again, same result.
I have no idea how to proceed with this issue. I know very little of ruby, gems and bundler and searching has failed me. Help, please.
You can't use the CRM plugin from redminecrm.com with Redmine 3 right now.
At the time of writing, the plugin is only compatible to Redmine 2.x. While the plugin will probably get updated by the authors, it is not yet compatible with Redmine 3.0.
Generally, you should not expect plugins to magically continue to work across major version updates. Especially when there was a major update recently, many plugins will not yet be compatible to the new Redmine version. If you need the plugins, you might be able to use an older version, e.g. Redmine 2.6, until all the plugins you need are updated.
You always have to check if a plugin is compatible to the Redmine version you intend to use.

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.

Impossible to do POSTs with appengine-jruby/RoR: Reflection is not allowed

I'm trying to build a site with RoR on Google App Engine. I'm using the google-appengine gem (http://appengine-jruby.googlecode.com) and following the instructions in (http://gist.github.com/268192). The problem is that I can't submit ANY form!
I've already tried this in two diferent clean Win 7 Pro envs and the result is the same.
After install Ruby 1.8.6 (One-Click Installer):
1. gem update --system
2. gem install rails
3. gem install google-appengine
4. gem install rails_dm_datastore
5. gem install activerecord-nulldb-adapter
6. curl -O http://appengine-jruby.googlecode.com/hg/demos/rails2/rails2_appengine.rb
7. ruby rails2_appengine.rb (previously downloaded)
8. rails myproj
9. chmod myproj
10. ruby script/generate dd_model MyModel f1:string f2:float f3:float f4:float f5:integer f6:integer f7:integer -f
11. ruby script/generate scaffold MyModel f1:string f2:float f3:float f4:float f5:integer f6:integer f7:integer -f --skip-migration
12. dev_appserver.rb -p 3000 .
At this point, I manually test the scaffold in (http://localhost:3000/my_models). The index is OK, then I create a new registry with the generated form, everything's fine, but when I try to create a second one, I get a "java.lang.RuntimeException: DummyDynamicScope should never be used for backref storage" in the console.
As far as I read this is a won't-fix behavior in JRuby 1.4.1, but it's converted to a debug only warning in 1.5.0, so I proceed to install the pre release.
13. gem install appengine-jruby-jars --pre
With this, that exception is solved and everything works great... until I move the project to the GAE server.
14. ruby appcfg.rb update .
And now, in (http://myproj.appspot.com/my_models), again, the index is fine, also the new form, but in the moment that I submit it with valid data, I get a 500 error: "java.lang.IllegalAccessException: Reflection is not allowed on public int".
As I said, this behavior is not present in the local SDK.
In both cases, I'm completely unable to post anything.
This is what I have right now in the GAE environment:
Ruby version 1.8.7 (java)
RubyGems disabled
Rack version 1.1
Rails version 2.3.5
Action Pack version 2.3.5
Active Support version 2.3.5
DataMapper version 0.10.2
Environment production
JRuby Runtime version 1.5.0.pre
JRuby-Rack version 0.9.7
AppEngine SDK version Google App Engine/1.3.3
AppEngine APIs version 0.0.15
And this are my intalled gems:
actionmailer (2.3.5)
actionpack (2.3.5)
activerecord (2.3.5)
activerecord-nulldb-adapter (0.2.0)
activeresource (2.3.5)
activesupport (2.3.5)
addressable (2.1.2)
appengine-apis (0.0.15)
appengine-jruby-jars (0.0.8.pre, 0.0.7)
appengine-rack (0.0.8)
appengine-sdk (1.3.3.1)
appengine-tools (0.0.12)
bundler08 (0.8.5)
dm-appengine (0.0.8)
dm-ar-finders (0.10.2)
dm-core (0.10.2)
dm-timestamps (0.10.2)
dm-validations (0.10.2)
extlib (0.9.14)
fxri (0.3.7, 0.3.6)
google-appengine (0.0.12)
hpricot (0.8.2 x86-mswin32, 0.6 mswin32)
jruby-rack (0.9.8, 0.9.7)
log4r (1.1.7, 1.0.5)
rack (1.1.0, 1.0.1)
rails (2.3.5)
rails_appengine (0.0.3)
rails_dm_datastore (0.2.9)
rake (0.8.7, 0.7.3)
rubygems-update (1.3.7, 1.3.6)
rubyzip (0.9.4)
sources (0.0.1)
win32-api (1.4.6 x86-mswin32-60, 1.0.4 mswin32)
win32-clipboard (0.5.2, 0.4.3)
win32-dir (0.3.6, 0.3.2)
win32-eventlog (0.5.2, 0.4.6)
win32-file (0.6.3, 0.5.4)
win32-file-stat (1.3.4, 1.2.7)
win32-process (0.6.2, 0.5.3)
win32-sapi (0.1.5, 0.1.4)
win32-sound (0.4.2, 0.4.1)
windows-api (0.4.0, 0.2.0)
windows-pr (1.0.9, 0.7.2)
I'm unable to attach the full logs of the exceptions because of the character limits, but I can provide them under request. Here's an abstract of them:
DummyDynamicScope (dev and prod envs):
14-may-2010 7:18:40 com.google.appengine.tools.development.ApiProxyLocalImpl log
SEVERE: [1273821520195000] javax.servlet.ServletContext log: Application Error
java.lang.RuntimeException: DummyDynamicScope should never be used for backref storage
at org.jruby.runtime.scope.DummyDynamicScope.getBackRef(DummyDynamicScope.java:49)
at org.jruby.RubyRegexp.updateBackRef(RubyRegexp.java:1404)
at org.jruby.RubyRegexp.updateBackRef(RubyRegexp.java:1396)
at org.jruby.RubyRegexp.search(RubyRegexp.java:1386)
at org.jruby.RubyRegexp.op_match(RubyRegexp.java:1301)
at org.jruby.RubyString.op_match(RubyString.java:1446)
at org.jruby.RubyString$i_method_1_0$RUBYINVOKER$op_match.call(org/jruby/RubyString$i_method_1_0$RUBYINVOKER$op_match.gen)
at org.jruby.internal.runtime.methods.JavaMethod$JavaMethodOneOrN.call(JavaMethod.java:721)
at org.jruby.RubyClass.finvoke(RubyClass.java:472)
at org.jruby.RubyObject.send(RubyObject.java:1442)
at org.jruby.RubyObject$i_method_multi$RUBYINVOKER$send.call(org/jruby/RubyObject$i_method_multi$RUBYINVOKER$send.gen)
at org.jruby.internal.runtime.methods.JavaMethod$JavaMethodZeroOrOneOrTwoOrNBlock.call(JavaMethod.java:276)
at org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:330)
at org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:189)
at ruby.jit.ruby.C_3a_.Desarrollo.AppEngine.gorgory.WEB_minus_INF.lib.gems_dot_jar.bundler_gems.jruby.$1_dot_8.gems.dm_minus_validations_minus_0_dot_10_dot_2.lib.dm_minus_validations.validators.numeric_validator.validate_with_comparison
at ruby.jit.ruby.C_3a_.Desarrollo.AppEngine.gorgory.WEB_minus_INF.lib.gems_dot_jar.bundler_gems.jruby.$1_dot_8.gems.dm_minus_validations_minus_0_dot_10_dot_2.lib.dm_minus_validations.validators.numeric_validator.validate_with_comparison
at org.jruby.internal.runtime.methods.JittedMethod.call(JittedMethod.java:102)
at org.jruby.internal.runtime.methods.DefaultMethod.call(DefaultMethod.java:144)
at org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:280)
at org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:69)
at org.jruby.ast.FCallManyArgsNode.interpret(FCallManyArgsNode.java:60)
at org.jruby.ast.NewlineNode.interpret(NewlineNode.java:104)
at org.jruby.internal.runtime.methods.InterpretedMethod.call(InterpretedMethod.java:229)
at org.jruby.internal.runtime.methods.DefaultMethod.call(DefaultMethod.java:193)
at org.jruby.RubyClass.finvoke(RubyClass.java:491)
at org.jruby.RubyObject.send(RubyObject.java:1448)
at org.jruby.RubyObject$i_method_multi$RUBYINVOKER$send.call(org/jruby/RubyObject$i_method_multi$RUBYINVOKER$send.gen)
at org.jruby.internal.runtime.methods.JavaMethod$JavaMethodZeroOrOneOrTwoOrThreeOrNBlock.call(JavaMethod.java:293)
at org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:350)
at org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:229)
at ruby.jit.ruby.C_3a_.Desarrollo.AppEngine.gorgory.WEB_minus_INF.lib.gems_dot_jar.bundler_gems.jruby.$1_dot_8.gems.dm_minus_validations_minus_0_dot_10_dot_2.lib.dm_minus_validations.validators.numeric_validator.validate_with28985350_50
at ruby.jit.ruby.C_3a_.Desarrollo.AppEngine.gorgory.WEB_minus_INF.lib.gems_dot_jar.bundler_gems.jruby.$1_dot_8.gems.dm_minus_validations_minus_0_dot_10_dot_2.lib.dm_minus_validations.validators.numeric_validator.validate_with28985350_50
at org.jruby.internal.runtime.methods.JittedMethod.call(JittedMethod.java:221)
at org.jruby.internal.runtime.methods.DefaultMethod.call(DefaultMethod.java:201)
at org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:227)
at org.jruby.ast.FCallThreeArgNode.interpret(FCallThreeArgNode.java:40)
Reflection (only prod env):
Java::JavaLang::SecurityException (java.lang.IllegalAccessException: Reflection is not allowed on public int java.lang.String$CaseInsensitiveComparator.compare(java.lang.String,java.lang.String)):
com.google.appengine.runtime.Request.process-92563a0605f433ea(Request.java)
java.lang.reflect.AccessibleObject.setAccessible(AccessibleObject.java:40)
org.jruby.javasupport.JavaMethod.<init>(JavaMethod.java:176)
org.jruby.javasupport.JavaMethod.create(JavaMethod.java:183)
org.jruby.java.invokers.MethodInvoker.createCallable(MethodInvoker.java:23)
org.jruby.java.invokers.RubyToJavaInvoker.<init>(RubyToJavaInvoker.java:63)
org.jruby.java.invokers.MethodInvoker.<init>(MethodInvoker.java:13)
org.jruby.java.invokers.InstanceMethodInvoker.<init>(InstanceMethodInvoker.java:15)
org.jruby.javasupport.JavaClass$InstanceMethodInvokerInstaller.install(JavaClass.java:339)
org.jruby.javasupport.JavaClass.installClassMethods(JavaClass.java:723)
org.jruby.javasupport.JavaClass.setupProxy(JavaClass.java:586)
org.jruby.javasupport.Java.createProxyClass(Java.java:506)
org.jruby.javasupport.Java.getProxyClass(Java.java:445)
org.jruby.javasupport.Java.getInstance(Java.java:354)
org.jruby.javasupport.JavaUtil.convertJavaToUsableRubyObject(JavaUtil.java:143)
org.jruby.javasupport.JavaClass$ConstantField.install(JavaClass.java:360)
org.jruby.javasupport.JavaClass.installClassFields(JavaClass.java:711)
org.jruby.javasupport.JavaClass.setupProxy(JavaClass.java:585)
org.jruby.javasupport.Java.createProxyClass(Java.java:506)
org.jruby.javasupport.Java.getProxyClass(Java.java:445)
org.jruby.javasupport.Java.getProxyOrPackageUnderPackage(Java.java:885)
org.jruby.javasupport.Java.get_proxy_or_package_under_package(Java.java:918)
org.jruby.javasupport.JavaUtilities.get_proxy_or_package_under_package(JavaUtilities.java:54)
org.jruby.javasupport.JavaUtilities$s_method_2_0$RUBYINVOKER$get_proxy_or_package_under_package.call(org/jruby/javasupport/JavaUtilities$s_method_2_0$RUBYINVOKER$get_proxy_or_package_under_package.gen:65535)
org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:329)
org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:188)
org.jruby.ast.CallTwoArgNode.interpret(CallTwoArgNode.java:59)
org.jruby.ast.NewlineNode.interpret(NewlineNode.java:104)
org.jruby.ast.BlockNode.interpret(BlockNode.java:71)
org.jruby.internal.runtime.methods.InterpretedMethod.call(InterpretedMethod.java:113)
org.jruby.internal.runtime.methods.DefaultMethod.call(DefaultMethod.java:138)
org.jruby.javasupport.util.RuntimeHelpers$MethodMissingMethod.call(RuntimeHelpers.java:389)
org.jruby.internal.runtime.methods.DynamicMethod.call(DynamicMethod.java:182)
What should I do now? Any hint would be wellcome. Thanks!
It's not a problem with anything you're doing. There's something going on internally in the jruby-jars that is in the process of being fixed.

Resources