I'm getting this error:
* Exception Gem::LoadError in PhusionPassenger::Railz::ApplicationSpawner (You have already activated fastthread 1.0.1, but your Gemfile requires fastthread 1.0.7. Consider using bundle exec.) (process 27484)
in production. I have a feeling this is because Passenger is loading the fastthread from the system gems which is version 1.0.1. Then when it boots the app, the app tries to load fastthread version 1.0.7 (as required by my app), so there's a conflict.
Is there a way to tell Passenger to load its gems from my bundle instead of system?
Which version of passenger are you running? The newer versions should respect your Gemfile.
Related
When I run rails console in my production server with this command
rails c
I get this message:
You must use Bundler 2 or greater with this lockfile.
I checked bundler version:
gem list bundler
And I got this
bundler (2.0.2, default: 1.17.3, 1.16.3)
bundler-unload (1.0.2)
rubygems-bundler (1.4.4)
I read I could set bundler version with this command
bundle _2.0.2_ -v
And I got this message
Bundler version 2.0.2
But I keep getting the same error when running rails console.
Finally, some more information. My Gemfile.lock says I bundled with v2.0.1 (development bundler version). I'm using rvm in production and rbenv in development (not on purpose; I always used rbenv but I inherited an application using rvm in production).
What should I do to run rails console in production server in this situation? Can I uninstall older bundler versions and keep only v2.0.2? Should I updgrade to v2.0.2 in development to have the same versions?
Thanks!
I've just started working on a very old legacy app for a client, which is running on Ruby 1.9.3, Rails 3.2, and using JRuby on the production server. (Obstacles in upgrading the server has been a contributor to remaining on 1.9.3.)
Adding a gem to the Gemfile, even though the gem is compatible with 1.9.3, and even though I've added
ruby '1.9.3', :patchlevel => '551'
to the top of the Gemfile, Bundler continually chooses versions of other gems that require Ruby 2.0, and so updating fails. How can I get around this, without having to manually specify every single gem version that it fails on.
For example:
...
Using quiet_assets 1.1.0
Using rails 3.2.22
Using ref 2.0.0
Using rspec-rails 2.14.2
Fetching rspec_junit_formatter 0.3.0 (was 0.2.3)
Installing rspec_junit_formatter 0.3.0 (was 0.2.3)
Gem::InstallError: rspec_junit_formatter requires Ruby version >= 2.0.0.
An error occurred while installing rspec_junit_formatter (0.3.0), and Bundler cannot continue.
Make sure that `gem install rspec_junit_formatter -v '0.3.0'` succeeds before bundling.
I had to specify gem 'rspec_junit_formatter', '0.2.3', as well as all of the previous failures, in order to get this working. But that seems to defeat the purpose of Bundler. Why is Bundler ignoring Ruby versions when it builds its dependency graph, even though I've explicitly told it what version of Ruby to use?
Bundler is not ignoring the ruby version. When it installs gems it does not look at each gem and do a smart pick of which one to choose to get rid of any dependency issues (including the ruby version dependency).
In your gemfile, by not specifying the gem version, bundler will try to install the highest version it can. This is why it is good practice to specify exact versions for all your gems- so that if an update comes out for a gem in the repo you are getting the gem from- your project does not break.
Specifying the ruby version in the gem file is just like specifying the gem version for particular gem- it installs that version but does not affect the installation of any other gems.
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.
i have passenger 3.0.9 on debian with gem rack 1.3.2 and 1.2.1.
With a rails 3.0 application with passenger e bundler i have this error:
You have already activated rack 1.3.2, but your Gemfile requires rack 1.2.3. Consider using bundle exec.
With rails 3.1 is all ok. I can't make start application with rails 3.0 but only with 3.1.
Passnnger load first rack 1.3.2 and don't load rack 1.2.3 on gems of bundler
Short answer:
you need to run
bundle update rack
This will update your rack version in Gemfile.lock
Longer answer:
This error usually happens when your activated rack/rake version is different from your rails app's rack/rake version. When you run 'bundle install', some critical gems won't get update due to dependency.
That's why you need to run 'bundle update' (for all gems), or 'bundle update a_specific_gem' to update a certain gem like rack/rake in you Gemfile.lock.
What worked for me is this:
Clear your Gemfile.lock
Run bundle install
Problem fixed.
I had this exact issue on Dreamhosters.com with a recent client. I believe what I did was update my Gemfile to specify the version that is already "activated" and then rebuild the Gemfile.lock.
In my case the problem the issue was that rails was finding the system gems before my local gems and couldn't handle the conflict gracefully. It was on 3.0.3 and I didn't have the same issue on my development box where I use rvm and don't have a system ruby/rails installed at all.
I don't know that this will solve your issues but it might at least give you a starting point for further research. I found a lot of links for this by googling the error message.
The 5 whys response to your problem is:
Phusion Passenger is not using your application Bundled gems, but another set of gems.
This may be because many different reasons, but all of them related to your particular system (OS, apache/nginx, ruby, environment variables, ...).
Make sure your Gemfile is correct (especially the 'source' lines)
know which user is running your Phusion Passenger (usually is the same as your web server)
Force a bundle path for that user
BUNDLE_PATH: /home/xxxxxxx/.bundler to RAILS_ROOT/.bundle/config
or even better use bundle deployment option to install gems in vendor/bundle
bundle install --deployment
I am trying to deploy a jruby on rails application.
Right now I am running mongrel + Apache2 using reverse proxy from mod_proxy. However, because mongrel_jcluster does not work for the latest versions of jruby, I am only able to run one mongrel server, and cant take advantage of load balancing from apache2.
Is there any way other way to create a mongrel cluster? I'd really prefer mongrel cluster + apache2 to a java servlet type system.
I've tried jetty using the instructions here: http://jetty-rails.rubyforge.org/
but I get the following error when starting up the jetty server, even though I've checked my activerecord-jdbcmysql-adapter gem version under jruby and its there and version 0.9.7
DEPRECATION WARNING: require "activesupport" is deprecated and will be removed in Rails 3. Use require "active_support" instead. (called from /home/andrew/.gem/jruby/1.8/gems/activesupport-2.3.8/lib/activesupport.rb:2)
2010-07-20 17:00:46.820::INFO: Logging to STDERR via org.mortbay.log.StdErrLog
Starting server 3000
2010-07-20 17:00:47.134::INFO: jetty-6.1.14
2010-07-20 17:01:03.511:/:INFO: Info: using runtime pool timeout of 30 seconds
2010-07-20 17:01:03.511:/:INFO: Info: received min runtimes = 1
2010-07-20 17:01:03.511:/:INFO: Info: received max runtimes = 5
Loading parser from serialized file lib/stanford-parser/englishPCFG.ser.gz ... done [4.6 sec].
2010-07-20 17:01:14.341:/:WARN: Error: unable to initialize application
org.jruby.rack.RackInitializationException: Please install the jdbcmysql adapter: `gem install activerecord-jdbcmysql-adapter` (no such file to load -- active_record/connection_adapters/jdbcmysql_adapter)
any suggestions would be appreciated, thanks!
EDIT: I don't know if this makes a difference, but I am able to tell that before it crashes, jetty_rails successfully loads a global variable declared in the environment.rb
EDIT: here is my full gem list from jruby -S gem list --local
*** LOCAL GEMS ***
actionmailer (2.3.8)
actionpack (2.3.8)
activerecord (2.3.8)
activerecord-jdbc-adapter (0.9.7)
activerecord-jdbcmysql-adapter (0.9.7)
activeresource (2.3.8)
activesupport (2.3.8)
builder (2.1.2)
gem_plugin (0.2.3)
jdbc-mysql (5.0.4)
jetty-rails (0.8.1)
jruby-jars (1.5.1)
jruby-openssl (0.7)
jruby-rack (1.0.1)
mizuno (0.3.6)
mongrel (1.1.5)
rack (1.1.0)
rails (2.3.8)
rake (0.8.7)
rubyzip (0.9.4)
sources (0.0.1)
warbler (1.1.0)
Maybe you're switching between multiple ruby interpreters (via RVM or manually). Make sure
that you have 2.3.8 gems for rails and it's dependencies by running "gem list" using Jruby.
If you don't have the gems under Jruby, run "gem install -v=2.3.8 rails".
You could pack the rails gems inside the project tree by running "rake rails:freeze:gems".
The only possible answer that I know is that you have two ruby interpreters on the system, and the one being picked up by the jetty environment is missing gems. Does ruby -v give you a different answer than jruby -v?
That being said, is there a reason why you don't want to use warble and deploy a war to Jetty or Tomcat? I find that works well.