"fat free crm" installation failling on Windows 10 - ruby-on-rails

I am trying to install fat free crm on a Windows 10 machine, but so far I have been unsuccessful. This is my latest attempt. Any help will be greatly appreciated.
Running bundler install gives me these messages:
Bundler 2.3.7 is running, but your lockfile was generated with 2.3.10. Installing Bundler 2.3.10 and restarting using that version.
Fetching gem metadata from https://rubygems.org/.
Fetching bundler 2.3.10
Installing bundler 2.3.10
Fetching gem metadata from https://rubygems.org/.........
Lots of successfully installed gems later:
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.
current directory:
C:/Ruby31-x64/lib/ruby/gems/3.1.0/gems/libv8-node-16.10.0.0/ext/libv8-node
C:/Ruby31-x64/bin/ruby.exe -I C:/Ruby31-x64/lib/ruby/3.1.0 -r
./siteconf20221119-16700-fgt0qd.rb extconf.rb
creating Makefile
C:/Ruby31-x64/lib/ruby/gems/3.1.0/gems/libv8-node-16.10.0.0/ext/libv8-node/builder.rb:12:in
`build_libv8!': failed to download node 16.10.0 (Libv8::Node::BuilderError)
from
C:/Ruby31-x64/lib/ruby/gems/3.1.0/gems/libv8-node-16.10.0.0/ext/libv8-node/location.rb:30:in
`install!'
from extconf.rb:9:in `<main>'
==== in
C:/Ruby31-x64/lib/ruby/gems/3.1.0/gems/libv8-node-16.10.0.0/ext/libv8-node
==== running
C:/Ruby31-x64/lib/ruby/gems/3.1.0/gems/libv8-node-16.10.0.0/libexec/download-node
extconf failed, exit code 1
My node version is v18.12.1, by the way. (Do I need an older one?)
Anyway, here is the exact sequence of actions before running bundler install inside my local git clone of fat_free_crm:
First, the repository I am using:
https://github.com/fatfreecrm/fat_free_crm
My Ruby version:
ruby 3.1.2p20 (2022-04-12 revision 4491bb740a) [x64-mingw-ucrt]
For a fresh start, I uninstall all gems, including rails:
gem uninstall -aIx
The latest commit on the bin folder says: Upgrade to Rails 6 so I install the latest rails 6 version on my machine:
gem install rails -v 6.1.7
I clone the repository from github:
git clone https://github.com/fatfreecrm/fat_free_crm.git
Since I am using sqlite3 for this, I comment out all other db gems in the Gemfile and only leave this one:
gem 'sqlite3', '~> 1.4.0'
Then, I copy database.sqlite.yml into database.yml.
Then, I run bundler install from within the directory fat_free_crm, which gives me this:
Ensure you have either installed the shared-mime-info package for your distribution, or
obtain a version of freedesktop.org.xml and set FREEDESKTOP_MIME_TYPES_PATH to the location of that file.
I (hopefully) solved that problem with this stackoverflow solution: Error installing ruby on rails on windows 10
Afterwards, I run bundler install again, which gives the error messages that I mentioned at the top of my description.
Any help will be greatly appreciated.
P.S.: I am trying to get back into Ruby on Rails after a long break, so please forgive me, if I made any stupid mistakes.

Related

Bundle install errors and cannot continue, even after installing missing gems

I am working on multiple Ruby on Rails applications and running...
MacOS 10.15.7,
Ruby 2.6.5,
Rails 5.2.3,
In a project app directory I am trying to run a bundle install and get the following error:
An error occurred while installing jaro_winkler (1.5.3), and Bundler cannot continue.
Make sure that `gem install jaro_winkler -v '1.5.3' --source
'https://.../api/gems/rubygems/'` succeeds before bundling.
I proceed to install the gem from the specified source and get confirmation of install
Building native extensions. This could take a while...
Successfully installed jaro_winkler-1.5.3
Parsing documentation for jaro_winkler-1.5.3
Done installing documentation for jaro_winkler after 0 seconds
1 gem installed
after running bundle install again, I will get the original error
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.
current directory:
/private/var/folders/yr/dw4ljvv14cl9vp76jt_6zqrsv1qhkf/T/bundler20210406-62421-1bm7o1ijaro_winkler-1.5.3/gems/jaro_winkler-1.5.3/ext/jaro_winkler
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/bin/ruby -I
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0 -r
./siteconf20210406-62421-10txxc5.rb extconf.rb
creating Makefile
current directory:
/private/var/folders/yr/dw4ljvv14cl9vp76jt_6zqrsv1qhkf/T/bundler20210406-62421-1bm7o1ijaro_winkler-1.5.3/gems/jaro_winkler-1.5.3/ext/jaro_winkler
make "DESTDIR=" clean
current directory:
/private/var/folders/yr/dw4ljvv14cl9vp76jt_6zqrsv1qhkf/T/bundler20210406-62421-1bm7o1ijaro_winkler-1.5.3/gems/jaro_winkler-1.5.3/ext/jaro_winkler
make "DESTDIR="
make: *** No rule to make target
`/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/include/ruby-2.6.0/universal-darwin19/ruby/config.h',
needed by `adj_matrix.o'. Stop.
make failed, exit code 2
Gem files will remain installed in
/var/folders/yr/dw4ljvv14cl9vp76jt_6zqrsv1qhkf/T/bundler20210406-62421-1bm7o1ijaro_winkler-1.5.3/gems/jaro_winkler-1.5.3
for inspection.
Results logged to
/var/folders/yr/dw4ljvv14cl9vp76jt_6zqrsv1qhkf/T/bundler20210406-62421-1bm7o1ijaro_winkler-1.5.3/extensions/universal-darwin-19/2.6.0/jaro_winkler-1.5.3/gem_make.out
An error occurred while installing jaro_winkler (1.5.3), and Bundler cannot continue.
Make sure that `gem install jaro_winkler -v '1.5.3' --source
'https://.../api/gems/rubygems/'` succeeds before bundling.
The error message above doesn't give me any clear indication of what is happening. Additionally there is no such directory in the location where the message says "results logged to."
This seems to be happening in multiple application directories - but with different affected gems in each directory. They are all similar in that the error reads "make sure gem succeeds before bundling", then the gem install will succeed, and then the following bundle install will fail with the same original message.
Earlier today I did a clean Ruby 2.6.5 install and updated the Xcode CLI via xcode-select --install
If I run gem which jaro_winkler I get
/Users/{username}/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/gems/jaro_winkler-1.5.3/lib/jaro_winkler.rb
Does anyone have any information on what could be causing this? I cannot do any bundle install without this happening. Please let me know if any more information is desired.
Thank you!
You mentioned that you are using ruby 2.6.5, but the gem is attempting to be installed in 2.6.0. Check that your Gemfile has the correct Ruby version in it.
When you ran gem which, it looks you are using rbenv. Make sure that you are using the correct Ruby version in there, too. Those rubies get installed in a different directory than xcode's. Sometimes there's a .rbenv file in the dir that will set the version as well.
Just some ideas. Hopefully something sticks.
Ended up being an issue with gem install location - export PATH="/usr/local/bin:$PATH" was previously added to my .bash_profile and this was effecting where gems were installed.
Somewhere in the error message /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/bin/ruby is mentioned - this is the "system default" Mac version of Ruby and is not the Ruby version I was intending to use with .rbenv ( 2.6.5 ) and gem installs.
Removing the export mentioned above help resolve the issue.
edit- wording

An error occurred while installing RedCloth (4.2.7), and Bundler cannot continue

I have an app on the Heroku Bamboo stack and have been following the instructions here (https://devcenter.heroku.com/articles/cedar-migration) for migrating to the Cedar stack.
My app has an older version of RefineryCMS (1.0.3) and I'm trying to avoid dealing with an upgrade there (for now), and so I've kept Rails at 3.0.9. Still, Ruby 1.8.7 is past EOL, so I needed to upgrade that at least. I specified 1.9.3 in my Gemfile, thus:
source "https://rubygems.org"
ruby "1.9.3"
And then I attempted to bundle install. Here's my output from that attempt:
Fetching gem metadata from https://rubygems.org/..........
Fetching version metadata from https://rubygems.org/...
Fetching dependency metadata from https://rubygems.org/..
Resolving dependencies....
Using rake 0.8.7
Installing RedCloth 4.2.7 with native extensions
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.
/Users/day/.rvm/rubies/ruby-1.9.3-p551/bin/ruby -r ./siteconf20151105-14593-x80q4a.rb extconf.rb
checking for main() in -lc... no
creating Makefile
make clean
make
compiling redcloth_attributes.c
ragel/redcloth_attributes.c.rl: In function 'redcloth_attribute_parser':
ragel/redcloth_attributes.c.rl:26:11: error: variable 'act' set but not used [-Werror=unused-but-set-variable]
ragel/redcloth_attributes.c.rl: In function 'redcloth_attributes':
ragel/redcloth_attributes.c.rl:45:3: error: ISO C90 forbids mixed declarations and code [-Werror=declaration-after-statement]
ragel/redcloth_attributes.c.rl: In function 'redcloth_link_attributes':
ragel/redcloth_attributes.c.rl:54:3: error: ISO C90 forbids mixed declarations and code [-Werror=declaration-after-statement]
cc1: all warnings being treated as errors
make: *** [redcloth_attributes.o] Error 1
make failed, exit code 2
Gem files will remain installed in /Users/day/.rvm/gems/ruby-1.9.3-p551/gems/RedCloth-4.2.7 for inspection.
Results logged to /Users/day/.rvm/gems/ruby-1.9.3-p551/extensions/x86_64-darwin-14/1.9.1/RedCloth-4.2.7/gem_make.out
An error occurred while installing RedCloth (4.2.7), and Bundler cannot continue.
Make sure that `gem install RedCloth -v '4.2.7'` succeeds before bundling.
Needless to say gem install RedCloth -v '4.2.7' resulted in the same error.
I found this question, Failed to build gem native extension when install RedCloth-4.2.9 install Linux, however, my issue was with RedCloth 4.2.7 (not 4.2.9) and I'm running OSX Yosemite (not Linux). There was an answer there which pertained to OSX Mountain Lion though, and I thought it was worth a try:
rvm --force install 1.9.2
gem install bundle --no-ri --no-rdoc
bundle install
Obviously, I changed 1.9.2 to 1.9.3 for my purposes, and I omitted the --no-ri --no-rdoc flags. Sadly, bundle install continued to fail with the same error.
Continuing my search online, I found this article, Install RedCloth 4.2.7 gem with bundler (using ruby enterprise edition 1.8.7). Not dissuaded by the version mismatch (again, I'm using Ruby 1.9.3, not 1.8.7), I decided to try the advice I found there, to wit:
bundle config build.RedCloth --with-cflags=-w
bundle install
This time, oh joy! it worked! And I'm on to whatever's next. I thought I would share this little journey here for any others who find themselves in the same predicament. Cheers!
I was able to resolve this issue by specifying extra build options for Bundler which are applied when building RedCloth, as follows:
bundle config build.RedCloth --with-cflags=-w
bundle install

How to install ruby on rails

I am newbie to ruby on rails, here i am trying to install ruby on rails on windows 7 64 bit. i installed the ruby installer and i installed rails. and also i created new app files. but when i start the rails server it is showing the following errors.
How can i get rid of these errors and start developing my ruby application?
C:\Users\walnut\Desktop > bundle install
Fetching gem metadata from https://rubygems.org/............
Fetching version metadata from https://rubygems.org/...
Fetching dependency metadata from https://rubygems.org/..
Resolving dependencies.................
Using rake 10.4.2
Using i18n 0.7.0
Installing json 1.8.3 with native extensions
Gem::InstallError: The 'json' native gem requires installed build tools.
Please update your PATH to include build tools or download the DevKit
from 'http://rubyinstaller.org/downloads' and follow the instructions
at 'http://github.com/oneclick/rubyinstaller/wiki/Development-Kit'
An error occurred while installing json (1.8.3), and Bundler cannot continue.
Make sure that `gem install json -v '1.8.3'` succeeds before bundling.
C:\Users\walnut\Desktop > rails s
Could not find gem 'mysql2 (>= 0) x64-mingw32' in any of the gem sources listed
in your Gemfile or available on this machine.
Run `bundle install` to install missing gems.
C:\Users\walnut\Desktop > gem install mysql2
Fetching: mysql2-0.3.19.gem (100%)
ERROR: Error installing mysql2:
The 'mysql2' native gem requires installed build tools.
Please update your PATH to include build tools or download the DevKit
from 'http://rubyinstaller.org/downloads' and follow the instructions
at 'http://github.com/oneclick/rubyinstaller/wiki/Development-Kit'
C:\Users\walnut\Desktop > rails s
Could not find gem 'mysql2 (>= 0) x64-mingw32' in any of the gem sources listed
in your Gemfile or available on this machine.
Run `bundle install` to install missing gems.
From here,
Follow the Instructions from the Ruby Installer Developer Kit Wiki:
Download DevKit file from rubyinstaller.org
Extract DevKit to path C:\RubyXXX\DevKit
Run cd C:\RubyXXX\DevKit
Run ruby dk.rb init
Run ruby dk.rb review
Run ruby dk.rb install
Where did you create your application? If you look at your command line, you are in your Desktop. You need to switch directories to your project folder to be in the right context.
Additionally, you need to install build tools to install json native extensions.
Please refer to/follow instructions from this other stack overflow answer - The 'json' native gem requires installed build tools.
As the error suggest you have to update your PATH to include build tools also known as DevKit.
If you have used RailsInstaller to install ruby on rails on your computer then it has already included in your rails installation directory. All you have to do now is to update your PATH to include it. See step 4 of instruction in DevKit Overview on Github.
If not follow above instruction to install DevKit and then get to work.
Try follow this step and one more thing, if you use x64 of ruby installer, then please use x64 devkit. Same applied to x86. I'm facing this issues and the link gave it(step to install) to you save my time. Hope this helped.
p/s : if i'm correct in windows, ruby v2.2 above was't support higher nokogiri, to get things working properly use either ruby v1.9.3 or v2.1.6.
Check this link also for nokogiri supported.

Ruby on windows causes error Cannot load such file bcrypt_ext

Trying to run ruby on my Windows 7 machine whenever i go to rails s or rake db:migrate i get the following error Cannot load such file bcrypt_ext.
My ruby version is 2.2.1 my rails version is 4.2.0 and the bcrypt version is 3.1.10. All the gems install correctly when i run bundle install however whenever i try to rake it gives me that error. Any help would be greatly appreciated
You need to use what it says here: https://www.alib.jp/entries/bcrypt_ext_load_error_on_ruby21x
C:\> gem install --no-ri --no-rdoc bcrypt
C:\> cd (path to gems root)\bcrypt-3.1.7-x86-mingw32\ext\mri
C:\(path to gems root)\bcrypt-3.1.7-x86-mingw32\ext\mri> ruby extconf.rb
C:\(path to gems root)\bcrypt-3.1.7-x86-mingw32\ext\mri> make
C:\(path to gems root)\bcrypt-3.1.7-x86-mingw32\ext\mri> make install
I meet the same problem in Window 8.1 64bit , Ruby 2.3.3 64bit , Rails 4.2.10.
My quick solution :
Step 1 : Remove all bcrypt in gem : gem uninstall bcrypt ( choose option 3 if existed (remove all))
Step 2 : Install bcrypt again : gem install bcrypt
Then check version of bcrypt : gem list bcrypt
Step 3 : In Gemfile of your project, add : gem 'bcrypt', '3.1.11', platforms: [:ruby, :x64_mingw]
notice : change the suitable version of your bcrypt (my version : 3.1.11)
Step 4 : Run command in the path of your project : bundle install
Step 5 : Remove the unneeded bcrypt :
Run command : gem uninstall bcrypt
You can see some version of bcrypt , you should keep one version : bcrypt-[your-version] . (Remove all version : bcrypt-[your-version]-x64-mingw32 . In mycase , remove : bcrypt-3.1.11-x64-mingw32)
Restart Rails sever , done
I think this proplem because when we install bcrypt , we didn't specify 64bit or 32bit , it is not compatible with window or ruby ( 64bit or 32bit )
For Windows 10, bcrypt 3.1.11 now works, checked in 24144
steps:
shut down all rails servers
uninstall all versions of bcrypt
manually install v3.1.1 (gem install bcrypt -v '3.1.11')
update gem files of projects
current versions
ruby 2.2.4p230 (2015-12-16 revision 53155) [i386-mingw32]
OS Name: Microsoft Windows 10 Pro
OS Version: 10.0.10586 N/A Build 10586
The dirty quick workaround is to install the mri version with
gem install bcrypt --platform=ruby
worked for me.
Fetching: bcrypt-3.1.11.gem (100%)
Temporarily enhancing PATH to include DevKit...
Building native extensions. This could take a while...
Successfully installed bcrypt-3.1.11
source:
topac commented on Apr 17, 2015
https://github.com/codahale/bcrypt-ruby/issues/116
Rich Peck solution worked for me with a small update. Make sure the devkit is included in the environment path.(Check it by typing path in the command prompt) If its not included,you need to add the devkit/bin and devkit/mingw/bin paths to your PATH var.
Otherwise - make: x86_64-w64-mingw32-gcc: Command not found - error will be thrown while you make the file.
Once the error is fixed, then i am able to make the file and the bcrypt_ext issue is solved.
Most likely the compiled gem binaries don't contain binaries for Ruby 2.2.1. This is because there is a problem with cross-compiling Ruby with a Windows target. See this answer for more details.
The best alternative is to downgrade to Ruby 2.1.5.
You can try to compile the gem yourself, but that's a totally different beast. In some cases, like nokogiri, it's not even possible.

Cannot install state_machines gem in Windows environment

I am new to Rails and would like to check how Spree ecommerce solution looks like before the customization. That's why I installed Ruby from RubyInstaller, DevKit, Rails, Spree etc.
During installation of state_machines gem, below error appears and the gem is eventually not installed.
C:\>gem install state_machines
ERROR: While executing gem ... (Errno::EINVAL)
Invalid argument # rb_sysopen - C:/Dev/Ruby/lib/ruby/gems/2.1.0/gems/state_m
achines- 0.2.2/test/unit/node_collection/node_collection_after_being_copied_test.rb
This has impact on the bundle install of spree project later on:
Errno::EINVAL: Invalid argument # rb_sysopen - C:/Dev/Ruby/lib/ruby/gems/2.1.0/g
ems/state_machines-0.2.2/test/unit/node_collection/node_collection_after_being_c
opied_test.rb
An error occurred while installing state_machines (0.2.2), and Bundler cannot
continue.Make sure that `gem install state_machines -v '0.2.2'`
succeeds before bundling.
Current ruby version installed is:
ruby 2.1.5p273 (2014-11-13 revision 48405) [i386-mingw32] + devkit
rails version is 4.2.0
I am running on Windows environment, without any possibility to move to Linux.
I ran into this too.
Looks like state_machines has some test case files that have a newline in the name.
I'd bet that is the cause of the issue.
I've submitted a pull request over here: https://github.com/state-machines/state_machines/pull/11
In the meantime, my branch doesn't have the issue: https://github.com/jeff-hamm/state_machines
The specific fix (for the moment, until the pullrequest is accepted) is:
git clone https://github.com/jeff-hamm/state_machines
cd state_machines
bundle gem state_machines
rake install
After doing that, 'gem install spree_core' worked just fine on windows.
Keep in mind I am not planning on keeping my branch up to date (I will delete it if the request is accepted), so, that clone url won't be ideal for long

Resources