Debian安装rails出现-bash rails: command not found的解决办法

本文介绍了解决Rails命令未找到的问题方法。通过编辑/etc/profile文件并添加特定的路径变量,可以确保Rails相关命令正常运行。具体步骤包括设置RAILS_PATH环境变量指向Rails的bin目录,并更新PATH变量。
出现rails: command not found一般是由于path的原因。如下操作:
vim /etc/profile
加入

RAILS_PATH=/var/lib/gems/1.8/bin
PATH=$PATH:$RAILS_PATH
export PATH
(process:6648): VIPS-WARNING **: 00:42:28.228: unable to load "C:\Ruby34-x64\msys64\ucrt64/lib/vips-modules-8.17\vips-heif.dll" -- 'C:\Ruby34-x64\msys64\ucrt64/lib/vips-modules-8.17\vips-heif.dll': 找不到指定的模块。 (process:6648): VIPS-WARNING **: 00:42:28.231: unable to load "C:\Ruby34-x64\msys64\ucrt64/lib/vips-modules-8.17\vips-jxl.dll" -- 'C:\Ruby34-x64\msys64\ucrt64/lib/vips-modules-8.17\vips-jxl.dll': 找不到指定的模块。 (process:6648): VIPS-WARNING **: 00:42:28.231: unable to load "C:\Ruby34-x64\msys64\ucrt64/lib/vips-modules-8.17\vips-magick.dll" -- 'C:\Ruby34-x64\msys64\ucrt64/lib/vips-modules-8.17\vips-magick.dll': 找不到指定的模块。 (process:6648): VIPS-WARNING **: 00:42:28.231: unable to load "C:\Ruby34-x64\msys64\ucrt64/lib/vips-modules-8.17\vips-openslide.dll" -- 'C:\Ruby34-x64\msys64\ucrt64/lib/vips-modules-8.17\vips-openslide.dll': 找不到指定的模块。 (process:6648): VIPS-WARNING **: 00:42:28.231: unable to load "C:\Ruby34-x64\msys64\ucrt64/lib/vips-modules-8.17\vips-poppler.dll" -- 'C:\Ruby34-x64\msys64\ucrt64/lib/vips-modules-8.17\vips-poppler.dll': 找不到指定的模块。 bin/rails aborted! Bundler::GemRequireError: There was an error while trying to load the gem 'sqlite3'. (Bundler::GemRequireError) Gem Load Error is: cannot load such file -- sqlite3/sqlite3_native Backtrace for gem load error is: C:/Ruby34-x64/lib/ruby/3.4.0/bundled_gems.rb:82:in 'Kernel.require' C:/Ruby34-x64/lib/ruby/3.4.0/bundled_gems.rb:82:in 'block (2 levels) in Kernel#replace_require' C:/Ruby34-x64/lib/ruby/gems/3.4.0/gems/bootsnap-1.18.6/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:17:in 'Kernel#require' C:/Ruby34-x64/lib/ruby/gems/3.4.0/gems/zeitwerk-2.7.3/lib/zeitwerk/core_ext/kernel.rb:34:in 'Kernel#require' C:/Ruby34-x64/lib/ruby/gems/3.4.0/gems/sqlite3-2.8.0-x64-mingw-ucrt/lib/sqlite3.rb:6:in '<main>' <internal:C:/Ruby34-x64/lib/ruby/3.4.0/rubygems/core_ext/kernel_require.rb>:37:in 'Kernel#require' <internal:C:/Ruby34-x64/lib/ruby/3.4.0/rubygems/core_ext/kernel_require.rb>:37:in 'Kernel#require' C:/Ruby34-x64/lib/ruby/3.4.0/bundled_gems.rb:82:in 'block (2 levels) in Kernel.replace_require' C:/Ruby34-x64/lib/ruby/gems/3.4.0/gems/zeitwerk-2.7.3/lib/zeitwerk/core_ext/kernel.rb:34:in 'Kernel.require' C:/Ruby34-x64/lib/ruby/gems/3.4.0/gems/bundler-2.7.2/lib/bundler/runtime.rb:63:in 'block (2 levels) in Bundler::Runtime#require' C:/Ruby34-x64/lib/ruby/gems/3.4.0/gems/bundler-2.7.2/lib/bundler/runtime.rb:58:in 'Array#each' C:/Ruby34-x64/lib/ruby/gems/3.4.0/gems/bundler-2.7.2/lib/bundler/runtime.rb:58:in 'block in Bundler::Runtime#require' C:/Ruby34-x64/lib/ruby/gems/3.4.0/gems/bundler-2.7.2/lib/bundler/runtime.rb:52:in 'Array#each' C:/Ruby34-x64/lib/ruby/gems/3.4.0/gems/bundler-2.7.2/lib/bundler/runtime.rb:52:in 'Bundler::Runtime#require' C:/Ruby34-x64/lib/ruby/gems/3.4.0/gems/bundler-2.7.2/lib/bundler.rb:214:in 'Bundler.require' D:/1111/blog/config/application.rb:7:in '<main>' D:/1111/blog/Rakefile:4:in 'Kernel#require_relative' D:/1111/blog/Rakefile:4:in '<main>' C:/Ruby34-x64/lib/ruby/gems/3.4.0/gems/rake-13.3.1/lib/rake/rake_module.rb:29:in 'Kernel#load' C:/Ruby34-x64/lib/ruby/gems/3.4.0/gems/rake-13.3.1/lib/rake/rake_module.rb:29:in 'Rake.load_rakefile' C:/Ruby34-x64/lib/ruby/gems/3.4.0/gems/rake-13.3.1/lib/rake/application.rb:740:in 'Rake::Application#raw_load_rakefile' C:/Ruby34-x64/lib/ruby/gems/3.4.0/gems/rake-13.3.1/lib/rake/application.rb:126:in 'block in Rake::Application#load_rakefile' C:/Ruby34-x64/lib/ruby/gems/3.4.0/gems/rake-13.3.1/lib/rake/application.rb:214:in 'Rake::Application#standard_exception_handling' C:/Ruby34-x64/lib/ruby/gems/3.4.0/gems/rake-13.3.1/lib/rake/application.rb:125:in 'Rake::Application#load_rakefile' C:/Ruby34-x64/lib/ruby/gems/3.4.0/gems/railties-8.1.1/lib/rails/commands/rake/rake_command.rb:43:in 'block in Rails::Command::RakeCommand.with_rake' C:/Ruby34-x64/lib/ruby/gems/3.4.0/gems/rake-13.3.1/lib/rake/rake_module.rb:59:in 'Rake.with_application' C:/Ruby34-x64/lib/ruby/gems/3.4.0/gems/railties-8.1.1/lib/rails/commands/rake/rake_command.rb:41:in 'Rails::Command::RakeCommand.with_rake' C:/Ruby34-x64/lib/ruby/gems/3.4.0/gems/railties-8.1.1/lib/rails/commands/rake/rake_command.rb:20:in 'Rails::Command::RakeCommand.perform' C:/Ruby34-x64/lib/ruby/gems/3.4.0/gems/railties-8.1.1/lib/rails/command.rb:150:in 'Rails::Command.invoke_rake' C:/Ruby34-x64/lib/ruby/gems/3.4.0/gems/railties-8.1.1/lib/rails/command.rb:67:in 'block in Rails::Command.invoke' C:/Ruby34-x64/lib/ruby/gems/3.4.0/gems/railties-8.1.1/lib/rails/command.rb:143:in 'Rails::Command.with_argv' C:/Ruby34-x64/lib/ruby/gems/3.4.0/gems/railties-8.1.1/lib/rails/command.rb:63:in 'Rails::Command.invoke' C:/Ruby34-x64/lib/ruby/gems/3.4.0/gems/railties-8.1.1/lib/rails/commands.rb:18:in '<main>' C:/Ruby34-x64/lib/ruby/3.4.0/bundled_gems.rb:82:in 'Kernel.require' C:/Ruby34-x64/lib/ruby/3.4.0/bundled_gems.rb:82:in 'block (2 levels) in Kernel#replace_require' C:/Ruby34-x64/lib/ruby/gems/3.4.0/gems/bootsnap-1.18.6/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:30:in 'Kernel#require' bin/rails:4:in '<main>' Bundler Error Backtrace: D:/1111/blog/config/application.rb:7:in '<main>' D:/1111/blog/Rakefile:4:in 'Kernel#require_relative' D:/1111/blog/Rakefile:4:in '<main>' bin/rails:4:in '<main>' Caused by: LoadError: cannot load such file -- sqlite3/sqlite3_native (LoadError) <internal:C:/Ruby34-x64/lib/ruby/3.4.0/rubygems/core_ext/kernel_require.rb>:37:in 'Kernel#require' <internal:C:/Ruby34-x64/lib/ruby/3.4.0/rubygems/core_ext/kernel_require.rb>:37:in 'Kernel#require' D:/1111/blog/config/application.rb:7:in '<main>' D:/1111/blog/Rakefile:4:in 'Kernel#require_relative' D:/1111/blog/Rakefile:4:in '<main>' bin/rails:4:in '<main>' Caused by: LoadError: 127: 找不到指定的程序。 - C:/Ruby34-x64/lib/ruby/gems/3.4.0/gems/sqlite3-2.8.0-x64-mingw-ucrt/lib/sqlite3/3.4/sqlite3_native.so (LoadError) <internal:C:/Ruby34-x64/lib/ruby/3.4.0/rubygems/core_ext/kernel_require.rb>:37:in 'Kernel#require' <internal:C:/Ruby34-x64/lib/ruby/3.4.0/rubygems/core_ext/kernel_require.rb>:37:in 'Kernel#require' D:/1111/blog/config/application.rb:7:in '<main>' D:/1111/blog/Rakefile:4:in 'Kernel#require_relative' D:/1111/blog/Rakefile:4:in '<main>' bin/rails:4:in '<main>' (See full trace by running task with --trace)
最新发布
11-13
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值