How to Install Ruby on Rails (RoR) on Debian 10

来自linux中国网wiki
Evan讨论 | 贡献2021年10月3日 (日) 13:54的版本 →‎ins
跳到导航 跳到搜索

ins

ruby-china.org 如何快速正确的安装 Ruby, Rails 运行环境

https://guides.rubyonrails.org/getting_started.html

https://ruby-china.github.io/rails-guides/getting_started.html

Rails 入门


Ruby 教程



ubuntu 18 

apt-get install -y nodejs


## Run `sudo apt-get install -y nodejs` to install Node.js 14.x and npm
## You may also need development tools to build native addons:
     sudo apt-get install gcc g++ make
## To install the Yarn package manager, run:
     curl -sL https://dl.yarnpkg.com/debian/pubkey.gpg | gpg --dearmor | sudo tee /usr/share/keyrings/yarnkey.gpg >/dev/null
     echo "deb [signed-by=/usr/share/keyrings/yarnkey.gpg] https://dl.yarnpkg.com/debian stable main" | sudo tee /etc/apt/sources.list.d/yarn.list
     sudo apt-get update && sudo apt-get install yarn




npm install --global yarn

sudo apt install yarn

sudo apt-get install ruby-dev zlib1g-dev liblzma-dev

gem install execjs
sudo gem install bundler #加多了这个 看了 ruby-china的教程 加上升级了系统 终于跑起来了
sudo  gem install rails

rails new blog
Webpacker successfully installed 🎉 🍰

cd blog/

bin/rails server

evan@myxps:~/blog$ bin/rails server
=> Booting Puma
=> Rails 6.1.4.1 application starting in development 
=> Run `bin/rails server --help` for more startup options
Puma starting in single mode...
* Puma version: 5.5.0 (ruby 2.7.4-p191) ("Zawgyi")
*  Min threads: 5
*  Max threads: 5
*  Environment: development
*          PID: 12900
* Listening on http://127.0.0.1:3000
* Listening on http://[::1]:3000
Use Ctrl-C to stop

Sun Oct 03  2021

ERROR: Failed to build gem native extension



bundle install


https://guides.rubyonrails.org/getting_started.html

可能要这些教程才行 

https://www.howtoforge.com/how-to-install-ruby-on-rails-on-debian-10/

https://codepre.com/how-to-install-ruby-on-rails-ror-on-debian-10.html?__cf_chl_jschl_tk__=pmd_4d2f0227159e0ee7b6cd475fb9856b664ea22b39-1628909169-0-gqNtZGzNAg2jcnBszQXi


打不开 有错 

	 1: from /var/lib/gems/2.7.0/gems/webpacker-5.4.0/lib/webpacker/configuration.rb:95:in `load'
/var/lib/gems/2.7.0/gems/webpacker-5.4.0/lib/webpacker/configuration.rb:103:in `rescue in load': Webpacker configuration file not found /home/evan/blog/config/webpacker.yml. Please run rails webpacker:install Error: No such file or directory @ rb_check_realpath_internal - /home/evan/blog/config/webpacker.yml (RuntimeError)


Webpacker configuration file not found /home/evan/blog/config/webpacker.yml. Please run rails webpacker:install


https://stackoverflow.com/questions/57891751/webpacker-configuration-file-not-found-rails-6-0-0

If you are running on Debian, this appears to be a known issue due to a bug in ruby-bundler. Check out [github.com/rails/thor/issues/721](this issue) for information and possible workarounds. – rmlockerd Jul 27 at 1:17


https://stackoverflow.com/questions/68535975/when-running-rake-rails-commands-i-get-typeerror-superclass-mismatch-for-class

see also

Installing and Configuring Ruby on Rails on Debian 10

How to Install Ruby on Rails (RoR) on Debian 10

how-to-install-ruby-on-rails-with-rvm-on-debian-8

trouble

https://stackoverflow.com/questions/57891751/webpacker-configuration-file-not-found-rails-6-0-0


https://github.com/rails/webpacker/issues/1082