I have tried to deploy rails spree commerce project to ubuntu 14.04 server on digitalocean. Everything were well. But when I trying to deploy the project first time I get sidekiq error. I goggling something about that issue but I didn't get any solution.
after the
mina deploy
commad.
bundling and migrations work properly till the restarting of sidekiq.
The part of the deploying code which include the error is here:
-----> Launching
-----> Stop sidekiq
Skip stopping sidekiq (no pid file found)
-----> Start sidekiq
bundler: command not found: sidekiq
Install missing gem executables with `bundle install`
! ERROR: Deploy failed.
-----> Cleaning up build
Deleting release
Unlinking current
OK
I also experienced same problem when I execute command 'mina deploy' after I update version of mina. My workaround for this problem is by modifying my gemfile to return to the older version of
'kgio' to version 2.9.2
'mina' to version 0.3.1
'mina-sidekiq' to version 0.3.0
'mina-unicorn' to version 0.0.3
After that, it works again like before
Related
What is happening with rails? A couple of days ago I everything was running smoothly and now trying to spin up the server I'm getting this error
Could not find rake-13.0.3 in any of the sources
Run `bundle install` to install missing gems.
running bundle install will create a massive cache folder under vendor and I'm able to spin up the server. However, deleting this cache folder everything breaks again. I'm running rails 6.0 and ruby 2.6.1.
I had this error when I had Ruby installed via rbenv, but rails via apt-get.
Installing rails with 'gem install' instead of 'apt' made it work for me.
I have a Rails 6 api-only application which I am failed to run at AWS Elastic Beanstalk. After deployment of that application, puma stucks with message "Early termination of worker". I don't have any custom configurations nor settings for that project. Simply created an environment and uploaded archived zip file.
After I kill puma processes with command pkill -9 -f puma my puma.log file looks like below:
=== puma startup: 2020-01-22 13:17:45 +0000 ===
=== puma startup: 2020-01-22 13:17:45 +0000 ===
[28858] Early termination of worker
[28856] Early termination of worker
[28862] Early termination of worker
[28865] Early termination of worker
[28869] Early termination of worker
I searched that error and found nothing for solve.
Ruby version: 2.6.5
Puma version 4.3.1
Rails version: 6.0.2.1
I am using Puma with Ruby 2.6 running on 64bit Amazon Linux/2.11.2 on AWS.
For the recent update from version 3.1.1 to 3.1.2 of the Ruby 2.6 running on 64bit Amazon Linux 2 platform, after checking the puma log in /var/log/puma/puma.log in my EC2 instance, it shows what you mention:
[XXXXX] Early termination of worker
[XXXXX] + Gemfile in context: /var/app/current/Gemfile
so, for checking what the actual error is, I entered my app's code folder /var/app/current and ran
pumactl start
this shows the actual error:
[XXXXX] Unable to load application: Gem::LoadError: You have already activated nio4r 2.5.3, but your Gemfile requires nio4r 2.5.2. Prepending `bundle exec` to your command may solve this.
So, since it says that there is a conflict of nio4r versions, I fixed it by forcing nio4r version to 2.5.3 adding this to my Gemfile:
gem 'nio4r', '2.5.3'
and then running bundle update, commiting and pushing changes and deploying.
Met the same error. Turns out it is a different PATCH of puma.
I was using this stack from elastic beanstalk
Ruby 2.6 AL2 version 3.0.1
64bit Amazon Linux 2 v3.0.1 running Ruby 2.6
Ruby 2.6.6-p146
RubyGems 3.1.2
Puma 4.3.3
...
My project's Gemfile included puma this way.
gem 'puma', '~> 4.3.3'
My project was a boilerplate for new projects that were coming my way, so things were working fine for "old" projects until the newer patch version, puma 4.3.5 as of now, came out.
Solution is to fix the version of the gem in the Gemfile as such:
gem 'puma', '= 4.3.3'
Lesson learnt is to always match your environment with that of your deployment tool. Keep track of the latest solution stack versions here.
Happens when Puma can't start.
Good News, you can run
bundle exec puma -p 3000 -e production
locally and then you get verbose errors.
I personally discovered a :optional tag on a has_many and some delayed_job issues that was breaking mine. So there is no one fix for this.
#Vic's answer is helpful, and you should make sure you have locked in the right Puma version, but it didn't fix my problem. For me, the issue was that a piece of my code called Rails.application.credentials[...], and the credentials weren't setup on the Elastic Beanstalk instance.
I changed that code to just use ENV variables, e.g., ENV["MY_VAR"], and set those environment variables in the Elastic Beanstalk Configuration->Software settings page.
Unfortunately, nothing in the logs I could find told me this is where my app was crashing. I had to start with a bare-bones Rails install, and slowly bring over Gems and code from my original project. Each time I added a file, I would use eb deploy to confirm it worked, and finally narrow down the problem to the one particular file that didn't work.
I forgot to tell about my project structure. I have a directory called overrides in under app/ folder.
Finally, I found at that app/overrides folder causes puma crash maybe related with this issue: How to ignore a folder in Zeitwerk for Rails 6?
After I changed my environment.rb file with ignoring app/overrides folder, my project started to run smoothly.
My puma config had an "on_worker_boot" block that was attempting a db connection. In my case I have a primary + replica setup in rails. Removing this connection statement from our puma config resolves the Early termination of worker error.
ActiveRecord::Base.establish_connection(YAML.load_file("#{app_dir}/config/database.yml")[ENV.fetch('RAILS_ENV')])
Ruby version: 2.6.2
Puma version 4.3.5
Rails version: 6.0.3.2
I had an app deployed on Heroku and I am currently trying to create the same app on AWS.
I've copied my folder, created a complete separated repo on Github and installed ebcli, the setup looks fine.
When I try to run eb deploy, I have this error:
[Instance: i-03051e2a022886184] Command failed on instance. Return code: 1 Output: (TRUNCATED)...:in find_spec_for_exe': can't find gem bundler (>= 0.a) with executable bundle (Gem::GemNotFoundException)
from /opt/rubies/ruby-2.5.3/lib/ruby/site_ruby/2.5.0/rubygems.rb:308:inactivate_bin_path'
from /opt/rubies/ruby-2.5.3/bin/bundle:23:in `'.
I've looked online and it says it comes from incompatibility between your gemlock file bundler version and actual bundler version.
I've tried to change my bundler version to this one, but I gave up and came back to 2.0.1 because I had to install too many dependencies otherwise.
I removed the gemlock, bundle again, but I still got the same error when trying to deploy.
With my heroku version, it always worked.
Any idea how to solve that?
Thanks a lot
We moved from Heroku to AWS a few months back as well and it will likely take some some custom scripting to get things to work.
It would help to know more about your EB environment, but I am assuming you are using Ruby 2.5 with Puma on Amazon Linux 2.9.0 (?)
Not sure what bundle version comes with that, But I don’t think it’s 2.x. so you have to add an .ebextensions file too install your preferred bundled version.
# .ebextensions/01_install_bundler.config
container_commands:
install_bundler:
command: “gem install bundler —-version 2.0.0”
More info on AWS Linux customizations
End of the day, we are much happier with our AWS environment (lower cost, better performance), but requires more work to get it set up
Actually the problem exists because the bundler version in the eb env is older than the one being used in the project source.
So the solution is to use a bundler version less or equal the eb env installed version.
First uninstalled the current bundler:
gem uninstall bundle
and then install the desired one:
gem install bundler -v 1.16.6
See more details
I am trying to deploy a Rails app from a Windows development machine to a Debian 9 VPS using Capistrano, Passenger, and RVM. I got RVM and Passenger set up with Apache on the VPS and Capistrano set up on the Windows machine. However, when I try to run cap production deploy, I get the following error:
bundler: failed to load command: rake (/var/www/APPNAME/shared/bundle/ruby/2.4.0/bin/rake)
One quirk of developing on Windows is that the Gemfile.lock must be edited on deployment to remove Windows-specific versions of gems. I have written a custom task to perform this action, which seems to run as expected.
Here are some files that might be useful:
log/capistrano.log, starting with the custom task
Gemfile
Gemfile.lock
Capfile
config/deploy.rb
config/deploy/production.rb
lib/capistrano/tasks/dewindowsify.rake (the custom task)
The problem was resolved after I downgraded Bundler to version 1.12.5 (it was previously version 1.15.4). I assume there is some sort of conflict with my setup and newer versions of Bundler; but until the underlying issue is patched, I will continue using the older version.
The issue is when I try to start server with rails server command after successfully created Rails app by running rails new myapp -d=mysql. However, I cant get the server to start and it gives me the following error:
Could not find gem 'mysql2 (~> 0.2.6, runtime)' in any of the gem sources listed in your Gemfile. Run `bundle install` to install missing gems.
Then I run bundle install but could not happen.
I have installed:
Ruby 1.8.7
Rails 3.0.9 with mysql
RubyGems 1.8.7
I searched everywhere but nobody can solve my problem please help me with this issue as soon as possible. I am using Ubuntu 11.04.
Thanks in advance.
If your bundle install is saying everything is installed, try prefixing your rails command with
bundle exec rails server <other args here>
That will make sure you run the server in the context of the bundle (as defined by your Gemfile). If that fixes the problem for you, then you can either keep running the server using that command, or figure out what's wrong with your environment (might be a path issue, or you might have multiple versions of ruby or bundler installed and things aren't getting installed where you think they are)
i have reinstalled rails 4.2.4 using "gem install rails" command
and generated new project using rails new helloworld
"cd helloworld" and "rails server" would started my server.